[go: up one dir, main page]

WO2019109326A1 - Page cache processing method and device, and server - Google Patents

Page cache processing method and device, and server Download PDF

Info

Publication number
WO2019109326A1
WO2019109326A1 PCT/CN2017/115189 CN2017115189W WO2019109326A1 WO 2019109326 A1 WO2019109326 A1 WO 2019109326A1 CN 2017115189 W CN2017115189 W CN 2017115189W WO 2019109326 A1 WO2019109326 A1 WO 2019109326A1
Authority
WO
WIPO (PCT)
Prior art keywords
cache
access instruction
page
content
shared memory
Prior art date
Application number
PCT/CN2017/115189
Other languages
French (fr)
Chinese (zh)
Inventor
周建平
陈于康
马海波
Original Assignee
深圳市大疆创新科技有限公司
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 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to CN201780015720.7A priority Critical patent/CN108780458A/en
Priority to PCT/CN2017/115189 priority patent/WO2019109326A1/en
Publication of WO2019109326A1 publication Critical patent/WO2019109326A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes

Definitions

  • the present application relates to the field of computer network technologies, and in particular, to a page cache processing method, apparatus, and server.
  • the user terminal when the user needs to access a web address, the user terminal sends an access instruction to the server corresponding to the website.
  • the server of the website obtains the instruction
  • the back end application server retrieves and feeds back and accesses the instruction to the user terminal. Match the page data.
  • the present invention provides a page cache processing method, apparatus, and server.
  • the present invention provides the following technical solutions:
  • a page cache processing method includes:
  • the backend application server retrieves and returns content that matches the access instruction.
  • a page cache processing device includes:
  • An instruction acquisition unit configured to acquire an access instruction
  • a shared memory unit that returns a cached content when there is a cache corresponding to the access instruction in the shared memory
  • a first determining unit configured to: if the shared memory does not have a cache corresponding to the access instruction Determining whether there is a cache corresponding to the access instruction in the cache server;
  • a cache unit configured to return a cached content when a cache corresponding to the access instruction exists in the cache server
  • a backend data retrieving unit configured to: retrieve, by the backend application server, content that matches the access instruction, if the cache server does not have a cache corresponding to the access instruction.
  • a server comprising the page cache processing device of any of the above.
  • the embodiment of the present invention provides a method, a device, and a server for processing a page cache.
  • the method determines the shared memory in advance by acquiring an access instruction sent by the user terminal. Whether the cache matching the access command, if present, feeds back the cached content to the user terminal, and if not, determines whether there is a cache matching the access command in the cache server, and if so, feedback to the user terminal If the cached content does not exist, the content corresponding to the access command is retrieved by the backend application server, and the retrieved data is fed back to the user terminal.
  • the corresponding cached content is preferentially retrieved from the shared memory and the cache server, and only if the corresponding cached content does not exist in the shared memory and the cache server,
  • the backend application server retrieves data corresponding to the access instruction, thereby improving the response speed of the system and increasing the data throughput thereof.
  • FIG. 1 is a schematic flowchart of a page cache processing method according to an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a page cache processing method according to another embodiment of the present disclosure.
  • FIG. 3 is a schematic structural diagram of a page cache processing apparatus according to an embodiment of the present disclosure.
  • the present application discloses a page cache processing method, apparatus and server.
  • the specific operation process of the page cache processing method disclosed in this embodiment of the present application may include:
  • Step S101 Acquire an access instruction
  • the access command is an access command generated according to an access request sent by the user terminal, and the user terminal may refer to a computer, a mobile phone, etc., when the user accesses the webpage by using the user terminal, sending an access instruction to the server side of the webpage.
  • the access request may include the accessed URL and the country.
  • the generated key may be used as an access command according to the URL (Uniform Resource Locator) and the corresponding key generated by the country.
  • the server side may retrieve a target webpage that matches the URL and the country according to the key.
  • a Uniform Resource Identifier corresponds to multiple pages, each page corresponds to a different country or a combination of countries and languages, and the URL of the access request and the country or a unique key corresponding to the URL, country, and language, by the unique The key can determine the landing page corresponding to this access request.
  • Step S102 determining whether there is a cache matching the access command stored in the shared memory, and if so, executing step S103, otherwise executing step S104;
  • the shared memory can be implemented by a web cache technology, which refers to a copy of a web resource (page html, data, etc.) existing between the server and the client.
  • the cache will save a copy of the output according to the incoming request; when the next request comes, obtain the URL and country of the request, and determine whether the two requests (the next request and the last request) have the same URL, if The same URL, the cache will decide whether to use the copy to respond to the access request directly or according to the caching mechanism, or send the request to the server again.
  • the shared memory is used to store a copy of a page corresponding to the access instruction, and the copy of the page is used as a cache of the shared memory.
  • Content that is, in the present application, the cached copy in the shared memory is a complete webpage content, and when an access instruction sent by the user terminal is obtained, it is determined whether the shared memory has a copy of the page accessed by the access instruction, That is, it is determined whether there is a copy of the webpage corresponding to the URL of the access command and the country in the shared memory, and if yes, executing step S103, directly sending a copy of the webpage to the user without performing data interaction with the server terminal.
  • the cached content in the shared memory may be set according to user requirements, for example, it may include a copy of the page accessed in the most recent preset time period, and the access frequency exceeds a set value.
  • Step S103 Extracting a cache in the shared memory that matches the access instruction, and feeding back the cache to the user terminal;
  • the corresponding cache When there is a cache corresponding to the access instruction in the shared memory, the corresponding cache is directly retrieved from the shared memory, and the cache is fed back to the mobile terminal as response data of the access command.
  • step S104 determines, when the cached content matches the access instruction, whether the cached content corresponding to the access instruction is valid, and if so, extracting and returning the cached content to the user terminal, if the cached content is invalid If the cached content corresponding to the access command does not exist in the shared memory, step S104 is performed.
  • Step S104 determining whether there is a cache corresponding to the access instruction in the cache server, and if so, executing step S105, otherwise, performing step S106;
  • the cached content in the cache server in the server is screened to determine whether the cached content of the cache server exists. A copy of the page matching the access command, and then performing the corresponding subsequent steps according to the judgment result.
  • the cache server may be referred to as a redis database, and the cached content in the redis database may be set according to user requirements, for example, it may include access within a preset preset time period. A copy of the page, the page access frequency that exceeds the set value A copy of the page of the preset, specific page, or a copy of the page whose visit amount is greater than the preset value in the most recent period of time.
  • Step S105 Extract a cache matching the access instruction in the cache server, and feed the cache to the user terminal;
  • step S106 Determining whether the cache corresponding to the access instruction is valid when there is a cache corresponding to the access instruction in the cache server, and if yes, returning the cache content to the user terminal, and if not, determining that the cache server does not exist and The cache corresponding to the access instruction is executed, and step S106 is performed.
  • Step S106 Retrieving and returning to the user terminal the content matching the access instruction by the backend application server;
  • All the webpage content is stored in the backend application server, and when the shared memory and the cache server do not find a copy of the webpage matching the access instruction, the database may be directly retrieved from the database in the backend application server.
  • the webpage corresponding to the access instruction is fed back to the user terminal, and the feedback content can also be written into the cache server or the shared memory.
  • the cached content is fed back to the user terminal, and if not, the cache server is determined. Whether there is a cache matching the access instruction, if yes, feeding back the cached content to the user terminal, if not, the content corresponding to the access instruction is retrieved by the backend application server, and the content is retrieved The data arrived is fed back to the user terminal. It can be seen that, when the user accesses the webpage, the corresponding cached content is preferentially retrieved from the shared memory and the cache server, and only when the corresponding cached content does not exist in the shared memory and the cache server. The backend application server retrieves data corresponding to the access instruction, thereby improving the response speed of the system and increasing the data throughput thereof.
  • a shared memory and a cache server may be preset for each country, and the shared memory and cache server only accept the country.
  • User access instructions for users in the country When accessing the webpage, the access instruction is sent to the shared memory in advance, and when there is no corresponding cache in the shared memory, the access instruction is sent to the cache server, and when there is no corresponding cache in the cache server, the access is accessed again. The instructions are sent to the backend application server.
  • the shared memory, the cache server, and the back-end application server may use a network dedicated line, that is, a shared memory, a cache server, and a back-end application server through a dedicated The data transmission channel communicates.
  • the cached content in the shared memory and the cache server may be set according to different rules. That is, the server side stores the cache data in a server-side cache layer, for example, storing static page data in the shared memory and the cache server.
  • the shared memory is taken first, then the cache server, and if the shared memory and the cache server do not hit the access instruction, the source is returned to the backend application server.
  • the user terminal when the content matched by the access instruction is retrieved by the backend application server, the user terminal directly feeds back the user when the access command is received again.
  • the content of the technical solution disclosed in the foregoing embodiment of the present application may further include:
  • the content that is matched by the backend application server and matched with the access instruction is written into the cache server.
  • the data content stored in the cache server is the content that has been accessed in the most recent preset time period.
  • the cached content in the shared memory may be hot data
  • the hot data is data content whose access frequency is greater than a set value.
  • the method may further include:
  • Step S201 Counting the access frequency of the accessed content corresponding to the obtained access instruction
  • Step S202 determining whether the access frequency is greater than a set value, and if yes, continuing execution.
  • Step S203 Store the access content in the shared memory.
  • the specific process may be: parsing the obtained access instruction, and obtaining the target webpage corresponding to each access instruction, specifically, may be included by the access instruction. Determining the target webpage by using a URL, a country or a URL, a country, and a language.
  • the target webpage is determined, determining whether the target webpage exists in the preset access list, and if yes, the visit amount of the target webpage is increased by 1, if not The target webpage is added to the preset access list, and the access amount of the target webpage is increased by one, and the access frequency of each target webpage is calculated according to the obtained time of each access instruction, and the target is obtained.
  • the frequency of access to a web page is the frequency of access to the content.
  • the access command may also be matched. Content is written to the shared memory.
  • the user access instruction may pass through the shared memory before being transmitted to the backend application server. Therefore, in the embodiment of the present application, the preset access list may be set on the shared memory end.
  • the method may further include: real-time counting the access frequency of each cached data in the shared memory, and detecting that the access frequency of a cached content is lower than the set frequency. When the value is set, the cached content is moved out of the shared memory.
  • the back-end application server operation and maintenance personnel may update and adjust certain configuration contents on the page.
  • the operation and maintenance personnel need to launch new products or downline some old products; or the back-end application server.
  • the operation and maintenance personnel set a timed task in the background, for example, a delivery reminder or an appointment reminder is periodically generated in the webpage, so that the configuration content in the page stored in the backend application server is adjusted according to the timing task, in order to update the shared memory in time.
  • the cached page in the cache server the above method may further include:
  • the technical solution disclosed in the embodiment of the present application can also monitor the data content of the back-end application database in real time, and after the judgment Whether the content in the application database is updated, if yes, the page corresponding to the updated content in the backend application database is calculated according to the mapping relationship between the preset model and the page, and the content of the page is updated, and the shared memory is determined. And/or whether the page is stored in the cache server, and if so, the shared memory and the page stored in the cache server are updated according to the updated page of the backend application server.
  • a preset model relationship is stored in the backend application server, and the model relationship refers to goods and pages.
  • the mapping relationship between the product and the product by recording the model relationship, when the parameters of a certain product corresponding to the stored page in the backend application server are adjusted, the associated page cache data referenced by the backend application server needs to be updated.
  • the page content of the page stored in the backend application server corresponding to the item is adjusted by the model relationship. Determining whether the updated page is cached in the shared mitigation/cache server, and if so, updating the shared memory and the page stored in the cache server according to the updated page of the backend application server.
  • the present application further discloses a page cache processing apparatus.
  • the apparatus may be applied to a shared memory and a cache server.
  • the apparatus may include:
  • the instruction collection unit 100 is configured to acquire an access instruction
  • the shared memory unit 200 returns the cached content when there is a cache corresponding to the access instruction in the shared memory;
  • the first determining unit 300 is configured to determine, if the shared memory does not have a cache corresponding to the access instruction, whether there is a cache corresponding to the access instruction in the cache server;
  • the cache unit 400 is configured to: when the cache corresponding to the access instruction exists in the cache server, return the cache content;
  • the backend data retrieval unit 500 is configured to send a user access instruction to the backend application server when the cache server does not have a cache corresponding to the access instruction, to be retrieved and returned by the backend application server.
  • the content of the access instruction matches.
  • the backend data retrieval unit 500 is further configured to: after being retrieved by the backend application server and returned to the content matching the access instruction,
  • the backend data retrieval unit retrieves and returns the content matching the access instruction
  • the backend data retrieval unit is further configured to:
  • the instruction collection unit 100 is specifically configured to:
  • the above apparatus further includes:
  • a hot page cache unit for storing pages that meet the set conditions in the shared memory.
  • the hotspot page buffer unit is configured to: perform real-time statistics on the access frequency of the accessed content corresponding to the obtained access instruction, and store the content in the shared memory when determining that the access frequency of the content is greater than the set value.
  • the specific process may be: parsing the obtained access instruction, and obtaining the target webpage corresponding to each access instruction, specifically, the URL and the country or the URL and the country ID included in the access instruction.
  • the target webpage determining, by the language, the target webpage, if the target webpage is determined, determining whether the target webpage exists in the preset access list, and if yes, the visit amount of the target webpage is increased by 1, if not, the preset accessing
  • the target webpage is added to the list, and the access volume of the target webpage is increased by one.
  • the access frequency of each target webpage is calculated, and the access frequency of the target webpage is the access content. Frequency of visits.
  • the hotspot page buffer unit may be further configured to perform real-time statistics on the access frequency of each cached data in the shared memory. When detecting that the access frequency of a cached content is lower than a set value, the cached content is moved out of the shared memory.
  • the shared memory unit is specifically configured to:
  • the cache unit is specifically configured to:
  • the foregoing apparatus may further include:
  • An update unit for judging whether the content in the backend application database is updated, and if so, according to the pre
  • the mapping relationship between the model and the page is calculated to obtain a page corresponding to the updated content in the backend application database, and the cache in the shared memory and the cache server is refreshed according to the updated content and the page corresponding to the updated content.
  • the present application also discloses a server that applies the page buffer processing apparatus according to any one of the above items.

