Page calling method, device and server
By setting up a multi-level cache in the first server and sending a data call request to the second server, the problem of poor page call stability between business systems is solved, and page rendering and improvement can be completed even when the called server cannot provide data. Customer experience.
Patent Information
- Application Number
- CN202011290719.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-17
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-11-17
AI Technical Summary
In the existing technology, the stability of the page calling process between business systems is poor. Especially when the called business system is down or crashes, relevant data cannot be provided, causing the calling system to be unable to complete page rendering, affecting customer experience.
Set up a multi-level cache in the first server to cache the page file and page data, and when the temporary page file or data is not stored, send a data call request to the second server to obtain the target page data, thereby calling the target of the request based on the page Page templates and data are rendered and served to the page file.
Improved the stability of the page calling process, ensuring that even when relevant data is not stored in the multi-level cache, the page rendering can be completed and the page file can be fed back to the client normally, significantly improving the customer experience.
Smart Images

Figure CN112379950B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a page calling method, device and server. Background Art
[0002] At present, in order to perform corresponding business processing, each business system needs to call each other, such as the calling business system obtains relevant data from the called business system by sending an HTTP (HyperText Transfer Protocol) request, and the calling business system renders the page based on the obtained relevant data. There is a problem of poor stability in the above process. If the called business system is down or crashes, the relevant data required by the calling business system cannot be fed back to the calling business system, which will directly cause the calling business system to be unable to complete page rendering, and thus unable to provide page files to customers, thereby affecting customer experience. Summary of the invention
[0003] In view of this, an object of the present invention is to provide a page calling method, device and server, which can effectively improve the stability of the page calling process, thereby improving the customer experience.
[0004] In a first aspect, an embodiment of the present invention provides a page calling method, which is applied to a first server, wherein the first server is provided with a multi-level cache, and the first server stores a page template required for a page file, and the page file is obtained by rendering page data according to the page template. The method comprises: receiving a page calling request sent by a client, and determining whether a temporary page file and / or temporary page data corresponding to the page calling request is stored in the multi-level cache; when the temporary page file and the temporary page data are not stored in the multi-level cache, sending a data calling request to the second server, so that the second server feeds back target page data based on the data calling request; and providing the target page file to the client based on the target page template and the target page data corresponding to the page calling request.
[0005] In one embodiment, the multi-level cache includes a first-level cache; the step of determining whether a temporary page file corresponding to the page call request is stored in the multi-level cache includes: determining whether a temporary page file corresponding to the page call request is stored in the first-level cache; the method also includes: if the temporary page file is stored in the first-level cache, determining whether the temporary page file exceeds a first call deadline; if not, providing the temporary page file to the client.
[0006] In one embodiment, the multi-level cache includes a second-level cache; the step of determining whether temporary page data corresponding to the page call request is stored in the multi-level cache includes: if the temporary page file is not stored in the first-level cache, determining whether the temporary page data corresponding to the page call request is stored in the second-level cache; the method also includes: if the temporary page data is stored in the second-level cache, determining whether the temporary page data exceeds a second call deadline; if not, providing the target page file to the client based on the target page template corresponding to the page call request and the temporary page data.
[0007] In one embodiment, the multi-level cache includes a third-level cache, and the third-level cache is used to store page data required by the page file in text form; the method also includes: if the target page data fed back by the second server is not received, searching the third-level cache for target page data corresponding to the data call request.
[0008] In one embodiment, the method also includes: if the target page data fed back by the second server is received, providing a target page file to the client based on the target page data fed back by the second server and a target page template corresponding to the page call request, and updating the page data stored in the third-level cache based on the target page data fed back by the second server.
[0009] In one embodiment, the method further includes: determining a first call deadline corresponding to the target page file, and associating the target page file and the first call deadline corresponding to the target page file and storing them in the first level cache.
[0010] In one embodiment, the step of providing a target page file to the client based on the target page template and the target page data corresponding to the page call request includes: obtaining the target page template corresponding to the page call request; rendering the target page template and the target page data to obtain the target page file; and sending the target page file to the client.
[0011] In the second aspect, an embodiment of the present invention further provides a page calling device, which is applied to a first server, the first server is provided with a multi-level cache, the first server stores a page template required for a page file, and the page file is obtained by rendering the page data according to the page template. The device includes: a judgment module, which is used to receive a page calling request sent by a client, and judge whether a temporary page file and / or temporary page data corresponding to the page calling request is stored in the multi-level cache; a request sending module, which is used to send a data calling request to the second server when the temporary page data is not stored in the multi-level cache and the temporary page data is not stored, so that the second server feeds back the target page data based on the data calling request; a page providing module, which is used to provide the target page file to the client based on the target page template and the target page data corresponding to the page calling request.
[0012] In a third aspect, an embodiment of the present invention further provides a server, comprising: a processor and a storage device; a computer program is stored on the storage device, and when the computer program is executed by the processor, it executes any one of the methods provided in the first aspect.
[0013] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the methods provided in the first aspect are executed.
[0014] A page calling method, device and server provided in an embodiment of the present invention are applied to a first server. The first server is provided with a multi-level cache. The first server stores page templates required for page files. The page files are obtained by rendering page data according to the page templates. Upon receiving a page calling request sent by a client, it is determined whether a temporary page file and / or temporary page data corresponding to the page calling request are stored in the multi-level cache. When no temporary page file and no temporary page data are stored in the multi-level cache, a data calling request is sent to a second server so that the second server feeds back target page data based on the data calling request, thereby providing the target page file to the client based on the target page template and target page data corresponding to the page calling request. The above method sets up a multi-level cache in the first server to cache temporary page files, page data and non-temporary page data respectively through the multi-level cache. Even if the temporary page file or temporary page data corresponding to the page call request is not stored in the multi-level cache, the page rendering can be completed to obtain the target page file. Compared with the situation in the prior art where the page rendering cannot be completed when the called server cannot provide relevant data, the embodiment of the present invention can still complete the page rendering and normally feed back the target page file to the client, effectively improving the stability of the page call, thereby significantly improving the customer's page browsing experience.
[0015] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0016] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 A schematic diagram of a flow chart of a page calling method provided by an embodiment of the present invention;
[0019] Figure 2 A schematic diagram of a server architecture provided by an embodiment of the present invention;
[0020] Figure 3A schematic diagram of interaction between a client, a rendering server and a data storage server provided in an embodiment of the present invention;
[0021] Figure 4 A schematic diagram of the structure of a page calling device provided by an embodiment of the present invention;
[0022] Figure 5 A schematic diagram of the structure of a server provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described in combination with the embodiments below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] At present, the way of implementing business processing through mutual calls between various servers has the problem of weak stability. When the called server cannot provide relevant data to the calling server, it will directly lead to the inability of the calling server to complete page rendering. In addition, even if the relevant data can be obtained from the called server, there will still be problems of large server overhead, network overhead and time overhead. Specifically, in the process of data transmission between the calling server and the called server, more network resources need to be consumed, resulting in large network overhead; each time the calling server obtains relevant data, it needs to consume server resources to render the relevant data, which will result in large server overhead; and both data transmission and page rendering require a certain amount of time, resulting in large time overhead. In order to improve the above problems, the present invention implements a page calling method, device and server, which can effectively improve the stability of the page calling process, thereby improving customer experience.
[0025] To facilitate understanding of this embodiment, a page calling method disclosed in an embodiment of the present invention is first described in detail. The method is applied to a first server, wherein the first server can be understood as the caller of the upstream service (i.e., the downstream service). The first server is provided with a multi-level cache. In one embodiment, multiple storage areas can be selected in the memory of the first server as a multi-level cache. The multi-level cache can store temporary page files, temporary page data or non-temporary page data, etc. In addition, the first server also stores page templates required for page files. The page files can be HTML (HyperText Markup Language) files. The page templates are stored in storage areas other than the storage areas corresponding to the above-mentioned multi-level cache. The page files are obtained by rendering the page data according to the page templates.
[0026] Based on this, see Figure 1 The flowchart of a page calling method shown in FIG. 1 mainly includes the following steps S102 to S108:
[0027] Step S102: receiving a page call request sent by the client, and determining whether a temporary page file and / or temporary page data corresponding to the page call request is stored in the multi-level cache.
[0028] Wherein, the page call request may be an HTTP request, the HTTP request may carry the URL (Uniform Resource Locator) of the target page file, the temporary page file may be understood as a page file with a call deadline, and the temporary page data may be understood as page data with a call deadline. In one embodiment, the temporary page file corresponding to the URL carried by the page call request may be searched in the multi-level cache. If the temporary page file corresponding to the URL is not found, or the temporary page file corresponding to the URL found exceeds the call deadline, it is determined that the temporary page file corresponding to the page call request is not stored in the multi-level cache; in another embodiment, the temporary page data corresponding to the URL carried by the page call request may be searched in the multi-level cache. If the temporary page data corresponding to the URL is not found, or the temporary page data corresponding to the URL found exceeds the call deadline, it is determined that the temporary page data corresponding to the page call request is stored in the multi-level cache.
[0029] Step S104: When no temporary page file and no temporary page data are stored in the multi-level cache, a data call request is sent to the second server, so that the second server feeds back the target page data based on the data call request.
[0030] The second server stores the page data required by the page file, and the second service can be understood as an upstream service that provides data or services to the first server. For example, the M server provides underlying data storage, the N server provides upper-level business logic, and the N server calls the data in the M server. In this case, the M server can be called an upstream service, and the N server can be called a downstream service. In the case where neither the temporary page file corresponding to the page call request nor the temporary page data corresponding to the page call request is stored in the multi-level cache, a data call request can be generated based on the page call request, wherein the data call request can carry a specified field in the URL of the target page file, so that the second server can search and feedback the required target page data based on the specified field.
[0031] Step S106, based on the target page template and target page data corresponding to the page call request, provide the target page file to the client. Optionally, different page files can be divided into multiple types, each type of page file corresponds to a page template. In one embodiment, the type of the target page file can be determined based on the URL carried by the page call request, so that the page template corresponding to the type is determined as the target page template. By rendering the target page data according to the target page template, the required target page file can be obtained.
[0032] The above-mentioned page calling method provided by the embodiment of the present invention sets a multi-level cache in the first server to cache temporary page files, page data and non-temporary page data respectively through the multi-level cache. Even if the temporary page file or temporary page data corresponding to the page calling request is not stored in the multi-level cache, the page rendering can be completed to obtain the target page file. Compared with the situation in the prior art where the page rendering cannot be completed when the called server cannot provide relevant data, the embodiment of the present invention can still complete the page rendering and normally feed back the target page file to the client, effectively improving the stability of the page call, thereby significantly improving the customer's page browsing experience.
[0033] To facilitate understanding of the page calling method provided in the above embodiment, the embodiment of the present invention provides the following Figure 2 A schematic diagram of a server architecture is shown in FIG. Figure 2It is shown that the first server is respectively connected to the client and the second server in communication, wherein the first server may be a rendering server, which serves as a downstream service, and the second server may be a data storage server, which serves as an upstream service. The rendering server is provided with a multi-level cache, which includes a first-level cache, a second-level cache, and a third-level cache. The first-level cache stores temporary page files (such as temporarily storing the page files obtained by rendering previously in the first-level cache, and the temporarily stored page files are temporary page files), the second-level cache stores temporary page data (such as temporarily storing the page data obtained from the second server previously in the second-level cache, and the temporarily stored page data are temporary page data), and the third-level cache stores page data in the form of files. In a specific implementation, the page files temporarily stored in the first-level cache and the page data temporarily stored in the second-level cache can be cleared regularly, while the page data stored in the third-level cache will not be cleared.
[0034] Considering the method of calling a page in the prior art, there is a problem of high server overhead due to the need to perform page rendering each time a page is called. Based on this, the multi-level cache provided in the embodiment of the present invention includes a first-level cache, so as to reduce the server overhead required for calling a page through the first-level cache. Specifically, a temporary page file is temporarily stored in the first-level cache, so when the first-level server performs the step of determining whether a temporary page file corresponding to a page call request is stored in the multi-level cache, it should determine whether a temporary page file corresponding to the page call request is stored in the first-level cache. Specifically, it can be found in the first-level cache whether there is a temporary page file corresponding to the URL carried by the page call request. If a temporary page file corresponding to the URL carried in the page call request is found in the first-level cache, the following operations will be performed: if a temporary page file is stored in the first-level cache, determine whether the temporary page file exceeds the first call period; if not, provide the temporary page file to the client. In order to reduce the consumption of memory resources of the first server, the embodiment of the present invention sets a first call period for each temporary page file. The temporary page file can be obtained within the first call period, and when the first call period is exceeded, the temporary page file will not be obtained or may even be cleared, thereby avoiding an increase in the memory burden of the server due to too many stored temporary page files. Moreover, the embodiment of the present invention can directly obtain the rendered temporary page file from the first-level cache, so there is no need to re-execute the page rendering operation, thereby greatly saving server overhead.
[0035] If the temporary page file corresponding to the URL carried by the page call request is not found in the first-level cache, the second-level cache will be searched for whether there is a temporary data file corresponding to the URL carried by the page call request, wherein the multi-level cache includes a second-level cache, and the second-level cache temporarily stores temporary page data. Based on this, the embodiment of the present invention provides an implementation method for determining whether temporary page data corresponding to the page call request is stored in the multi-level cache. Optionally, if the temporary page file is not stored in the first-level cache, it is determined whether the temporary page data corresponding to the page call request is stored in the second-level cache. In a specific implementation method, it is possible to search in the second-level cache for whether there is temporary page data corresponding to the URL carried by the page call request. If the temporary page data corresponding to the URL carried by the page call request is found in the second-level cache, the following operations will be performed: if the temporary page data is stored in the second-level cache, it is determined whether the temporary page data exceeds the second call period; if not, the target page file is provided to the client based on the target page template and temporary page data corresponding to the page call request. The embodiment of the present invention can avoid, to a certain extent, the increase in the memory burden of the server caused by too much stored temporary page data by setting the second call period for each temporary page data temporarily stored in the second-level cache. Moreover, when the temporary page file is not obtained from the first-level cache, the temporary page data within the second call period can also be obtained from the second-level cache. In this case, the first server does not need to obtain the required page data from the second server, thereby eliminating the need to waste network resources and time resources on data transmission between the first server and the second server, thereby effectively saving network overhead and time overhead.
[0036] In one embodiment, the multi-level cache also includes a third-level cache, and the third-level cache is used to store page data required for page files in text form. In actual applications, if the temporary page file corresponding to the page call request is not stored in the first-level cache, and the temporary page data corresponding to the page call request is not stored in the second-level cache, a data call request can be sent to the second server to obtain the target page data required for rendering the target page file from the second server. If the target page data fed back by the second server is received, the target page file can be provided to the client based on the target page data fed back by the second server and the target page template corresponding to the page call request, and the page data stored in the third-level cache can be updated based on the target page data fed back by the second server, so that the page data stored in the third-level cache is real-time. Specifically, the page data corresponding to the specified field carried by the data call request can be searched in the third-level cache, so that the page data corresponding to the specified field can be updated using the target page data fed back by the second server.
[0037] In a specific implementation, due to the downtime, crash or poor network status of the second server, the target page data fed back by the second server is not received. In order to normally feed back the target page file to the client in this case, the multi-level cache provided by the embodiment of the present invention can also store non-temporary page data, so that the target page data required for rendering the target page file can still be obtained in this case. In one embodiment, the target page data corresponding to the specified field carried by the data call request can be searched in the multi-level cache. In a specific implementation, the target page data corresponding to the data call request can be searched from the third-level cache, so as to render the target page template of the target page data case obtained from the third-level cache, so as to feed back the rendered target page file to the client normally.
[0038] In one embodiment, for the target page file rendered based on the temporary page data and the target page template, and the target page file rendered based on the target page data and the target page template, the following operations can be performed: determine the first call deadline corresponding to the target page file, and associate the target page file and the first call deadline corresponding to the target page file and store them in the first-level cache. By setting the first call deadline for the rendered target page file and saving it to the first-level cache, if a call request for the target page file is received again within the first call deadline, the temporary page file can be directly obtained from the first-level cache and fed back to the client, which can not only effectively reduce the time for obtaining file data and the time for rendering the page, but also minimize the memory usage of the first server.
[0039] To facilitate understanding of the above step S106, the embodiment of the present invention also adopts an implementation method of providing a target page file to the client based on the target page template and target page data corresponding to the page call request. Optionally, the target page template corresponding to the page call request is first obtained, and then the target page template and the target page data are rendered to obtain the target page file, and the target page file is sent to the client. In a specific implementation method, in the memory of the first-level server, the remaining storage areas except the storage areas corresponding to the first-level cache, the second-level cache and the third-level cache can be used to store page templates, so that the target page template corresponding to the URL carried by the page call request can be searched in the memory, and the target page data can be rendered according to the target page template to obtain the required target page file.
[0040] Based on the page calling method provided in the above embodiment, the embodiment of the present invention provides an application example of the page calling method. Figure 3A schematic diagram of interaction between a client, a rendering server and a data storage server is shown, wherein the interaction process between the client, the rendering server and the data storage server can be referred to as shown in the following steps 1 to 4:
[0041] Step 1: The client sends an HTTP request to the rendering server, so that the rendering server returns the target page file corresponding to the HTTP request. For example, if the client requests to obtain the homepage of a specified website, the HTTP request will carry the link address of the homepage of the specified website, which is also the above URL.
[0042] Step 2: The rendering server receives the HPPT request and determines whether there is a temporary page file corresponding to the link address in the first-level cache. If there is a temporary page file corresponding to the link address in the first-level cache, the temporary page file is fed back to the client; if there is no temporary page file corresponding to the link address in the first-level cache, step 3 is executed.
[0043] Step 3, determine whether there is temporary page data corresponding to the link address in the second-level cache. If there is temporary page data corresponding to the link address in the second-level cache, obtain the target page template corresponding to the link address from the rendering server, render the temporary page data according to the target page template to obtain the target page file, feed back the rendered target page file to the client, and save the rendered target page file to the first-level cache, so that when the same HTTP request sent by the client is received again, the target page file can be directly fed back to the client from the first-level cache; if there is no temporary page data corresponding to the link address in the second-level cache, execute step 4.
[0044] Step 4, the rendering server sends a data call request to the data storage server. If the target page data fed back by the data storage server based on the data call request is received, the target page file will be generated by combining it with the target page template obtained in the above step 3, and the target page file will be fed back to the client, and the specified field in the link address carried in the HTTP request is used as the identifier of the target page data, and the target page data and the identifier of the target page data are associated and saved in the third-level cache of the rendering server to update the page data corresponding to the identifier in the third-level cache. In an optional embodiment, the third-level cache saves the page data in the form of a file. If the target page data fed back by the data storage server based on the data call request is not received, and the call to the upstream service fails, the target data file corresponding to the identifier can be directly obtained from the third-level cache, so that the target data file is rendered according to the target page template obtained in the above step 3 to obtain the target page file, and the target page file is fed back to the client.
[0045] In summary, the page calling method provided by the embodiment of the present invention has at least the following characteristics:
[0046] (i) When a user accesses the same page, if the first call period set in the first-level cache has not been exceeded, the rendering server does not need to re-render the page, thereby greatly saving the overhead of the first server.
[0047] (ii) If the first call deadline set in the first-level cache has expired but the second call deadline set in the second-level cache has not expired, the rendering server does not need to send a data call request to the data storage service, thereby saving time and network overhead.
[0048] (3) When an upstream service (i.e., the above-mentioned data calling server) fails, since the rendering server in the embodiment of the present invention is also provided with a third-level cache, and the third-level cache stores page data in the form of files, page rendering can still be performed based on the page data in the third-level cache, thereby returning the target page file to the client normally.
[0049] For the page calling method provided in the above embodiment, the embodiment of the present invention provides a page calling device, which is applied to a first server, the first server is provided with a multi-level cache, the first server stores a page template required for a page file, and the page file is obtained by rendering the page data according to the page template. Figure 4 The schematic diagram of the structure of a page calling device shown in FIG. 1 mainly includes the following parts:
[0050] The judgment module 402 is used to judge whether a temporary page file and / or temporary page data corresponding to the page call request is stored in the multi-level cache if a page call request sent by the client is received;
[0051] The request sending module 404 is used to send a data call request to the second server when the temporary page data is not stored in the multi-level cache and the temporary page data is not stored, so that the second server feeds back the target page data based on the data call request;
[0052] The page providing module 406 is used to provide a target page file to the client based on the target page template and target page data corresponding to the page call request.
[0053] The above-mentioned page calling device provided by the embodiment of the present invention sets a multi-level cache in the first server to cache temporary page files, page data and non-temporary page data respectively through the multi-level cache. Even if the temporary page file or temporary page data corresponding to the page calling request is not stored in the multi-level cache, the page rendering can be completed to obtain the target page file. Compared with the situation in the prior art where the page rendering cannot be completed when the called server cannot provide relevant data, the embodiment of the present invention can still complete the page rendering and normally feed back the target page file to the client, effectively improving the stability of the page call, thereby significantly improving the customer's page browsing experience.
[0054] In one embodiment, the multi-level cache includes a first-level cache; the above-mentioned judgment module 402 is also used to: judge whether a temporary page file corresponding to the page call request is stored in the first-level cache; the above-mentioned device also includes a first deadline judgment module, which is used to: if a temporary page file is stored in the first-level cache, judge whether the temporary page file exceeds the first call deadline; if not, provide the temporary page file to the client.
[0055] In one embodiment, the multi-level cache includes a second-level cache; the above-mentioned judgment module 402 is also used to: if no temporary page file is stored in the first-level cache, whether temporary page data corresponding to the page call request is stored in the second-level cache; the above-mentioned device also includes a second deadline judgment module, which is used to: if temporary page data is stored in the second-level cache, determine whether the temporary page data exceeds the second call deadline; if not, based on the target page template and temporary page data corresponding to the page call request, provide the target page file to the client.
[0056] In one embodiment, the multi-level cache includes a third-level cache, which is used to store page data required by the page file in text form; the above-mentioned device also includes a data acquisition module, which is used to: if the target page data fed back by the second server is not received, search for the target page data corresponding to the data call request from the third-level cache.
[0057] In one embodiment, the above-mentioned device also includes a data update module, which is used to: if target page data fed back by the second server is received, provide a target page file to the client based on the target page data fed back by the second server and the target page template corresponding to the page call request, and update the page data stored in the third-level cache based on the target page data fed back by the second server.
[0058] In one embodiment, the apparatus further includes a deadline determination module for determining a first call deadline corresponding to the target page file, and associating the target page file and the first call deadline corresponding to the target page file and storing them in the first-level cache.
[0059] In one implementation, the page providing module 406 is further used to: obtain a target page template corresponding to the page call request; render the target page template and target page data to obtain a target page file; and send the target page file to the client.
[0060] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0061] An embodiment of the present invention provides a server. Specifically, the server includes a processor and a storage device. The storage device stores a computer program, and when the computer program is executed by the processor, it executes the method described in any one of the above-mentioned embodiments.
[0062] Figure 5 A structural diagram of a server provided in an embodiment of the present invention, the server 100 includes: a processor 50, a memory 51, a bus 52 and a communication interface 53, wherein the processor 50, the communication interface 53 and the memory 51 are connected via the bus 52; the processor 50 is used to execute an executable module stored in the memory 51, such as a computer program.
[0063] The memory 51 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 53 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0064] The bus 52 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0065] Among them, the memory 51 is used to store programs, and the processor 50 executes the program after receiving the execution instruction. The method executed by the device for flow process definition disclosed in any embodiment of the above-mentioned embodiment of the present invention can be applied to the processor 50 or implemented by the processor 50.
[0066] The processor 50 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 50. The above processor 50 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor to be executed, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 51, and the processor 50 reads the information in the memory 51 and completes the steps of the above method in combination with its hardware.
[0067] The computer program product of the readable storage medium provided in the embodiment of the present invention includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be referred to the previous method embodiments, which will not be repeated here.
[0068] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0069] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A page calling method, characterized in that: The method is applied to a first server, the first server is provided with a multi-level cache, the first server stores a page template required for a page file, the page file is obtained by rendering page data according to the page template, and the method includes: Receiving a page call request sent by a client, determining whether a temporary page file and temporary page data corresponding to the page call request are stored in the multi-level cache; When the temporary page file and the temporary page data are not stored in the multi-level cache, sending a data call request to the second server, so that the second server feeds back the target page data based on the data call request; Providing a target page file to the client based on the target page template corresponding to the page call request and the target page data; The multi-level cache includes a first-level cache; The step of determining whether a temporary page file corresponding to the page call request is stored in the multi-level cache comprises: determining whether a temporary page file corresponding to the page call request is stored in the first-level cache; The method further comprises: if the temporary page file is stored in the first level cache, determining whether the temporary page file exceeds a first call deadline; if not, providing the temporary page file to the client; The multi-level cache includes a second-level cache; The step of determining whether temporary page data corresponding to the page call request is stored in the multi-level cache comprises: if the temporary page file is not stored in the first-level cache, determining whether temporary page data corresponding to the page call request is stored in the second-level cache; The method also includes: if the temporary page data is stored in the second-level cache, determining whether the temporary page data exceeds a second call deadline; if not, providing a target page file to the client based on a target page template corresponding to the page call request and the temporary page data.
2. The method according to claim 1, characterized in that The multi-level cache includes a third-level cache, and the third-level cache is used to store page data required by the page file in text form; The method further comprises: If the target page data fed back by the second server is not received, the target page data corresponding to the data call request is searched from the third-level cache.
3. The method according to claim 2, characterized in that The method further comprises: If the target page data fed back by the second server is received, a target page file is provided to the client based on the target page data fed back by the second server and a target page template corresponding to the page call request, and the page data stored in the third-level cache is updated based on the target page data fed back by the second server.
4. The method according to claim 1, characterized in that: The method further comprises: A first call deadline corresponding to the target page file is determined, and the target page file and the first call deadline corresponding to the target page file are associated and stored in the first level cache.
5. The method according to claim 1, characterized in that The step of providing the target page file to the client based on the target page template corresponding to the page call request and the target page data includes: Obtaining a target page template corresponding to the page call request; Rendering the target page template and the target page data to obtain a target page file; The target page file is sent to the client.
6. A page calling device, characterized in that: The device is applied to a first server, the first server is provided with a multi-level cache, the first server stores a page template required for a page file, the page file is obtained by rendering page data according to the page template, and the device includes: A judgment module, configured to receive a page call request sent by a client, and judge whether a temporary page file and temporary page data corresponding to the page call request are stored in the multi-level cache; a request sending module, configured to send a data call request to the second server when the temporary page data is not stored in the multi-level cache and the temporary page data is not stored, so that the second server feeds back the target page data based on the data call request; A page providing module, used for providing a target page file for the client based on a target page template corresponding to the page call request and the target page data; The multi-level cache includes a first-level cache; the judgment module is further used to: judge whether a temporary page file corresponding to the page call request is stored in the first-level cache; the device also includes a first deadline judgment module, which is used to: if the temporary page file is stored in the first-level cache, judge whether the temporary page file exceeds a first call deadline; if not, provide the temporary page file to the client; The multi-level cache includes a second-level cache; the judgment module is also used to: if the temporary page file is not stored in the first-level cache, determine whether the temporary page data corresponding to the page call request is stored in the second-level cache; the device also includes a second deadline judgment module, which is used to: if the temporary page data is stored in the second-level cache, determine whether the temporary page data exceeds the second call deadline; if not, provide the target page file to the client based on the target page template corresponding to the page call request and the temporary page data.
7. A server, characterized in that: include: processor and storage device; The storage device stores a computer program, which, when executed by the processor, executes the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are executed.
