CN117473192A - Method, device, electronic equipment and computer readable medium for providing web page - Google Patents

Method, device, electronic equipment and computer readable medium for providing web page Download PDF

Info

Publication number
CN117473192A
CN117473192A CN202311256691.7A CN202311256691A CN117473192A CN 117473192 A CN117473192 A CN 117473192A CN 202311256691 A CN202311256691 A CN 202311256691A CN 117473192 A CN117473192 A CN 117473192A
Authority
CN
China
Prior art keywords
web page
browser
configuration file
history
server
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
CN202311256691.7A
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.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili 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 Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN202311256691.7A priority Critical patent/CN117473192A/en
Publication of CN117473192A publication Critical patent/CN117473192A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application provides a method, a device, electronic equipment and a computer readable medium for providing a webpage, wherein the application responds to receiving a configuration file for at least part of a target webpage from a service provider, and reads the name and identification of the configuration file, wherein the service provider is used for providing service support for the target webpage based on the configuration file; responding to the existence of a history configuration file with the same history name and name, and detecting whether a history identification mark and an identification mark of the history configuration file are the same; responsive to the historical identification being different from the identification, executing the configuration file to update at least part of the profile; and in response to the target web page being updated upon receipt of a transmitted access request by the browser for the target web page, rendering the updated target web page locally to generate a viewable web page provided to the browser. Therefore, the server can accurately identify the condition that the configuration file is updated, and efficiency and quality in updating the content in the webpage are improved.

Description