Landscapes

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

Abstract

Provided are a page cache processing method and device, a back-end application server and a server. The method comprises: when an access instruction sent by a user terminal is acquired, pre-determining whether there is a cache matching the access instruction in a shared memory; if so, feeding the cache content back to the user terminal; if not, determining whether there is a cache matching the access instruction in a cache server; if so, feeding the cache content back to the user terminal; and also if not, a back-end application server taking content corresponding to the access instruction, and feeding the data taken back to the user terminal. Therefore, the response speed of a system is increased, and the data throughput thereof is increased.

Description

一种页面缓存处理方法、装置和服务器Page cache processing method, device and server 技术领域Technical field
本申请涉及计算机网络技术领域,更具体涉及一种页面缓存处理方法、装置和服务器。The present application relates to the field of computer network technologies, and in particular, to a page cache processing method, apparatus, and server.
背景技术Background technique
现有技术中,当用户需要访问一网址时,通过用户终端向网站对应的服务器发送访问指令,当网站的服务器获取到该指令时,由后端应用服务器调取并向用户终端反馈与访问指令相匹配的网页数据。In the prior art, when the user needs to access a web address, the user terminal sends an access instruction to the server corresponding to the website. When the server of the website obtains the instruction, the back end application server retrieves and feeds back and accesses the instruction to the user terminal. Match the page data.
针对于访问量较大的服务器而言,由于其访问量巨大,服务器在每处理一个访问请求时均需要一定的处理时间,因此,会造成服务器在大流量高并发情况时数据吞吐量低,且难以实现对访问指令的快速响应。For a server with a large amount of access, because the access volume is huge, the server needs a certain processing time every time an access request is processed. Therefore, the data throughput is low when the server has a large flow and high concurrent situation, and It is difficult to achieve a quick response to access commands.
发明内容Summary of the invention
有鉴于此,本发明提供了一种页面缓存处理方法、装置和服务器。In view of this, the present invention provides a page cache processing method, apparatus, and server.
为实现上述目的,本发明提供如下技术方案:To achieve the above object, the present invention provides the following technical solutions:
一种页面缓存处理方法,包括:A page cache processing method includes:
获取访问指令;Obtain an access instruction;
当共享内存中存在与所述访问指令对应的缓存时,返回缓存内容;Returning the cached content when there is a cache corresponding to the access instruction in the shared memory;
如果所述共享内存不存在与所述访问指令对应的缓存时,判断缓存服务器中是否存在与所述访问指令对应的缓存;If the shared memory does not have a cache corresponding to the access instruction, determining whether a cache corresponding to the access instruction exists in the cache server;
当缓存服务器中存在与所述访问指令对应的缓存时,返回缓存内容;Returning the cached content when there is a cache corresponding to the access instruction in the cache server;
如果所述缓存服务器不存在与所述访问指令对应的缓存时,由后端应用服务器调取并返回与所述访问指令相匹配的内容。If the cache server does not have a cache corresponding to the access instruction, the backend application server retrieves and returns content that matches the access instruction.
一种页面缓存处理装置,包括:A page cache processing device includes:
指令采集单元,用于获取访问指令;An instruction acquisition unit, configured to acquire an access instruction;
共享内存单元,当共享内存中存在与所述访问指令对应的缓存时,返回缓存内容;a shared memory unit that returns a cached content when there is a cache corresponding to the access instruction in the shared memory;
第一判断单元,用于如果所述共享内存不存在与所述访问指令对应的缓存 时,判断缓存服务器中是否存在与所述访问指令对应的缓存;a first determining unit, configured to: if the shared memory does not have a cache corresponding to the access instruction Determining whether there is a cache corresponding to the access instruction in the cache server;
缓存单元,用于当缓存服务器中存在与所述访问指令对应的缓存时,返回缓存内容;a cache unit, configured to return a cached content when a cache corresponding to the access instruction exists in the cache server;
后端数据调取单元,用于如果所述缓存服务器不存在与所述访问指令对应的缓存时,由后端应用服务器调取并返回与所述访问指令相匹配的内容。And a backend data retrieving unit, configured to: retrieve, by the backend application server, content that matches the access instruction, if the cache server does not have a cache corresponding to the access instruction.
一种服务器,应用有上述任意一项所述的页面缓存处理装置。A server, comprising the page cache processing device of any of the above.
经由上述的技术方案可知,与现有技术相比,本发明实施例提供了一种页面缓存处理方法、装置和服务器,所述方法通过当获取到用户终端发送的访问指令后,预先判断共享内存中是否与所述访问指令相匹配的缓存,如果存在,向用户终端反馈该缓存内容,如果不存在,判断缓存服务器中是否存在与所述访问指令相匹配的缓存,如果存在,向用户终端反馈该缓存内容,如果也不存在时,由后端应用服务器中调取与所述访问指令对应的内容,将调取到的数据反馈给用户终端。由上述方式可见,用户在访问网页时,优先由所述共享内存和缓存服务器中调取对应的缓存内容,只有当所述共享内存和缓存服务器中均不存在对应的缓存内容是,才由所述后端应用服务器中调取与所述访问指令相对应的数据,因此,提高了系统的响应速度,增大了其数据吞吐量。According to the foregoing technical solution, the embodiment of the present invention provides a method, a device, and a server for processing a page cache. The method determines the shared memory in advance by acquiring an access instruction sent by the user terminal. Whether the cache matching the access command, if present, feeds back the cached content to the user terminal, and if not, determines whether there is a cache matching the access command in the cache server, and if so, feedback to the user terminal If the cached content does not exist, the content corresponding to the access command is retrieved by the backend application server, and the retrieved data is fed back to the user terminal. It can be seen that, when the user accesses the webpage, the corresponding cached content is preferentially retrieved from the shared memory and the cache server, and only if the corresponding cached content does not exist in the shared memory and the cache server, The backend application server retrieves data corresponding to the access instruction, thereby improving the response speed of the system and increasing the data throughput thereof.
附图说明DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is an embodiment of the present invention, and those skilled in the art can obtain other drawings according to the provided drawings without any creative work.
图1为本申请实施例公开的一种页面缓存处理方法的流程示意图;FIG. 1 is a schematic flowchart of a page cache processing method according to an embodiment of the present application;
图2为本申请另一实施例提供的一种页面缓存处理方法的流程示意图;2 is a schematic flowchart of a page cache processing method according to another embodiment of the present disclosure;
图3为本申请实施例提供的一种页面缓存处理装置的结构示意图。FIG. 3 is a schematic structural diagram of a page cache processing apparatus according to an embodiment of the present disclosure.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solution in the embodiment of the present invention will be clarified in the following with reference to the accompanying drawings in the embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS It is apparent that the described embodiments are only a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
为了提高Web应用框架在大流量高并发情况下的响应速度,提高其吞吐量,本申请公开了一种页面缓存处理方法、装置和服务器。In order to improve the response speed of the web application framework in the case of high traffic and high concurrency, and improve its throughput, the present application discloses a page cache processing method, apparatus and server.
如图1所示,本申请实施例公开的页面缓存处理方法的具体操作流程可以包括:As shown in FIG. 1 , the specific operation process of the page cache processing method disclosed in this embodiment of the present application may include:
步骤S101:获取访问指令;Step S101: Acquire an access instruction;
所述访问指令是,依据用户终端发送的访问请求生成的访问指令,该用户终端可以指的是电脑、手机等,当用户采用所述用户终端访问网页时,向网页的服务器方发送一访问指令,该访问请求中可以包括访问的URL和国家,本方法中可以依据所述URL(Uniform Resource Locator)和国家生成对应的key,将生成的key作为访问指令。所述服务器方可以依据所述key调取与所述URL和国家相匹配的目标网页。The access command is an access command generated according to an access request sent by the user terminal, and the user terminal may refer to a computer, a mobile phone, etc., when the user accesses the webpage by using the user terminal, sending an access instruction to the server side of the webpage. The access request may include the accessed URL and the country. In the method, the generated key may be used as an access command according to the URL (Uniform Resource Locator) and the corresponding key generated by the country. The server side may retrieve a target webpage that matches the URL and the country according to the key.
以电商页面为例,其访问用户可能来自世界上的各个国家,每个国家的通用语言和文本各异,因此,为了方便各个国家的用户正常浏览页面,本申请公开的技术方案中可采用统一URL(Uniform Resource Identifier)对应多个页面,每个页面对应不同的国家或国家和语言的组合,由访问请求的URL和国家或者是由URL、国家和语言对应一唯一key,由该唯一的key就可以确定本次访问请求所对应的目标网页。Taking the e-commerce page as an example, the access users may come from various countries in the world, and the common language and text of each country are different. Therefore, in order to facilitate the normal browsing of pages by users in various countries, the technical solutions disclosed in the present application may be used. A Uniform Resource Identifier corresponds to multiple pages, each page corresponds to a different country or a combination of countries and languages, and the URL of the access request and the country or a unique key corresponding to the URL, country, and language, by the unique The key can determine the landing page corresponding to this access request.
步骤S102:判断共享内存中是否存储有与所述访问指令相匹配的缓存,如果是,执行步骤S103,否则执行步骤S104;Step S102: determining whether there is a cache matching the access command stored in the shared memory, and if so, executing step S103, otherwise executing step S104;
所述共享内存可以通过Web缓存技术实现,Web缓存是指一个Web资源(页面html、数据等)存在于服务器和客户端之间的副本。缓存会根据进来的请求保存输出内容的副本;当下一个请求来到的时候,获取该请求的URL和国家,判断两个请求(该下一个请求和上一个请求)是否具有相同的URL,如果是相同的URL,缓存会根据缓存机制决定是直接使用副本响应访问请求,还是向服务器再次发送请求。The shared memory can be implemented by a web cache technology, which refers to a copy of a web resource (page html, data, etc.) existing between the server and the client. The cache will save a copy of the output according to the incoming request; when the next request comes, obtain the URL and country of the request, and determine whether the two requests (the next request and the last request) have the same URL, if The same URL, the cache will decide whether to use the copy to respond to the access request directly or according to the caching mechanism, or send the request to the server again.
基于Web缓存,本申请实施例公开的技术方案中,所述共享内存中用于存储一些访问指令对应的页面的副本,将所述页面的副本作为共享内存的缓存 内容,即在本申请中,所述共享内存中缓存的副本是完整的网页内容,当获取到用户终端发送的访问指令时,判断共享内存中是否已经具有所述访问指令所访问的页面副本,即,判断所述共享内存中是否存在与所述访问指令的URL和国家所对应的网页副本,如果存在,执行步骤S103,无需与服务器进行数据交互即可直接将所述网页的副本发送至用户终端。Based on the web cache, in the technical solution disclosed in the embodiment of the present application, the shared memory is used to store a copy of a page corresponding to the access instruction, and the copy of the page is used as a cache of the shared memory. Content, that is, in the present application, the cached copy in the shared memory is a complete webpage content, and when an access instruction sent by the user terminal is obtained, it is determined whether the shared memory has a copy of the page accessed by the access instruction, That is, it is determined whether there is a copy of the webpage corresponding to the URL of the access command and the country in the shared memory, and if yes, executing step S103, directly sending a copy of the webpage to the user without performing data interaction with the server terminal.
在本申请实施例公开的技术方案中,所述共享内存中的缓存内容可以依据用户需求自行设定,例如,其可以包括最近预设时间段内访问过的页面副本、访问频率超过设定值的页面副本、预设的特定页面的页面副本或最近一段时间内访问量大于预设值的页面副本等。In the technical solution disclosed in the embodiment of the present application, the cached content in the shared memory may be set according to user requirements, for example, it may include a copy of the page accessed in the most recent preset time period, and the access frequency exceeds a set value. A copy of the page, a copy of the page of the preset specific page, or a copy of the page with a visit amount greater than the preset value in the most recent period of time.
步骤S103:提取共享内存中与所述访问指令相匹配的缓存,将所述缓存反馈至用户终端;Step S103: Extracting a cache in the shared memory that matches the access instruction, and feeding back the cache to the user terminal;
当共享内存中存在与所述访问指令对应的缓存时,直接由所述共享内存中调取对应的缓存,将所述缓存作为所述访问指令的响应数据反馈至所述移动终端。When there is a cache corresponding to the access instruction in the shared memory, the corresponding cache is directly retrieved from the shared memory, and the cache is fed back to the mobile terminal as response data of the access command.
进一步的,当所述共享内存中的缓存内容在较长的一个时间段内未更新时,或因为其他原因导致内容失效时,会造成无法向用户反馈或向用户反馈错误的内容,针对于此,当所述共享内存中存在与所述访问指令相匹配的缓存内容时,判断与所述访问指令对应的缓存内容是否有效,如果是,提取并向用户终端返回缓存内容,如果缓存内容失效时,则认为共享内存中不存在与所述访问指令对应的缓存内容,执行步骤S104。Further, when the cached content in the shared memory is not updated in a long period of time, or the content is invalid due to other reasons, the content that cannot be fed back to the user or fed back to the user may be caused. Determining, when the cached content matches the access instruction, whether the cached content corresponding to the access instruction is valid, and if so, extracting and returning the cached content to the user terminal, if the cached content is invalid If the cached content corresponding to the access command does not exist in the shared memory, step S104 is performed.
步骤S104:判断缓存服务器中是否存在与所述访问指令对应的缓存,如果是,执行步骤S105,否则,执行步骤S106;Step S104: determining whether there is a cache corresponding to the access instruction in the cache server, and if so, executing step S105, otherwise, performing step S106;
在本步骤中,当所述共享内存中不存在与所述访问指令相对应的页面副本时,对服务器中的缓存服务器中的缓存内容进行筛查,判断所述缓存服务器的缓存内容中是否存在与该访问指令相匹配的页面副本,再依据判断结果执行相应的后续步骤。In this step, when there is no copy of the page corresponding to the access instruction in the shared memory, the cached content in the cache server in the server is screened to determine whether the cached content of the cache server exists. A copy of the page matching the access command, and then performing the corresponding subsequent steps according to the judgment result.
在本申请实施例公开的技术方案中,所述缓存服务器可以指的是redis数据库,所述redis数据库中的缓存内容可以依据用户需求自行设定,例如,其可以包括最近预设时间段内访问过的页面副本、访问频率超过设定值的页面副 本、预设的特定页面的页面副本或最近一段时间内访问量大于预设值的页面副本等。In the technical solution disclosed in the embodiment of the present application, the cache server may be referred to as a redis database, and the cached content in the redis database may be set according to user requirements, for example, it may include access within a preset preset time period. A copy of the page, the page access frequency that exceeds the set value A copy of the page of the preset, specific page, or a copy of the page whose visit amount is greater than the preset value in the most recent period of time.
步骤S105:提取缓存服务器中与所述访问指令相匹配的缓存,将所述缓存反馈至用户终端;Step S105: Extract a cache matching the access instruction in the cache server, and feed the cache to the user terminal;
进一步的,当所述缓存服务器中的缓存内容在较长的一个时间段内未更新时,或因为其他原因导致内容失效时,会造成无法向用户反馈或向用户反馈错误的内容,针对于此,当缓存服务器中存在与所述访问指令对应的缓存时,判断与所述访问指令对应的缓存是否有效,如果是,向用户终端返回缓存内容,如果否,确定缓存服务器中不存在与所述访问指令对应的缓存,执行步骤S106。Further, when the cached content in the cache server is not updated in a long period of time, or the content is invalid due to other reasons, the content that cannot be fed back to the user or fed back to the user may be caused. Determining whether the cache corresponding to the access instruction is valid when there is a cache corresponding to the access instruction in the cache server, and if yes, returning the cache content to the user terminal, and if not, determining that the cache server does not exist and The cache corresponding to the access instruction is executed, and step S106 is performed.
步骤S106:由后端应用服务器调取并向用户终端返回与所述访问指令相匹配的内容;Step S106: Retrieving and returning to the user terminal the content matching the access instruction by the backend application server;
后端应用服务器中存储有所有的网页内容,当所述共享内存和缓存服务器中没有查找到与所述访问指令相匹配的网页副本时,可以从所述后端应用服务器中的数据库直接调取所述访问指令所对应的网页,并将网页反馈给用户终端,同时还可以将反馈内容写入缓存服务器或共享内存中。All the webpage content is stored in the backend application server, and when the shared memory and the cache server do not find a copy of the webpage matching the access instruction, the database may be directly retrieved from the database in the backend application server. The webpage corresponding to the access instruction is fed back to the user terminal, and the feedback content can also be written into the cache server or the shared memory.
上述方案中,当获取到用户终端发送的访问指令后,预先判断共享内存中是否有与所述访问指令相匹配的缓存,如果存在,向用户终端反馈该缓存内容,如果不存在,判断缓存服务器中是否存在与所述访问指令相匹配的缓存,如果存在,向用户终端反馈该缓存内容,如果也不存在时,由后端应用服务器中调取与所述访问指令对应的内容,将调取到的数据反馈给用户终端。由上述方式可见,用户在访问网页时,优先由所述共享内存和缓存服务器中调取对应的缓存内容,只有当所述共享内存和缓存服务器中均不存在对应的缓存内容时,才从所述后端应用服务器中调取与所述访问指令相对应的数据,因此,提高了系统的响应速度,增大了其数据吞吐量。In the above solution, after obtaining the access instruction sent by the user terminal, it is determined in advance whether there is a cache matching the access command in the shared memory, and if so, the cached content is fed back to the user terminal, and if not, the cache server is determined. Whether there is a cache matching the access instruction, if yes, feeding back the cached content to the user terminal, if not, the content corresponding to the access instruction is retrieved by the backend application server, and the content is retrieved The data arrived is fed back to the user terminal. It can be seen that, when the user accesses the webpage, the corresponding cached content is preferentially retrieved from the shared memory and the cache server, and only when the corresponding cached content does not exist in the shared memory and the cache server. The backend application server retrieves data corresponding to the access instruction, thereby improving the response speed of the system and increasing the data throughput thereof.
本申请上述实施例公开的技术方案中,为了方便国外用户访问网页,提高国外用户访问网页的效率,可以针对每个国家预先设置一个共享内存和缓存服务器,该共享内存和缓存服务器只接受该国家的用户访问指令,该国家的用户 在访问网页时,预先将访问指令发送至所述共享内存,当所述共享内存内没有对应的缓存时,将访问指令发送至缓存服务器,当缓存服务器内没有也对应的缓存时,再将访问指令发送至所述后端应用服务器。并且为了实现数据的快速传递,提高访问速度,所述共享内存、缓存服务器与所述后端应用服务器之间可以采用网络专线,即,共享内存、缓存服务器和后端应用服务器之间通过专用的数据传输通道进行通信。In the technical solution disclosed in the foregoing embodiment of the present application, in order to facilitate foreign users to access webpages and improve the efficiency of foreign users accessing webpages, a shared memory and a cache server may be preset for each country, and the shared memory and cache server only accept the country. User access instructions for users in the country When accessing the webpage, the access instruction is sent to the shared memory in advance, and when there is no corresponding cache in the shared memory, the access instruction is sent to the cache server, and when there is no corresponding cache in the cache server, the access is accessed again. The instructions are sent to the backend application server. And in order to achieve fast data transfer and improve access speed, the shared memory, the cache server, and the back-end application server may use a network dedicated line, that is, a shared memory, a cache server, and a back-end application server through a dedicated The data transmission channel communicates.
在本申请实施例公开的技术方案中,可以对所述共享内存和缓存服务器中的缓存内容依据不同的规则设置缓存内容。即,服务器端采用服务端缓存分层的方式存储缓存数据,例如,将静态页面数据存储在共享内存中和缓存服务器中。优先取共享内存,然后是缓存服务器,如果共享内存和缓存服务器均不命中所述访问指令,则回源到后端应用服务器。In the technical solution disclosed in the embodiment of the present application, the cached content in the shared memory and the cache server may be set according to different rules. That is, the server side stores the cache data in a server-side cache layer, for example, storing static page data in the shared memory and the cache server. The shared memory is taken first, then the cache server, and if the shared memory and the cache server do not hit the access instruction, the source is returned to the backend application server.
优选的,本申请上述实施例公开的技术方案中,在由后端应用服务器调取到与所述访问指令相匹配的内容时,为了便于下一次再次接收到该访问指令时直接向用户终端反馈该内容,本申请上述实施例公开的技术方案中,还可以包括:Preferably, in the technical solution disclosed in the foregoing embodiment of the present application, when the content matched by the access instruction is retrieved by the backend application server, the user terminal directly feeds back the user when the access command is received again. The content of the technical solution disclosed in the foregoing embodiment of the present application may further include:
将所述后端应用服务器调取到的与所述访问指令相匹配的内容写入所述缓存服务器。此时,所述缓存服务器中存储的数据内容为最近预设时间段内被访问过的内容。And the content that is matched by the backend application server and matched with the access instruction is written into the cache server. At this time, the data content stored in the cache server is the content that has been accessed in the most recent preset time period.
优选的,在本申请上述实施例公开的技术方案中,所述共享内存中的缓存内容可以为热数据,所述热数据即为访问频率大于设定值的数据内容。为了方便及时更新所述热数据,本申请上述实施例公开的方法中,参见图2,当由缓存服务器或后端应用服务器向用户终端反馈访问内容时,上述方法还可以包括:Preferably, in the technical solution disclosed in the foregoing embodiment of the present application, the cached content in the shared memory may be hot data, and the hot data is data content whose access frequency is greater than a set value. In order to facilitate the timely update of the hot data, in the method disclosed in the foregoing embodiment of the present application, referring to FIG. 2, when the cache server or the backend application server feeds back the content to the user terminal, the method may further include:
步骤S201:统计获取到的访问指令对应的访问内容的访问频率;Step S201: Counting the access frequency of the accessed content corresponding to the obtained access instruction;
步骤S202:判定访问频率是否大于设定值,如果是,继续执行。Step S202: determining whether the access frequency is greater than a set value, and if yes, continuing execution.
步骤S203:将访问内容存储至共享内存中。Step S203: Store the access content in the shared memory.
在统计访问内容的访问频率时,其具体过程可以为:解析获取到的访问指令,得到各个访问指令所对应的目标网页,具体的,可以通过访问指令所包括 的URL、国家或URL、国家和语言确定所述目标网页,当所述目标网页确定后,判断预设访问列表中是否存在该目标网页,如果存在,该目标网页的访问量加1,如果不存在,在所述预设访问列表中添加所述目标网页,同时,所述目标网页的访问量加1,依据获取到的各个访问指令的时间,计算得到各个目标网页的访问频率,所述目标网页的访问频率即为访问内容的访问频率。当判断访问频率大于设定值时,在由所述缓存服务器或后端应用服务器将与所述访问指令相对应的内容反馈给所述用户终端之后,还可以将与所述访问指令相匹配的内容写入所述共享内存中。由于用户访问指令在传输到后端应用服务器之前会经过所述共享内存,因此,本申请实施例中,所述预设访问列表可设置在共享内存端。When the access frequency of the access content is counted, the specific process may be: parsing the obtained access instruction, and obtaining the target webpage corresponding to each access instruction, specifically, may be included by the access instruction. Determining the target webpage by using a URL, a country or a URL, a country, and a language. When the target webpage is determined, determining whether the target webpage exists in the preset access list, and if yes, the visit amount of the target webpage is increased by 1, if not The target webpage is added to the preset access list, and the access amount of the target webpage is increased by one, and the access frequency of each target webpage is calculated according to the obtained time of each access instruction, and the target is obtained. The frequency of access to a web page is the frequency of access to the content. When it is determined that the access frequency is greater than the set value, after the content corresponding to the access instruction is fed back to the user terminal by the cache server or the backend application server, the access command may also be matched. Content is written to the shared memory. The user access instruction may pass through the shared memory before being transmitted to the backend application server. Therefore, in the embodiment of the present application, the preset access list may be set on the shared memory end.
优选的,为了方便所述共享内存及时剔除一些非热数据,上述方法中,还可以包括实时统计所述共享内存中各个缓存数据的访问频率,当检测到某一缓存内容的访问频率低于设定值时,将该缓存内容移出所述共享内存。Preferably, in order to facilitate the sharing of the non-thermal data in the shared memory, the method may further include: real-time counting the access frequency of each cached data in the shared memory, and detecting that the access frequency of a cached content is lower than the set frequency. When the value is set, the cached content is moved out of the shared memory.
在实际使用时,后端应用服务器运维人员可能会对页面中的某些配置内容进行更新、调整,例如运维人员需要上线新的产品或下线某些旧款产品;或者后端应用服务器运维人员在后台中设置定时任务,例如,网页中定时出现发货提醒或预约提醒等,以使得后端应用服务器中存储的页面中的配置内容依据该定时任务进行调整,为了及时更新共享内存和缓存服务器中的缓存的页面,上述方法还可以包括:In actual use, the back-end application server operation and maintenance personnel may update and adjust certain configuration contents on the page. For example, the operation and maintenance personnel need to launch new products or downline some old products; or the back-end application server. The operation and maintenance personnel set a timed task in the background, for example, a delivery reminder or an appointment reminder is periodically generated in the webpage, so that the configuration content in the page stored in the backend application server is adjusted according to the timing task, in order to update the shared memory in time. And the cached page in the cache server, the above method may further include:
当后端应用服务器中存储的数据内容发生变更时,会导致后端应用服务器对应的网页内容发生变化,此时,如果不对所述共享内存和缓存服务器中的内容进行更新,会使得用户由共享内存和缓存服务器中获取到错误的数据,对此,为了给用户带来更好地用户体验,本申请实施例公开的技术方案中,还可以实时监控所述后端应用数据库数据内容,判断后端应用数据库中的内容是否更新,如果是,依据预设的模型和页面之间的映射关系计算得到后端应用数据库中的更新内容对应的页面,并对页面内容进行更新,判断所述共享内存和/或缓存服务器中是否存储有该页面,如果有,依据后端应用服务器更新后的页面对所述共享内存和缓存服务器中存储的页面进行更新。When the data content stored in the backend application server is changed, the content of the webpage corresponding to the backend application server is changed. At this time, if the content in the shared memory and the cache server is not updated, the user is shared by the user. The erroneous data is obtained in the memory and the cache server. In order to provide a better user experience for the user, the technical solution disclosed in the embodiment of the present application can also monitor the data content of the back-end application database in real time, and after the judgment Whether the content in the application database is updated, if yes, the page corresponding to the updated content in the backend application database is calculated according to the mapping relationship between the preset model and the page, and the content of the page is updated, and the shared memory is determined. And/or whether the page is stored in the cache server, and if so, the shared memory and the page stored in the cache server are updated according to the updated page of the backend application server.
下面以电商页面对上述页面更新方式进行说明:The following describes the above page update method by e-commerce page:
后端应用服务器中存储有预设的模型关系,所述模型关系指的是商品和页 面,商品和商品之间的映射关系,通过记录模型关系,当后端应用服务器中的存储页面对应的某一商品的参数进行调整时,引用其的关联页面缓存数据需要被更新,此时可通过该模型关系调整该商品对应的、后端应用服务器中存储的页面的页面内容。判断更新的页面是否缓存在所述共享缓和/或缓存服务器中,如果有,依据后端应用服务器更新后的页面对所述共享内存和缓存服务器中存储的页面进行更新。A preset model relationship is stored in the backend application server, and the model relationship refers to goods and pages. The mapping relationship between the product and the product, by recording the model relationship, when the parameters of a certain product corresponding to the stored page in the backend application server are adjusted, the associated page cache data referenced by the backend application server needs to be updated. The page content of the page stored in the backend application server corresponding to the item is adjusted by the model relationship. Determining whether the updated page is cached in the shared mitigation/cache server, and if so, updating the shared memory and the page stored in the cache server according to the updated page of the backend application server.
对应于上述方法,本申请还公开了一种页面缓存处理装置,参见图3,该装置可以应用于共享内存和缓存服务器端,具体的,该装置可以包括:Corresponding to the foregoing method, the present application further discloses a page cache processing apparatus. Referring to FIG. 3, the apparatus may be applied to a shared memory and a cache server. Specifically, the apparatus may include:
指令采集单元100,用于获取访问指令;The instruction collection unit 100 is configured to acquire an access instruction;
共享内存单元200,当共享内存中存在与所述访问指令对应的缓存时,返回缓存内容;The shared memory unit 200 returns the cached content when there is a cache corresponding to the access instruction in the shared memory;
第一判断单元300,用于如果所述共享内存不存在与所述访问指令对应的缓存时,判断缓存服务器中是否存在与所述访问指令对应的缓存;The first determining unit 300 is configured to determine, if the shared memory does not have a cache corresponding to the access instruction, whether there is a cache corresponding to the access instruction in the cache server;
缓存单元400,用于当缓存服务器中存在与所述访问指令对应的缓存时,返回缓存内容;The cache unit 400 is configured to: when the cache corresponding to the access instruction exists in the cache server, return the cache content;
后端数据调取单元500,用于如果所述缓存服务器不存在与所述访问指令对应的缓存时,将用户访问指令发送给后端应用服务器端,以由后端应用服务器调取并返回与所述访问指令相匹配的内容。The backend data retrieval unit 500 is configured to send a user access instruction to the backend application server when the cache server does not have a cache corresponding to the access instruction, to be retrieved and returned by the backend application server. The content of the access instruction matches.
优选的,所述后端数据调取单元500在由后端应用服务器调取并返回与所述访问指令相匹配的内容之后,还用于:Preferably, the backend data retrieval unit 500 is further configured to: after being retrieved by the backend application server and returned to the content matching the access instruction,
将所述后端应用服务器调取到的与所述访问指令相匹配的内容写入所述缓存服务器。And the content that is matched by the backend application server and matched with the access instruction is written into the cache server.
优选的,所述后端数据调取单元在由后端应用服务器调取并返回与所述访问指令相匹配的内容之后,还用于:Preferably, after the backend data retrieval unit retrieves and returns the content matching the access instruction, the backend data retrieval unit is further configured to:
将所述后端应用服务器调取到的与所述访问指令相匹配的内容写入所述共享内存中。And the content that is matched by the backend application server and matched with the access instruction is written into the shared memory.
优选的,指令采集单元100,具体用于:Preferably, the instruction collection unit 100 is specifically configured to:
对获取到的用户终端输入的访问请求进行解析,得到所需访问的URL和 国家ID或URL、国家ID和语言,依据访问的URL和国家ID或URL、国家ID和语言生成对应的key,将所述key作为访问指令。Parsing the access request input by the obtained user terminal, obtaining the URL of the required access and The country ID or URL, country ID, and language generate a corresponding key according to the accessed URL and country ID or URL, country ID, and language, and use the key as an access instruction.
优选的,上述装置中还包括:Preferably, the above apparatus further includes:
热点页面缓存单元,用于将满足设定条件的页面存储至共享内存中。具体的,所述热点页面缓存单元用于:实时统计获取到的访问指令对应的访问内容的访问频率,当判定某内容的访问频率大于设定值时,将该内容存储至共享内存中。在统计访问内容的访问频率时,其具体过程可以为:解析获取到的访问指令,得到各个访问指令所对应的目标网页,具体的,可以通过访问指令所包括的URL和国家或URL、国家ID和语言确定所述目标网页,当所述目标网页确定后,判断预设访问列表中是否存在该目标网页,如果存在,该目标网页的访问量加1,如果不存在,在所述预设访问列表中添加所述目标网页,同时,所述目标网页的访问量加1,依据获取到的各个访问指令的时间,计算得到各个目标网页的访问频率,所述目标网页的访问频率即为访问内容的访问频率。当判断访问频率大于设定值时,在由所述缓存服务器或后端应用服务器将于所述访问指令相对应的内容反馈给所述用户终端之后,还可以与所述访问指令相匹配的内容写入所述共享内存中。A hot page cache unit for storing pages that meet the set conditions in the shared memory. Specifically, the hotspot page buffer unit is configured to: perform real-time statistics on the access frequency of the accessed content corresponding to the obtained access instruction, and store the content in the shared memory when determining that the access frequency of the content is greater than the set value. When the access frequency of the access content is counted, the specific process may be: parsing the obtained access instruction, and obtaining the target webpage corresponding to each access instruction, specifically, the URL and the country or the URL and the country ID included in the access instruction. And determining, by the language, the target webpage, if the target webpage is determined, determining whether the target webpage exists in the preset access list, and if yes, the visit amount of the target webpage is increased by 1, if not, the preset accessing The target webpage is added to the list, and the access volume of the target webpage is increased by one. According to the obtained time of each access instruction, the access frequency of each target webpage is calculated, and the access frequency of the target webpage is the access content. Frequency of visits. When it is determined that the access frequency is greater than the set value, after the content corresponding to the access instruction is fed back to the user terminal by the cache server or the backend application server, the content that can also be matched with the access instruction Write to the shared memory.
热点页面缓存单元还可以用于实时统计所述共享内存中各个缓存数据的访问频率,当检测到某一缓存内容的访问频率低于设定值时,将该缓存内容移出所述共享内存。The hotspot page buffer unit may be further configured to perform real-time statistics on the access frequency of each cached data in the shared memory. When detecting that the access frequency of a cached content is lower than a set value, the cached content is moved out of the shared memory.
优选的,与上述方法相对应,所述共享内存单元具体用于:Preferably, corresponding to the foregoing method, the shared memory unit is specifically configured to:
当共享内存中存在与所述访问指令对应的缓存内容时,判断与所述访问指令对应的缓存内容是否有效,如果是,返回缓存内容,如果否,确定共享内存中不存在与所述访问指令对应的缓存内容。Determining, when the cached content corresponding to the access instruction exists in the shared memory, whether the cached content corresponding to the access instruction is valid, and if yes, returning the cached content, and if not, determining that the shared memory does not exist and the accessing instruction Corresponding cache content.
优选的,与上述方法相对应,所述缓存单元,具体用于:Preferably, corresponding to the foregoing method, the cache unit is specifically configured to:
当缓存服务器中存在与所述访问指令对应的缓存时,判断与所述访问指令对应的缓存是否有效,如果是,返回缓存内容,如果否,确定缓存服务器中不存在与所述访问指令对应的缓存。When there is a cache corresponding to the access instruction in the cache server, determining whether the cache corresponding to the access instruction is valid, and if yes, returning the cache content, and if not, determining that there is no corresponding to the access instruction in the cache server Cache.
与上述方法相对应,上述装置中,还可以包括:Corresponding to the above method, the foregoing apparatus may further include:
更新单元,用于判断后端应用数据库中的内容是否更新,如果是,依据预 设的模型和页面之间的映射关系计算得到后端应用数据库中的更新内容对应的页面,依据更新内容和与更新内容对应的页面刷新所述共享内存和缓存服务器中的缓存。An update unit for judging whether the content in the backend application database is updated, and if so, according to the pre The mapping relationship between the model and the page is calculated to obtain a page corresponding to the updated content in the backend application database, and the cache in the shared memory and the cache server is refreshed according to the updated content and the page corresponding to the updated content.
对应于上述装置,本申请还公开了一种服务器,该服务器应用有上述任意一项所述的页面缓存处理装置。Corresponding to the above apparatus, the present application also discloses a server that applies the page buffer processing apparatus according to any one of the above items.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。Finally, it should also be noted that in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities. There is any such actual relationship or order between operations. Furthermore, the term "comprises" or "comprises" or "comprises" or any other variations thereof is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device that comprises a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such a process, method, item, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。The various embodiments in the present specification are described in a progressive manner, and each embodiment focuses on differences from other embodiments, and the same similar parts between the various embodiments may be referred to each other.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本申请。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。 The above description of the disclosed embodiments enables those skilled in the art to make or use the application. Various modifications to these embodiments are obvious to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the application. Therefore, the application is not limited to the embodiments shown herein, but is to be accorded the broadest scope of the principles and novel features disclosed herein.

Claims (23)

  1. 一种页面缓存处理方法,其特征在于,包括:A page cache processing method, comprising:
    获取访问指令;Obtain an access instruction;
    当共享内存中存在与所述访问指令对应的缓存时,返回缓存内容;Returning the cached content when there is a cache corresponding to the access instruction in the shared memory;
    如果所述共享内存不存在与所述访问指令对应的缓存时,判断缓存服务器中是否存在与所述访问指令对应的缓存;If the shared memory does not have a cache corresponding to the access instruction, determining whether a cache corresponding to the access instruction exists in the cache server;
    当缓存服务器中存在与所述访问指令对应的缓存时,返回缓存内容;Returning the cached content when there is a cache corresponding to the access instruction in the cache server;
    如果所述缓存服务器不存在与所述访问指令对应的缓存时,由后端应用服务器调取并返回与所述访问指令相匹配的内容。If the cache server does not have a cache corresponding to the access instruction, the backend application server retrieves and returns content that matches the access instruction.
  2. 根据权利要求1所述的页面缓存处理方法,其特征在于,所述由后端应用服务器调取并返回与所述访问指令相匹配的内容之后,还包括:The page cache processing method according to claim 1, wherein after the backend application server retrieves and returns the content that matches the access instruction, the method further includes:
    将所述后端应用服务器调取到的与所述访问指令相匹配的内容写入所述缓存服务器。And the content that is matched by the backend application server and matched with the access instruction is written into the cache server.
  3. 根据权利要求1所述的页面缓存处理方法,其特征在于,所述由后端应用服务器调取并返回与所述访问指令相匹配的内容之后,还包括:The page cache processing method according to claim 1, wherein after the backend application server retrieves and returns the content that matches the access instruction, the method further includes:
    将所述后端应用服务器调取到的与所述访问指令相匹配的内容写入所述共享内存中。And the content that is matched by the backend application server and matched with the access instruction is written into the shared memory.
  4. 根据权利要求1所述的页面缓存处理方法,其特征在于,获取访问指令,包括:The method of processing a page cache according to claim 1, wherein the obtaining an access instruction comprises:
    获取访问的URL和国家ID,依据所述URL和国家ID生成对应的key,将所述key作为访问指令。Obtaining the accessed URL and the country ID, generating a corresponding key according to the URL and the country ID, and using the key as an access instruction.
  5. 根据权利要求1所述的页面缓存处理方法,其特征在于,所述共享内存中存储有访问频率满足设定条件的页面。The page buffer processing method according to claim 1, wherein the shared memory stores a page whose access frequency satisfies a setting condition.
  6. 根据权利要求5所述的页面缓存处理方法,其特征在于,所述设定条件为:访问频率大于预设值。The page buffer processing method according to claim 5, wherein the setting condition is that the access frequency is greater than a preset value.
  7. 根据权利要求1所述的页面缓存处理方法,其特征在于,当共享内存中存在与所述访问指令对应的缓存时,返回缓存内容,具体包括:The page cache processing method according to claim 1, wherein when there is a cache corresponding to the access instruction in the shared memory, the cached content is returned, which specifically includes:
    当共享内存中存在与所述访问指令对应的缓存时,判断与所述访问指令对 应的缓存是否有效,如果是,返回缓存内容,如果否,确定共享内存中不存在与所述访问指令对应的缓存。Determining a pair with the access instruction when there is a cache corresponding to the access instruction in the shared memory Whether the cache should be valid, if yes, return the cache content, if not, determine that there is no cache corresponding to the access command in the shared memory.
  8. 根据权利要求1所述的页面缓存处理方法,其特征在于,当缓存服务器中存在与所述访问指令对应的缓存时,返回缓存内容,具体包括:The page cache processing method according to claim 1, wherein when the cache corresponding to the access instruction exists in the cache server, the cached content is returned, which specifically includes:
    当缓存服务器中存在与所述访问指令对应的缓存时,判断与所述访问指令对应的缓存是否有效,如果是,返回缓存内容,如果否,确定缓存服务器中不存在与所述访问指令对应的缓存。When there is a cache corresponding to the access instruction in the cache server, determining whether the cache corresponding to the access instruction is valid, and if yes, returning the cache content, and if not, determining that there is no corresponding to the access instruction in the cache server Cache.
  9. 根据权利要求1所述的页面缓存方法,其特征在于,每个缓存服务器和共享内存对应于一个国家,即,每个缓存服务器和共享服务器用于响应与其对应国家内用户的访问指令。The page caching method according to claim 1, wherein each cache server and shared memory correspond to one country, that is, each cache server and shared server are responsive to access commands of users in their corresponding countries.
  10. 根据权利要求1所述的页面缓存方法,其特征在于,各个缓存服务器和共享内存与后端应用服务器之间通过专线进行数据交互。The page caching method according to claim 1, wherein each of the cache servers and the shared memory and the backend application server exchange data through a dedicated line.
  11. 根据权利要求1所述的页面缓存方法,其特征在于,还包括:The page caching method according to claim 1, further comprising:
    判断后端应用数据库中的内容是否更新,如果是,依据预设的模型和页面之间的映射关系计算得到后端应用数据库中的更新内容对应的页面,依据更新内容和与更新内容对应的页面刷新所述共享内存和缓存服务器中的缓存。Determining whether the content in the back-end application database is updated. If yes, calculating, according to the mapping relationship between the preset model and the page, the page corresponding to the updated content in the back-end application database, according to the updated content and the page corresponding to the updated content. Refresh the cache in the shared memory and cache server.
  12. 一种页面缓存处理装置,其特征在于,包括:A page cache processing device, comprising:
    指令采集单元,用于获取访问指令;An instruction acquisition unit, configured to acquire an access instruction;
    共享内存单元,当共享内存中存在与所述访问指令对应的缓存时,返回缓存内容;a shared memory unit that returns a cached content when there is a cache corresponding to the access instruction in the shared memory;
    第一判断单元,用于如果所述共享内存不存在与所述访问指令对应的缓存时,判断缓存服务器中是否存在与所述访问指令对应的缓存;a first determining unit, configured to determine, if the shared memory does not have a cache corresponding to the access instruction, whether a cache corresponding to the access instruction exists in the cache server;
    缓存单元,用于当缓存服务器中存在与所述访问指令对应的缓存时,返回缓存内容;a cache unit, configured to return a cached content when a cache corresponding to the access instruction exists in the cache server;
    后端数据调取单元,用于如果所述缓存服务器不存在与所述访问指令对应的缓存时,由后端应用服务器调取并返回与所述访问指令相匹配的内容。And a backend data retrieving unit, configured to: retrieve, by the backend application server, content that matches the access instruction, if the cache server does not have a cache corresponding to the access instruction.
  13. 根据权利要求12所述的页面缓存处理装置,其特征在于,所述后端数据调取单元在由后端应用服务器调取并返回与所述访问指令相匹配的内容之后,还用于:The page cache processing device according to claim 12, wherein the backend data retrieving unit is further configured to: after the backend application server retrieves and returns the content that matches the access instruction,
    将所述后端应用服务器调取到的与所述访问指令相匹配的内容写入所述 缓存服务器。Writing the content matching the access instruction to the backend application server to write the Cache server.
  14. 根据权利要求12所述的页面缓存处理装置,其特征在于,所述后端数据调取单元在由后端应用服务器调取并返回与所述访问指令相匹配的内容之后,还用于:The page cache processing device according to claim 12, wherein the backend data retrieving unit is further configured to: after the backend application server retrieves and returns the content that matches the access instruction,
    将所述后端应用服务器调取到的与所述访问指令相匹配的内容写入所述共享内存中。And the content that is matched by the backend application server and matched with the access instruction is written into the shared memory.
  15. 根据权利要求12所述的页面缓存处理装置,其特征在于,指令采集单元,具体用于:The page buffer processing device according to claim 12, wherein the instruction collection unit is specifically configured to:
    获取访问的URL和国家ID,依据所述URL和国家ID生成对应的key,将所述key作为访问指令。Obtaining the accessed URL and the country ID, generating a corresponding key according to the URL and the country ID, and using the key as an access instruction.
  16. 根据权利要求15所述的页面缓存处理装置,其特征在于,还包括:The device for processing a page cache according to claim 15, further comprising:
    热点页面缓存单元,用于将满足设定条件的页面存储至共享内存中。A hot page cache unit for storing pages that meet the set conditions in the shared memory.
  17. 根据权利要求16所述的页面缓存处理装置,其特征在于,所述热点页面缓存单元,具体用于:The page cache processing device according to claim 16, wherein the hot page cache unit is specifically configured to:
    将访问频率大于预设值的页面存储至共享内存中。Store pages with access frequencies greater than the preset value in shared memory.
  18. 根据权利要求12所述的页面缓存处理装置,其特征在于,所述共享内存单元具体用于:The page cache processing device according to claim 12, wherein the shared memory unit is specifically configured to:
    当共享内存中存在与所述访问指令对应的缓存时,判断与所述访问指令对应的缓存是否有效,如果是,返回缓存内容,如果否,确定共享内存中不存在与所述访问指令对应的缓存。When there is a cache corresponding to the access instruction in the shared memory, determining whether the cache corresponding to the access instruction is valid, and if yes, returning the cache content, and if not, determining that there is no corresponding to the access instruction in the shared memory Cache.
  19. 根据权利要求12所述的页面缓存处理装置,其特征在于,所述缓存单元,具体用于:The page cache processing device according to claim 12, wherein the cache unit is specifically configured to:
    当缓存服务器中存在与所述访问指令对应的缓存时,判断与所述访问指令对应的缓存是否有效,如果是,返回缓存内容,如果否,确定缓存服务器中不存在与所述访问指令对应的缓存。When there is a cache corresponding to the access instruction in the cache server, determining whether the cache corresponding to the access instruction is valid, and if yes, returning the cache content, and if not, determining that there is no corresponding to the access instruction in the cache server Cache.
  20. 根据权利要求12所述的页面缓存处理装置,其特征在于,所述共享内存单元和缓存单元的数量为多个,每个共享内存单元和缓存单元对应于一个国家,即,每个共享内存单元和缓存单元用于响应与其对应国家内用户的访问指令。The page cache processing device according to claim 12, wherein the number of the shared memory unit and the cache unit is plural, and each shared memory unit and the cache unit correspond to one country, that is, each shared memory unit. And a cache unit is responsive to access instructions of users within its corresponding country.
  21. 根据权利要求12所述的页面缓存装置,其特征在于,各个共享内存 单元和缓存单元与后端数据调取单元之间通过专线进行数据交互。A page buffering device according to claim 12, wherein each shared memory Data exchange between the unit and the cache unit and the backend data retrieval unit through a dedicated line.
  22. 根据权利要求12所述的页面缓存装置,其特征在于,还包括:The page caching apparatus according to claim 12, further comprising:
    更新单元,用于判断后端应用数据库中的内容是否更新,如果时,依据预设的模型和页面之间的映射关系计算得到后端应用数据库中的更新内容对应的页面,依据更新内容和与更新内容对应的页面刷新所述共享内存和缓存服务器中的缓存。An update unit, configured to determine whether the content in the backend application database is updated, and if so, calculate a page corresponding to the updated content in the backend application database according to a mapping relationship between the preset model and the page, according to the updated content and The page corresponding to the update content refreshes the shared memory and the cache in the cache server.
  23. 一种服务器,其特征在于,应用有权利要求12-22任意一项所述的页面缓存处理装置。 A server characterized by using the page buffer processing apparatus according to any one of claims 12-22.