Method, device, electronic equipment and computer readable medium for providing web page
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and apparatus for providing a web page, an electronic device, and a computer readable medium.
Background
With the development of computer technology and internet technology, service providers (or, service providers) may utilize prior web pages to provide services, content, and the like to users. For example, the service provider can build a framework of the webpage through the configuration file, and render and generate a visual and viewable webpage after adding the service and the content corresponding to each part in the framework, so that the user can acquire the content based on the access webpage. For example, after providing the user with the uniform resource identifier of the web page, the user may correspondingly access the web page by uniformly assigning the resource identifier.
Accordingly, after accessing these web pages, the user may utilize the web pages to correspondingly obtain content provided by the service provider. For example, a user may utilize a web page to obtain video content online by accessing a web page provided by a video provider. Thus, how to facilitate rendering and how to update web page content conveniently is of great concern and urgent need.
Disclosure of Invention
Aspects of the present invention provide a method, an apparatus, an electronic device, and a computer readable storage medium for providing a web page, which are applied to a server, so that the server can accurately identify that a configuration file is updated in a process of rendering and obtaining a viewable web page based on the configuration file, timely and accurately update content in the web page, and improve efficiency and quality when updating the content in the web page.
In one aspect of the present application, a method for providing a web page is provided, which is applied to a server, and includes: in response to receiving a configuration file for at least a portion of the target web page from a service provider, reading a name and an identification of the configuration file, wherein the service provider is to provide service support to the target web page based on the configuration file; responding to the existence of a history configuration file with the same history name and name, and detecting whether a history identification mark and an identification mark of the history configuration file are the same; responsive to the historical identification being different from the identification, executing the configuration file to update at least part of the profile; and in response to the target web page being updated upon receipt of a transmitted access request by the browser for the target web page, rendering the updated target web page locally to generate a viewable web page provided to the browser. Therefore, the server can accurately identify the condition that the configuration file is updated, and efficiency and quality in updating the content in the webpage are improved.
In another aspect of the present application, there is provided an apparatus for providing a web page, including: a reading module configured to read a name and an identification of a configuration file in response to receiving the configuration file for at least a portion of the target web page from a service provider, wherein the service provider is configured to provide service support to the target web page based on the configuration file; the detection module is configured to respond to the existence of the history configuration file with the same history name and name, and detect whether the history identification mark and the identification mark of the history configuration file are the same; an execution module configured to execute the configuration file to update at least a portion in response to the historical identification being different from the identification; and a rendering module configured to render the updated target web page locally to generate a viewable web page provided to the browser in response to the target web page being updated upon receipt of a transmitted access request by the browser for the target web page.
In another aspect of the present application, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of providing web pages as provided above.
In another aspect of the present application, a computer-readable storage medium having stored thereon computer program instructions executable by a processor to implement a method of providing a web page as provided above is provided.
In the scheme provided by the embodiment of the application, in response to receiving the configuration file aiming at least part of the target webpage from the service provider, reading the name and the identification mark of the configuration file, wherein the service provider is used for providing service support for the target webpage based on the configuration file; responding to the existence of a history configuration file with the same history name and name, and detecting whether a history identification mark and an identification mark of the history configuration file are the same; responsive to the historical identification being different from the identification, executing the configuration file to update at least part of the profile; and in response to the target web page being updated upon receipt of a transmitted access request by the browser for the target web page, rendering the updated target web page locally to generate a viewable web page provided to the browser. Therefore, the server can accurately identify the condition that the configuration file is updated, and efficiency and quality in updating the content in the webpage are improved. Therefore, the server can accurately identify the condition that the configuration file is updated, and efficiency and quality in updating the content in the webpage are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained according to these drawings without inventive effort to a person skilled in the art.
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the following drawings, in which:
FIG. 1 is a schematic diagram illustrating a process of a method for providing a web page according to an embodiment of the present application;
FIG. 2A is a schematic diagram of an interaction example of providing a web page according to an embodiment of the present application;
FIG. 2B is a schematic diagram of an architecture of an SSR provided in an embodiment of the present application;
FIG. 3 is a schematic structural diagram of an apparatus for providing web pages according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device suitable for implementing the solution in the embodiments of the present application.
The same or similar reference numbers in the drawings refer to the same or similar parts.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
In a typical configuration of the present application, the terminals, the devices of the services network each include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer-readable media include both permanent and non-permanent, removable and non-removable media, and information storage may be implemented by any method or technology. The information may be computer program instructions, data structures, modules of the program, or other data. Examples of storage media for a computer 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 disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape storage or other magnetic storage devices, or any other non-transmission medium which can be used to store information that can be accessed by a computing device.
As explained above, how to facilitate rendering and how to update web page content conveniently is of great concern and urgent need.
In some schemes, in order to improve the Rendering efficiency and quality of the web page, a Server-Side Rendering (SSR) technique may be used to render the web page. SSR is a technique that generates and transmits web page content to a browser at the server side. Under the SSR technology, after a server obtains a configuration file associated with a web page, after the server finishes rendering and obtains a viewable web page, the web page is directly provided to a browser, for example, a hypertext markup language (Hyper Text Markup Language, abbreviated as HTML) file (abbreviated as HTML or HTML for convenience of understanding) to present the web page by the browser. This approach also allows viewable web pages to be rendered and generated without the need for native rendering by the browser. Therefore, the webpage rendering can be completed by using the server with strong capability, the rendering quality and efficiency are improved, and the capability configuration requirement on the browser can be greatly reduced.
However, in the existing SSR framework, there is a lack of a splitting mechanism, for example, when updating the content in the existing web page, even if a configuration file for updating part of the content of the web page is received, the web page is reconfigured by, for example, a further process. In such a way, the dynamic update of the webpage is not facilitated, and the rendering and issuing efficiency is low. In addition, in some scenarios, such a manner may interrupt the original ongoing service instance, resulting in resource waste. For example, under the rendering framework of the next, vite-plug in-ssr two servers, when the html needed by the server is rendered and output, if there is a service iteration need, the servers execute their specific service start command to restart the process so as to meet the iteration need, but this can cause the original executing service instance to be unnecessarily closed.
Furthermore, SSR requires rendering on a server, but the framework of e.g. next. Js may be complex, both from learning routes and project structure, so that there can be high costs for project maintenance and deployment. In this case, if the service needs to be restarted at each release, short downtime and loss of some states may result, so that there is a long white screen time each time a page is updated, which affects the user experience.
In this regard, the embodiments of the present application provide a method for providing a web page, applied to a server, that reads a name and an identification of a configuration file in response to receiving the configuration file for at least a portion of a target web page from a service provider, where the service provider is configured to provide service support to the target web page based on the configuration file; responding to the existence of a history configuration file with the same history name and name, and detecting whether a history identification mark and an identification mark of the history configuration file are the same; responsive to the historical identification being different from the identification, executing the configuration file to update at least part of the profile; and in response to the target web page being updated upon receipt of a transmitted access request by the browser for the target web page, rendering the updated target web page locally to generate a viewable web page provided to the browser. Therefore, the server can accurately identify the condition that the configuration file is updated, and efficiency and quality in updating the content in the webpage are improved. Therefore, the server can accurately identify the condition that the configuration file is updated, and efficiency and quality in updating the content in the webpage are improved.
In an actual scenario, the execution subject of the method may be, for example, a server for providing a web page, which may receive a configuration file from a service provider side to configure as a web page, and render, generate a viewable web page when the user side requests the page using a web page acquisition application (e.g., browser) in the user device. Further, the server may serve the purpose of presenting the viewable web page to the user by providing the viewable web page to the browser. The server may be hardware, and when implemented as hardware, may be implemented as a distributed server cluster formed by a plurality of servers, or may be implemented as a single server; the server may also be software, and when implemented as software, may be implemented as a plurality of software or software modules, or may be implemented as a single software or software module, which is not specifically limited herein. In some embodiments, the server may also be implemented in a cloud-based manner. The Cloud is composed of a large number of hosts or web servers based on Cloud Computing (Cloud Computing), which is one type of distributed Computing, a virtual computer consisting of a group of loosely coupled computer sets.
Fig. 1 shows a process 100 of a method for providing a web page according to an embodiment of the present application, where the process 100 includes at least the following processing steps:
in step S101, in response to receiving a configuration file for at least part of the target web page from the service provider, the name and identification of the configuration file are read.
In embodiments of the present application, a service provider (e.g., provider of web page content, builder of the above description) may provide a profile to a server for part, all, of a web page. The configuration file may be used to generate a web page, such as an entry-server. Tsx file. The "entry-server. Tsx" file is typically the starting point for server-side rendering, and typically contains the following tasks: importing the necessary modules and dependencies, processing and routing the incoming request to the appropriate component or route, injecting the rendered HTML markup into a template or generating a complete HTML response. Further, the server may respond to this upon receiving a configuration file for at least a portion of the target web page from the service provider. For convenience of description, the web page to be configured, rendered may be referred to as a target web page. Thus, the obtained configuration file may be used to completely configure the target web page, or may be used to indicate that a portion of the target web page is configured (e.g., that a portion of the services in the target web page are updated). In general, a plurality of initial web pages may be built in advance in a server so that a server side can continuously provide contents to a user through updating part of contents of the initial web pages. Further, after the server obtains the configuration file, the server may read the name and the identification of the configuration file respectively. In some embodiments, the identification may be used for additional information added for the configuration file. For example, the identification may be a timestamp of the service provider's generation of the profile.
In some embodiments, the server may add an identification to the profile by controlling the service provider based on at least one of: the number of historical file generations of the service provider, and the unique hash value based on the timestamp determined by the configuration file generation time. In particular, the server may control the service provider to time stamp the profile based on the time of generation of the profile when the profile is generated. Alternatively, the server may control the service provider to use a unique hash value that is not repeated previously as an identification for the profile. In some embodiments, the server may determine the identification by controlling the service provider based on the number of historical file generations of the configuration files that have been generated in its own machine. Thus, the configuration files may be further marked with identification identifiers to facilitate the server in distinguishing between the configuration files (e.g., identifying whether the currently acquired configuration file is the same file as the previous configuration file). For example, in the process of performing CreateServer operation in a service provider, when an entry-server.js file (a file related to data prefetching and rendering) packaged by dist is introduced in a routing configuration, an identification identifier is added to the entry-server.js file based on a timestamp, so that each entry-server.js file is unique and reliable, and file identification errors caused by repeated name taking and other reasons are avoided.
To facilitate an understanding of the process of providing web pages, reference may also be made to FIG. 2A simultaneously. Fig. 2A shows a schematic diagram of an interaction example 200A for providing a web page according to an embodiment of the present application. In example 200A, a server 210, a service provider 220, and a browser 230 may be included.
In example 200A, service provider 220 may provide configuration files (e.g., configuration file 222) for a target web page to server 210 such that server 210, when requested by browser 230 to access the target web page, renders, generates, based on the configuration files, a viewable web page to visualize the "target web page".
For example, the service provider 220 may provide a profile 221 that adds "function A" in an area 241 in the web page 240. For example, the name of the configuration file 221 may be "File A", and the identification of the configuration file may be "XX: YY ", timestamp. In some embodiments, the names and identification tags may be distinguished by adding special symbols (e.g., ". For example, configuration file 221 may be represented as "file AXX: YY'
Step S102, detecting whether the local machine has a history configuration file with the same history name as the name. In embodiments of the present application, after acquiring a configuration file, the server may determine whether there is a duplicate name of the configuration file, or a history configuration file with the same name, based on a comparison of the name of the configuration file and the history names of the history configuration files (i.e., other configuration files whose acquisition time precedes the configuration file). For example, in some SSR frameworks, the dynamic modules of their native common js and ESM (ECMAScript Modules) can be utilized to determine if the names agree with the historical names. ESM is a standard that uses modular programming in JavaScript. Browser support ESM is implemented through a built-in modular system that implements JavaScript. In a browser supporting ESM, a < script type= "module" tag may be used to load a module. When the browser encounters the tag, the JavaScript code inside the browser is treated as a module and loaded. In the modules, other modules can be introduced through an 'import' statement, and the content in the modules can be exposed to other modules for use through the 'export' statement.
If there is a history profile of the rename, the server continues to step S103.
Step S103, detecting whether the history identification mark and the identification mark of the history configuration file are the same. In an embodiment of the present application, if a renamed history profile exists, the server may determine whether the history profile is identical to the profile, or whether the profile has been previously acquired, by comparing the history identification of the history profile with the identification of the profile.
If the historical identification is different from the identification, the server may determine that it did not receive the configuration file. Further, the server may continue to perform step S104.
With continued reference to fig. 2A. In example 200A, server 210 may determine another historical profile 222 based on profile 221, "file a" (e.g., the name of historical profile 222 is also "file a"). Further, the server 210 may be based on "XX" in the configuration file 221 received this time: YY "and" ZZ "in the history profile 222: the DD "comparison determines that the current received profile 221 is not identical to the history profile 222.
Therefore, the comparison efficiency can be improved in a two-stage comparison mode, and whether the configuration file is repeated with the historical configuration file or not can be determined more quickly and resource-saving. For example, after the scope of the history configuration files to be compared is narrowed by searching whether files with the same name exist, whether the configuration files are duplicated or not is determined based on comparison of the identification marks.
Step S104, executing the configuration file to update the at least part.
In the embodiment of the application, the server may execute the configuration file to load or load corresponding data and codes according to the instruction of the configuration file, so as to update the data and codes of the corresponding part in the target webpage, so as to complete at least partial update in the target webpage.
With continued reference to fig. 2A. In example 200A, server 210 determines that the currently received configuration file does not overlap with the historical configuration file, then "function a" may be added to region 241 in web page 240 by executing configuration file 221, resulting in web page 240' completing the update.
In addition, in some embodiments, after step S102, if it is determined that there is no history configuration file with a rename, the server may also directly update the data and code of the corresponding portion in the target web page in a manner similar to step S104, so as to update the target web page.
Step S105, when receiving the access request sent by the browser for the target web page, determining whether the target web page is updated.
In an embodiment of the present application, when receiving a request for access by a browser to send to a target web page, a subsequent server may determine whether the target web page is updated (i.e., whether at least part of the content in the target web page is modified by executing a configuration file). If the server determines that the target web page is updated, step S106 is performed to generate a viewable web page provided to the browser by rendering the updated target web page. Otherwise, step S107 is executed to generate a viewable web page provided to the browser by rendering the original target web page.
It should be understood that the order of execution illustrated in process 100 is merely exemplary and is not intended to limit the present application. The implementation provided in the process 100 of the present application is smooth and may be adapted to suit actual needs. For example, the server may continuously monitor whether the browser makes an access request for the target web page, and determine whether the target web page is updated in the current time (i.e., time state in which the access request was received) state based on the time at which the request was received. This current time may be before the profile is acquired based on step S101 described above. Accordingly, the server may select a target webpage updated with the unused configuration file to implement subsequent rendering, generating a viewable webpage, based on the determination. Similarly, the current time may also be some time after the target web page is updated with the configuration file as illustrated by process 100. Thus, the server may complete rendering based on a determination of whether the target web page is updated.
For example in example 200A shown in fig. 2A. The service provider 220 may provide configuration files for the target web page to the server 210 such that when requested by the browser 230 to access the target web page, the server 210 renders, generates viewable web pages based on the configuration files to visualize the "target web page".
In step S106, the updated target web page is rendered locally to generate a viewable web page provided to the browser.
In step S107, the target web page is rendered locally to generate a viewable web page provided to the browser.
Reference may be continued to fig. 2A. For example, in example 200A, after server 210 determines that web page 240 is updated based on configuration file 221 (e.g., adding "function a" to region 241 in web page 240), based on rendering web page 240', a viewable web page is obtained that can be directly rendered by browser 230 (for ease of understanding, the style shown in example 200A for web pages 240, 240' may also be understood as the style implemented by the viewable web page). Further, through the provided viewable web page, the browser 230 can directly present the viewable web page without executing rendering and generating the web page locally.
Because there may be content in the web page that needs to be supported by the browser's native components, the server may pre-configure these components by controlling the browser. In some embodiments, the server may also issue to the browser a configuration indication indicating that the browser is locally configured to render a set of components of the viewable web page. Further, the server may control the browser to configure a set of components locally at the browser based on the configuration indication. For example, when the browser loads an access code Server (Node Server) service, the Server can return the required component character strings to the browser according to the resources and template matching values of the routes matched to the corresponding pages so as to control the browser to correspondingly execute configuration.
For ease of understanding the processes associated with the server, browser, reference may also be made to FIG. 2B. FIG. 2B shows a schematic diagram of an architecture 200B of an SSR provided by embodiments of the present application. In the example architecture 200B, a server 210 and a browser 230 may be included.
In architecture 200B, browser 230 may communicate with server 210 using a pre-configured communication protocol 250. For example, the communication protocol 250 may be a hypertext transfer protocol (Hypertext Transfer Protocol, HTTP for short) or a hypertext transfer security protocol (Hypertext Transfer Protocol Secure, HTTPs for short). For example, browser 230 may communicate with server 210 using communication protocol 250 to request code server 211 to provide services. Accordingly, server 211 may package client html, entry-server. For example, server 211 may obtain dist/client html 212 and dist/entry-server.js 213 by dist packing.
Further, the server 210 may return the required component string to the browser 210 via the resource and template matching value that is matched to the corresponding page by the route 214. For example, server 210 may perform block 217 after writing SSR data based on the change in page. At block 217, the server 210 may process the transformation of the template html to obtain the desired page content. As explained above, in some embodiments, it may also be ensured that it is unique and trusted by importing a unique code 215 (e.g., a timestamp, etc.) into the dist/entry-server. Js 213 to identify it.
Similarly, in some embodiments, if additional services 216 are present, code server 211 in server 210 may perform block 218. At block 218, a node associated with the additional service 216 may be selected by way of a round robin request node to provide the additional service 216 or to respond to the additional service 216.
In some embodiments, the server may also enrich the content of the viewable web page by way of joint rendering with the browser. In some scenarios, the process of joint rendering may also be referred to as "hydration". For example, for some resources stored locally to the browser (e.g., data, services related to use of information security, etc.), it may be added, rendered into a viewable web page by the browser's native rendering. In this case, the server-provided viewable web page may be only a portion of the viewable web page that is ultimately presented to the user.
In this regard, the server may also issue to the browser a first set of configuration files used when the viewable web page is generated, and then determine whether the viewable web page issued to the browser by the server meets the requirements by controlling the browser to compare the first set of configuration files with reservation information stored locally by the browser for indicating a second set of configuration files required when the browser uploads the access request. For example, by comparing whether the first set of configuration files matches the second set of configuration files, it is determined whether the viewable web pages delivered to the browser by the server meet the requirements.
In some embodiments, the configuration files of the web page may be determined according to the usage needs of the browser, e.g., the browser may select a set of configuration files (i.e., a second set of configuration files) according to its web page needs. Accordingly, the browser may "customize" the page by uploading the second set of configuration files to the server. Accordingly, the browser may then quickly provide whether the viewable web page matches the expectations by way of whether the actual configuration file used (e.g., the first set of configuration files) matches the expected configuration file (e.g., the second set of configuration files).
For example, in the case where the server required by the browser issues a viewable web page in the area a and the area B in a blank state, so that it can add a service native to the browser in the area a and the area B, the browser can request to provide the viewable web page for which the area a and the area B are unoccupied when requesting the page. It should be appreciated that when or after rendering the viewable web page, the browser may implement the joint rendering by filling the viewable web page with web page content rendered from a local-based resource.
In some embodiments, the efficiency of determining the configuration file may be further improved by presetting a configuration file combination. In this case, it is also possible to mark by adding character variables for the matching file combinations so that the browser can determine whether the first set of configuration files used by the web page matches what it requested, intended by means of matching the character variables. For example, the server can determine which page to render by executing a javascript to match the requirements of the browser route, and after the rendering is completed, the server matches the processed data with the character variables reserved in the browser to determine whether the configuration file used when rendering the web page matches the requirements thereof.
In some embodiments, the server may also control the browser to determine whether the viewable web page meets the requirements based on the first set of configuration files. For example, the control browser determines, based on the first set of configuration files, whether there is a conflict between the currently viewable web page and the content that the browser natively expects to add. The browser may determine whether a conflict exists based on a comparison of the first set of configuration files and the third set of configuration files (configuration files corresponding to what is desired to be added). For example, for an example where it is desired to add content in region a and region B, the browser may determine that region a and region B are unoccupied in the first set of profiles, and select to add content in region a and region B based on the third set of profiles. For example, the browser may determine that there is a conflict between the third set of profiles by determining that the area required for use by the third set of profiles is already occupied by the first set of profiles, if occupied. Alternatively, if the environment files required by the third set of configuration files are provided by the first set of configuration files, if not, then a conflict is determined between the two.
In some embodiments, the server may control the browser to respond when the first set of profiles does not match the second set of profiles to adjust the requirements by updating the second set of profiles. Accordingly, the browser may reissue an access request based on the updated second set of configuration files to re-request the viewable web page after re-determining the need to update the second set of configuration files. Therefore, the configuration files with conflicts are prevented from being used in combination by mistake, and the quality of the viewable web pages is guaranteed.
In some embodiments, in controlling and communicating with the browser by the server, the communication may be based on parent-child value (tips) means. Tips is an attribute on the Vue instance that is used to pass values for the component. Vue is the framework for data driven view updates. Props is in effect, and can be a level of configuration with data, methods, etc. in order to receive externally transmitted data. Tips forms a unidirectional downward binding (unidirectional data flow) between child properties and parent properties. When a parent property updates, it flows down to the child property, but not vice versa. This may prevent a child component from accidentally changing the state of a parent component. Therefore, the server controls the browser in a single-stream manner, data security in the server is guaranteed, and rendering consistency of both ends of the server and the browser can be guaranteed through tips transmission.
In some embodiments, the server may also issue to the browser an indicating variable associated with the custom service of the viewable web page. In some embodiments, the indication variable indicates an area that is allowed to be added to the custom service. For example, the area may be a display area reserved for native add-on functionality in a browser in a rendered viewable web page. Further, the server may control the browser to add custom services to the region locally at the browser based on the indicated variable. Therefore, the browser can be required to expand the content in the viewable webpage in a joint rendering mode. For example, the browser may append custom services in the native to html rendered by the server based on the entry-client. For example, when a reacti component is rendered at a server using a reactidomerver to obtain html, the obtained html may be sent to a browser. Further, the browser may be hydrated by its native act component. During hydration, the browser's native act will compare server-rendered html to browser-rendered components. It marks the event listener and other necessary attributes, allowing the browser rendering component to seamlessly take over the server rendering component, helping to preserve the interactivity and state of the component.
Reference may illustratively be continued to FIG. 2B. In browser 230, entry-client. Tsx 231 may indicate that, for example, event handlers and other necessary functions are attached to server rendered HTML. When the reactivaver is used to render the reacti components at server 210, the generated HTML may be sent to browser 230 (or, alternatively, the client at which browser 230 is located) and hydrated by the reactivator associated with browser 230. During the hydrogenation, the act compares the HTML rendered by the server 210 with the components rendered by the browser 230. It marks the event listener and other necessary attributes, allowing the browser 230 rendering component to seamlessly take over the server 210 rendering component. Helping to maintain the interactivity and state of the components. Typically, entry-server. Tsx refers to the fact that in SSR server 210 is responsible for rendering the initial HTML markup that will be sent to browser 230. In addition, the entry-server. Tsx 232 file is typically the starting point for rendering at the server 210 side, and typically includes the following tasks: importing the necessary modules and dependencies, processing and routing the incoming request to the appropriate component or route, injecting the rendered HTML markup into a template or generating a complete HTML response.
In some embodiments, a cache pool may also be provided in the server, and after the configuration file is executed, the cache pool may be used to store the results after the configuration file is executed. Therefore, when the configuration file which is executed before needs to be used and called later, the execution result of the configuration file can be directly called from the cache pool to replace the execution of the configuration file, so that the configuration file is prevented from being repeatedly and repeatedly executed, and the efficiency is improved.
In this case, in some embodiments, if the currently received profile is the same as the historical profile. That is, for example, in step S103, if the history identification is identical to the identification, the server may determine that the profile has been received. In this case, the server may perform S110 instead of performing step S104.
Step S111, determining whether a history execution result of the history configuration file exists in the local cache pool.
In particular, the server may identify whether the historical results of the historical profile exist for the query in a local cache pool using, for example, the historical name, the historical identification. If so, step S112 is performed.
Step S112, calling the historical execution result from the cache pool to replace the execution of the configuration file, and refusing to update at least part of the configuration file.
Specifically, if there is a history execution result, the server may determine that the configuration file acquired at this time has been executed, and no additional configuration file acquired at this time is executed. In addition, for other configuration files that need to be obtained at this time, the server may directly use the history execution result as the execution result of the configuration file obtained at this time, for example, the history execution result may be provided to the other configuration files for use. Thereby, the efficiency is improved.
For example, in the CommonJS SSR framework, a cache pool may be provided with a required. For example, in the Node mechanism, when importing a configuration file using the import syntax, node. Js will first check if the file has been cached. If the file has been cached and the timestamp of the file is the same as the timestamp of the cache, node. Js will use the module in the cache directly to export the result without reloading and executing the file.
Accordingly, if the identification (e.g., timestamp) of the configuration file is different from the timestamp of the cache, node. Js will understand that the configuration file has changed, reload and execute the configuration file, and update the module export in the cache. For example, in Vite, execution logic of the CommonJS may be parallel with that of the ESM to introduce ESM dynamic import in combination with a timestamp to reflect whether an update exists for the same named profile. Thus, the execution logic of CommonJS may be parallel, destroying the cache, causing the file to be parsed and executed again. Therefore, the server can continuously execute the configuration file to update the webpage while realizing the function of automatically identifying the file update, and the new process is not required to be restarted to realize the webpage update, so that the first screen experience of the SSR is improved.
Then, in response to receiving a configuration file for at least part of the target webpage from a service provider, the method for providing the webpage reads the name and the identification of the configuration file, wherein the service provider is used for providing service support for the target webpage based on the configuration file; responding to the existence of a history configuration file with the same history name and name, and detecting whether a history identification mark and an identification mark of the history configuration file are the same; responsive to the historical identification being different from the identification, executing the configuration file to update at least part of the profile; and in response to the target web page being updated upon receipt of a transmitted access request by the browser for the target web page, rendering the updated target web page locally to generate a viewable web page provided to the browser. Therefore, the server can accurately identify the condition that the configuration file is updated, and efficiency and quality in updating the content in the webpage are improved. Therefore, the server can accurately identify the condition that the configuration file is updated, and efficiency and quality in updating the content in the webpage are improved.
The embodiment of the application also provides a device for providing the webpage, which is applied to a server, and the structure of the device is shown as a device 300 in fig. 3. The apparatus 300 includes: a reading module 310 configured to read a name and an identification of a configuration file in response to receiving the configuration file for at least a portion of the target web page from a service provider, wherein the service provider is configured to provide service support to the target web page based on the configuration file; a detection module 320 configured to detect whether a history identification identifier and an identification identifier of the history configuration file are the same in response to the existence of the history configuration file having the same history name and name; an execution module 330 configured to execute the configuration file to update at least part of the profile in response to the historical identification identifier being different from the identification identifier; and a rendering module 340 configured to render the updated target web page locally to generate a viewable web page provided to the browser in response to the target web page being updated upon receipt of a transmitted access request by the browser for the target web page.
In some embodiments, the apparatus 300 further comprises: the system comprises a first issuing module, a second issuing module and a display module, wherein the first issuing module is configured to issue a configuration instruction to a browser, and the configuration instruction is used for instructing the browser to configure a group of components for presenting a viewable webpage locally; the browser is controlled to configure a set of components locally at the browser based on the configuration indication.
In some embodiments, the apparatus 300 further comprises: the second issuing module is configured to issue a first group of configuration files used when generating the viewable webpage to the browser; controlling the browser to compare the first set of configuration files with reservation information stored locally by the browser, wherein the reservation information indicates a second set of configuration files required by the browser when uploading an access request; the control browser renders the viewable web page in response to the first set of configuration files matching the second set of configuration files.
In some embodiments, the apparatus 300 further comprises: and the first control module is used for controlling the browser to update the second set of configuration files in response to the fact that the first set of configuration files are not matched with the second set of configuration files, so as to resend the access request based on the updated second set of configuration files.
In some embodiments, the server communicates with the browser based on parent-child value means.
In some embodiments, the apparatus 300 further comprises: a third issuing module that issues, to the browser, an indication variable associated with the custom service of the viewable web page, wherein the indication variable indicates an area to which the custom service is allowed to be added; controlling the browser to add the custom service to the region locally at the browser based on the indicated variable.
In some embodiments, the apparatus 300 further comprises: the result calling module is configured to respond to the fact that the history identification mark is the same as the identification mark, and determine whether a history execution result of the history configuration file exists in a cache pool of the local machine; and in response to the existence of the historical execution result, calling the historical execution result from the cache pool to replace the execution of the configuration file, and refusing to update at least part of the configuration file.
In some embodiments, rendering module 340 is further configured to render the target web page locally to generate a viewable web page provided to the browser in response to the target web page not being updated upon receipt of the transmitted access request by the browser for the target web page.
In some embodiments, the apparatus 300 further comprises: a second control module that controls the service provider to add an identification to the profile based on at least one of: the number of historical file generations of the service provider, and the unique hash value based on the timestamp determined by the configuration file generation time.
Based on the same inventive concept, an electronic device is also provided in the embodiments of the present application, and the method corresponding to the electronic device may be the method for providing a web page in the foregoing embodiments, and the principle of solving the problem is similar to that of the method. The electronic device provided by the embodiment of the application comprises: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods and/or techniques of the various embodiments of the present application described above.
The electronic device may be a user device, or a device formed by integrating the user device and a network device through a network, or may also be an application running on the device, where the user device includes, but is not limited to, various terminal devices such as a computer, a mobile phone, a tablet computer, a smart watch, a bracelet, and the network device includes, but is not limited to, a network host, a single network server, a plurality of network server sets, or a computer set based on cloud computing, and the network device may be implemented, for example, to implement a part of processing functions when setting an alarm clock. Here, the Cloud is composed of a large number of hosts or web servers based on Cloud Computing (Cloud Computing), which is a kind of distributed Computing, one virtual computer composed of a group of loosely coupled computer sets.
Fig. 4 shows a structure of an electronic device suitable for implementing the method and/or technical solution in the embodiments of the present application, the electronic device 400 includes a central processing unit (CPU, central Processing Unit) 401, which may perform various suitable actions and processes according to a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage section 408 into a random access Memory (RAM, random Access Memory) 403. In the RAM 403, various programs and data required for the system operation are also stored. The CPU 401, ROM 402, and RAM 403 are connected to each other by a bus 404. An Input/Output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input section 406 including a keyboard, a mouse, a touch panel, a microphone, an infrared sensor, and the like; an output portion 407 including a display such as a Cathode Ray Tube (CRT), a liquid crystal display (LCD, liquid Crystal Display), an LED display, an OLED display, and a speaker; a storage portion 408 comprising one or more computer-readable media of hard disk, optical disk, magnetic disk, semiconductor memory, etc.; and a communication section 409 including a network interface card such as a LAN (local area network ) card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet.
In particular, the methods and/or embodiments of the present application may be implemented as a computer software program. For example, embodiments disclosed herein 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. The above-described functions defined in the method of the present application are performed when the computer program is executed by a Central Processing Unit (CPU) 401.
Another embodiment of the present application also provides a computer readable storage medium having stored thereon computer program instructions executable by a processor to implement the method and/or the technical solution of any one or more of the embodiments of the present application described above.
In particular, the present embodiments may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. 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 (a non-exhaustive list) of the computer-readable storage medium would include the following: 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 this document, 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.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. 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 wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present application 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 (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowchart or block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of devices, methods and computer program products according to various embodiments of the present application. 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.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the partitioning of elements is merely a logical functional partitioning, and there may be additional partitioning in actual implementation, e.g., multiple elements or page components may be combined or integrated into another system, or some features may be omitted, or not implemented. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the apparatus claims can also be implemented by means of one unit or means in software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.

Claims (12)

1. A method for providing web pages, applied to a server, comprising:
in response to receiving a configuration file for at least a portion of a target web page from a service provider, reading a name and an identification of the configuration file, wherein the service provider is configured to provide service support to the target web page based on the configuration file;
responding to a history configuration file with the same history name as the name, and detecting whether a history identification mark of the history configuration file is the same as the identification mark;
responsive to the historical identification identifying being different from the identification identifying, executing the configuration file to update the at least part; and
in response to receiving a transmitted access request by a browser for the target web page, the target web page is updated, the updated target web page is rendered locally to generate a viewable web page provided to the browser.
2. The method as claimed in claim 1, further comprising:
issuing a configuration instruction to the browser, wherein the configuration instruction is used for instructing the browser to configure a group of components for presenting the viewable webpage locally;
controlling the browser to configure the set of components locally at the browser based on the configuration indication.
3. The method of claim 1, further comprising:
issuing a first set of configuration files to the browser for use in generating the viewable web page;
controlling the browser to compare the first set of configuration files with reservation information stored locally by the browser, wherein the reservation information indicates a second set of configuration files required by the browser when uploading the access request;
controlling the browser to present the viewable web page in response to the first set of configuration files matching the second set of configuration files.
4. A method according to claim 3, further comprising:
and controlling the browser to update the second set of configuration files in response to the first set of configuration files not matching the second set of configuration files so as to reissue the access request based on the updated second set of configuration files.
5. A method according to claim 2 or 3, wherein the server communicates with the browser based on parent-child value means.
6. The method as claimed in claim 1, further comprising:
issuing an indication variable associated with a custom service of the viewable web page to the browser, wherein the indication variable indicates an area allowed to be added with the custom service;
and controlling the browser to add the custom service to the area locally in the browser based on the indication variable.
7. The method of claim 1, further comprising:
responding to the fact that the history identification mark is the same as the identification mark, and determining whether a history execution result of the history configuration file exists in a local cache pool;
and in response to the existence of the historical execution result, invoking the historical execution result from the cache pool to replace the execution of the configuration file, and refusing to update the at least part.
8. The method of claim 1, further comprising:
in response to receiving a transmitted access request by a browser for the target web page, the target web page is not updated, rendering the target web page locally to generate a viewable web page provided to the browser.
9. The method of claim 1, further comprising:
controlling the service provider to add the identification to the profile based on at least one of: and generating a number of historical files of the service provider based on the time stamp, the unique hash value and the historical files determined by the configuration file generation time.
10. An apparatus for providing web pages, applied to a server, comprising:
a reading module configured to read a name and an identification of a configuration file for at least a portion of a target web page in response to receiving the configuration file from a service provider, wherein the service provider is configured to provide service support to the target web page based on the configuration file;
a detection module configured to detect whether a history identification identifier of a history configuration file is identical to the identification identifier in response to the existence of the history configuration file with the same history name as the name;
an execution module configured to execute the configuration file to update the at least part in response to the historical identification being different from the identification; and
and a rendering module configured to render the updated target webpage locally to generate a viewable webpage provided to the browser in response to the target webpage being updated upon receipt of a transmitted access request by the browser for the target webpage.
11. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 9.
12. A computer readable medium having stored thereon computer program instructions executable by a processor to implement the method of any of claims 1 to 9.
CN202311256691.7A 2023-09-26 2023-09-26 Method, device, electronic equipment and computer readable medium for providing web page Pending CN117473192A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311256691.7A CN117473192A (en) 2023-09-26 2023-09-26 Method, device, electronic equipment and computer readable medium for providing web page

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311256691.7A CN117473192A (en) 2023-09-26 2023-09-26 Method, device, electronic equipment and computer readable medium for providing web page

Publications (1)

Publication Number Publication Date
CN117473192A true CN117473192A (en) 2024-01-30

Family

ID=89632124

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311256691.7A Pending CN117473192A (en) 2023-09-26 2023-09-26 Method, device, electronic equipment and computer readable medium for providing web page

Country Status (1)

Country Link
CN (1) CN117473192A (en)

Similar Documents

Publication Publication Date Title
US10565293B2 (en) Synchronizing DOM element references
US10257110B2 (en) Using a template to update a stack of resources
US10346501B2 (en) Mobile enablement of existing web sites
US20150378714A1 (en) Providing Context-Specific Software Updates to Client Applications
US11797273B2 (en) System and method for enhancing component based development models with auto-wiring
US10574724B2 (en) Automatic discovery of management nodes and generation of CLI using HA module
US10013497B1 (en) Background reloading of currently displayed content
US9229693B1 (en) Build service for software development projects
CN111414350B (en) Service generation method and device
US9648078B2 (en) Identifying a browser for rendering an electronic document
US11930096B2 (en) Systems and methods for rendering interactive web pages
CN110941779A (en) Page loading method and device, storage medium and electronic equipment
CN111079048A (en) Page loading method and device
US9350738B2 (en) Template representation of security resources
Rattanapoka et al. An MQTT-based IoT cloud platform with flow design by Node-RED
CN115309470A (en) Method, device and equipment for loading widgets and storage medium
AU2016101498B4 (en) Data Interchange System
US11604662B2 (en) System and method for accelerating modernization of user interfaces in a computing environment
CN110807162A (en) Method and device for loading occupation bitmap
CN116521317A (en) Mirror image management method and device, electronic equipment and computer readable storage medium
CN110674435A (en) Page access method, server, terminal, electronic equipment and readable storage medium
US8402367B1 (en) Smart reload pages
CN117473192A (en) Method, device, electronic equipment and computer readable medium for providing web page
CN111125565A (en) Method and equipment for inputting information in application
CN106991167B (en) Web application migration method and 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