PCT/CN2017/115189 2017-12-08 2017-12-08 Page cache processing method and device, and server WO2019109326A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201780015720.7A CN108780458A (en) 2017-12-08 2017-12-08 A kind of page cache processing method, device and server
PCT/CN2017/115189 WO2019109326A1 (en) 2017-12-08 2017-12-08 Page cache processing method and device, and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/115189 WO2019109326A1 (en) 2017-12-08 2017-12-08 Page cache processing method and device, and server

Publications (1)

Publication Number Publication Date
WO2019109326A1 true WO2019109326A1 (en) 2019-06-13

Family

ID=64034061

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/115189 WO2019109326A1 (en) 2017-12-08 2017-12-08 Page cache processing method and device, and server

Country Status (2)

Country Link
CN (1) CN108780458A (en)
WO (1) WO2019109326A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109933585B (en) * 2019-02-22 2021-11-02 京东数字科技控股有限公司 Data query method and data query system
CN111291079A (en) * 2020-02-20 2020-06-16 京东数字科技控股有限公司 Data query method and device
CN112035479A (en) * 2020-08-31 2020-12-04 平安医疗健康管理股份有限公司 Medicine database access method and device and computer equipment
CN113806655B (en) * 2021-09-26 2025-08-19 北京沃东天骏信息技术有限公司 Data processing method, device, electronic equipment and storage medium
CN113901335A (en) * 2021-10-14 2022-01-07 浙江省科技信息研究院 Dynamic sensing and routing method for technical resources
CN114036194A (en) * 2021-11-10 2022-02-11 北京沃东天骏信息技术有限公司 Hotspot data processing method and device, storage medium and electronic equipment
CN114281434B (en) * 2021-12-15 2022-11-29 创优数字科技(广东)有限公司 Applet user information management method, apparatus, computer device and storage medium
CN117615013B (en) * 2024-01-19 2024-04-19 杭州优云科技股份有限公司 File searching method, device, equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040073630A1 (en) * 2000-12-18 2004-04-15 Copeland George P. Integrated JSP and command cache for web applications with dynamic content
CN101154230A (en) * 2006-09-30 2008-04-02 中兴通讯股份有限公司 Responding method for large data volume specified searching web pages
CN102368258A (en) * 2011-09-30 2012-03-07 广州市动景计算机科技有限公司 Webpage page caching management method and system
CN106210022A (en) * 2016-06-29 2016-12-07 天涯社区网络科技股份有限公司 A kind of system and method for processing forum's height concurrent data requests

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102117309B (en) * 2010-01-06 2013-04-17 卓望数码技术(深圳)有限公司 Data caching system and data query method
CN107305576A (en) * 2016-04-25 2017-10-31 北京京东尚科信息技术有限公司 The pseudo- static treatment method and apparatus of the page

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040073630A1 (en) * 2000-12-18 2004-04-15 Copeland George P. Integrated JSP and command cache for web applications with dynamic content
CN101154230A (en) * 2006-09-30 2008-04-02 中兴通讯股份有限公司 Responding method for large data volume specified searching web pages
CN102368258A (en) * 2011-09-30 2012-03-07 广州市动景计算机科技有限公司 Webpage page caching management method and system
CN106210022A (en) * 2016-06-29 2016-12-07 天涯社区网络科技股份有限公司 A kind of system and method for processing forum's height concurrent data requests

Also Published As

Publication number Publication date
CN108780458A (en) 2018-11-09

Similar Documents

Publication Publication Date Title
WO2019109326A1 (en) Page cache processing method and device, and server
WO2016095733A1 (en) Network data display processing method and device
US10839038B2 (en) Generating configuration information for obtaining web resources
EP3832496A1 (en) Improved proxy server caching of database content
CN102902730B (en) Based on data reading method and the device of data buffer storage
CN104516979B (en) A kind of data query method and system based on quadratic search
US9396188B2 (en) Assigning tags to digital content
US20140195893A1 (en) Method and Apparatus for Generating Webpage Content
CN102364461A (en) Web page content data acquisition method and server
US20150213484A1 (en) System and method for tracking related events
CN103916474B (en) The definite method, apparatus and system of cache-time
US20050192922A1 (en) Client-server computing system capable of validating cached data based on data transformation
CN103617222A (en) Browser and method for preloading in webpages
WO2017107568A1 (en) Cloud-side cooperation-based method for optimizing resource loading at mobile browser
CN103207882A (en) Shop visiting data processing method and system
CN105354258B (en) A kind of device and method updating website data caching
US11966448B2 (en) Instant search results
US20110066608A1 (en) Systems and methods for delivering targeted content to a user
TW201324211A (en) Real-time information acquisition method, device and system
CN100512118C (en) Distributed data management system and method for dynamically subscribing data
CN110704110A (en) A method and device for improving the response speed of a system under high concurrency
CN104704495B (en) Method and device for information search
CN106910082A (en) It is a kind of to transfer the method and apparatus that advertisement is pushed
US9208233B1 (en) Using synthetic descriptive text to rank search results
CN103460205A (en) Method and device for webpage prefetching

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17934284

Country of ref document: EP

Kind code of ref document: A1