WO2011110042A1 - Web request scheduling method and system - Google Patents

Web request scheduling method and system Download PDF

Info

Publication number
WO2011110042A1
WO2011110042A1 PCT/CN2010/079740 CN2010079740W WO2011110042A1 WO 2011110042 A1 WO2011110042 A1 WO 2011110042A1 CN 2010079740 W CN2010079740 W CN 2010079740W WO 2011110042 A1 WO2011110042 A1 WO 2011110042A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
cache
data
path information
identification code
Prior art date
Application number
PCT/CN2010/079740
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 PCT/CN2010/079740 priority Critical patent/WO2011110042A1/en
Publication of WO2011110042A1 publication Critical patent/WO2011110042A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Abstract

The present invention provides a Web request scheduling method and system. The method includes the following steps: analyzing the received Web request to obtain file path information, and transmitting the cache request carrying the file path information; obtaining the file identifier code corresponding to the file path information, obtaining and returning the cache data corresponding to the file identifier code, wherein, the correspondence between the file identifier code and the cache data is one to one. The embodiments of the present invention can improve cache utilization rate and reduce costs.

Description

Web请求调度方法及系统  Web request scheduling method and system
技术领域 Technical field
本发明涉及网络通信技术, 尤其涉及一种 Web请求调度方法及系统。 背景技术  The present invention relates to network communication technologies, and in particular, to a web request scheduling method and system. Background technique
在复杂的网络系统中, 可以由多台服务器提供万维网 (Web )服务, 每 台服务器可能具有不同的功能定位,例如緩存服务器、 负载均衡服务器、 Web 服务器、 数据库服务器等。 通过抽象, Web请求在服务器端将经过若干转发 单元的转发, 最终由处理单元处理。 在转发单元和 /或处理单元中可能存有緩 存数据以提高访问速度。  In a complex network system, a web service can be provided by multiple servers, and each server may have different functional positioning, such as a cache server, a load balancing server, a web server, a database server, and the like. Through abstraction, the Web request will be forwarded by the forwarding unit on the server side, and finally processed by the processing unit. Cache data may be stored in the forwarding unit and/or processing unit to increase access speed.
基于现有方案, 在緩存时是依据统一资源定位符 (Uniform Resource Locator, URL )緩存对应的数据, 当同样的两套网站系统部署在分布式 Web 环境中, 且访问 URL不同, 会造成对这两套同样的系统在同一个转发单元或 者处理单元上会緩存两份实际上相同的数据。 而从全系统角度观察, 对于同 一个 URL请求, 由于转发单元在处理算法上的选择还可能造成同一个 URL (或者不同 URL但是请求文件的实际内容一致)的请求被转发至不同的转发 单元或处理单元上,  Based on the existing solution, when the cache is based on the Uniform Resource Locator (URL) cache corresponding data, when the same two sets of website systems are deployed in the distributed Web environment, and the access URL is different, this will result in Two identical systems will cache two copies of virtually identical data on the same forwarding unit or processing unit. From a system-wide perspective, for the same URL request, the request of the forwarding unit in the processing algorithm may also cause the same URL (or different URL but the actual content of the request file is consistent) to be forwarded to different forwarding units or On the processing unit,
相同的緩存数据。 发明内容 The same cached data. Summary of the invention
本发明实施例是提供一种 Web请求调度方法及系统, 用以解决现有技术 中存在的请求实质内容相同的 Web请求对应多份相同数据引起的资源浪费问 题, 实现提高緩存利用率, 降低 Web服务环境的成本。  The embodiment of the present invention provides a web request scheduling method and system, which are used to solve the problem of resource waste caused by multiple identical requests of the same web request in the prior art, thereby improving cache utilization and reducing the web. The cost of the service environment.
本发明实施例提供了一种 Web请求调度方法, 包括:  The embodiment of the invention provides a web request scheduling method, which includes:
解析接收的 Web请求获取文件路径信息, 并发送緩存请求, 携带所述文 件路径信息; Parsing the received web request to obtain file path information, and sending a cache request, carrying the text Piece path information;
获取与所述文件路径信息对应的文件标识码, 获取并返回与所述文件标 识码对应的緩存数据, 其中, 文件标识码与緩存数据为——对应关系。  Obtaining a file identification code corresponding to the file path information, and obtaining and returning cache data corresponding to the file identification code, where the file identification code and the cache data are corresponding to each other.
本发明实施例提供了一种 Web请求调度系统, 包括:  The embodiment of the invention provides a web request scheduling system, including:
请求处理模块, 用于解析接收的 Web请求获取文件路径信息, 并发送緩 存请求, 携带所述文件路径信息;  a request processing module, configured to parse the received web request to obtain file path information, and send a cache request, and carry the file path information;
本地緩存模块, 用于获取与所述文件路径信息对应的文件标识码, 获取 并返回与所述文件标识码对应的緩存数据, 其中, 文件标识码与緩存数据为 ——对应关系。  The local cache module is configured to obtain a file identifier corresponding to the file path information, obtain and return cache data corresponding to the file identifier, where the file identifier and the cache data are corresponding relationships.
由上述技术方案可知, 本发明实施例的 Web请求调度方法及系统, 通过 每个文件标识码对应唯一的緩存数据, 可以使得请求实质内容相同的 Web请 求对应同一份緩存数据,可以提升緩存的利用率、降低 Web服务环境的成本。 附图说明  According to the above technical solution, the web request scheduling method and system according to the embodiment of the present invention can make the web request requesting the same content corresponding to the same cache data by using the unique cache data corresponding to each file identification code, thereby improving the utilization of the cache. Rate and reduce the cost of the Web services environment. DRAWINGS
为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例描述中 所需要使用的附图作一简单地介绍, 显而易见地, 下面描述中的附图是本发 明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动性的 前提下, 还可以根据这些附图获得其他的附图。  In order to more clearly illustrate the technical solutions in the embodiments of the present invention, a brief description of the drawings to be used in the description of the embodiments will be briefly made. It is obvious that the drawings in the following description are some embodiments of the present invention. It will be apparent to those skilled in the art that other drawings may be obtained from these drawings without the inventive labor.
图 1为本发明第一实施例的方法流程示意图;  1 is a schematic flow chart of a method according to a first embodiment of the present invention;
图 2为本发明实施例对应的系统架构图一;  2 is a first structural diagram of a system according to an embodiment of the present invention;
图 3为本发明实施例中共享緩存单元的结构示意图一;  3 is a schematic structural diagram 1 of a shared cache unit according to an embodiment of the present invention;
图 4为本发明实施例对应的系统架构图二;  4 is a second structural diagram of a system according to an embodiment of the present invention;
图 5为本发明实施例中共享緩存单元的结构示意图二;  FIG. 5 is a schematic structural diagram 2 of a shared cache unit according to an embodiment of the present invention;
图 6为本发明第二实施例的方法流程示意图;  6 is a schematic flow chart of a method according to a second embodiment of the present invention;
图 7为本发明第三实施例的方法流程示意图;  7 is a schematic flow chart of a method according to a third embodiment of the present invention;
图 8为本发明第四实施例的方法流程示意图; 图 9为本发明实施例中共享緩存单元的内部流程一的示意图; 图 10为本发明实施例中共享緩存单元的内部流程二的示意图; FIG. 8 is a schematic flowchart of a method according to a fourth embodiment of the present invention; FIG. FIG. 9 is a schematic diagram of an internal flow 1 of a shared cache unit according to an embodiment of the present invention; FIG. 10 is a schematic diagram of an internal flow 2 of a shared cache unit according to an embodiment of the present invention;
图 11为本发明实施例中共享緩存单元的内部流程三的示意图;  FIG. 11 is a schematic diagram of an internal process 3 of a shared cache unit according to an embodiment of the present invention;
图 12为本发明实施例中共享緩存单元的内部流程四的示意图;  FIG. 12 is a schematic diagram of an internal process 4 of a shared cache unit according to an embodiment of the present invention;
图 13为本发明实施例中共享緩存单元的内部流程五的示意图;  13 is a schematic diagram of an internal process 5 of a shared cache unit according to an embodiment of the present invention;
图 14为本发明实施例中共享緩存单元的内部流程六的示意图;  14 is a schematic diagram of an internal process 6 of a shared cache unit according to an embodiment of the present invention;
图 15为本发明实施例中緩存数据、 文件路径信息、 文件标识码的对应关 系示意图。 具体实施方式  FIG. 15 is a schematic diagram of correspondence between cache data, file path information, and file identification code according to an embodiment of the present invention. detailed description
为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本发 明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于 本发明中的实施例, 本领域普通技术人员在没有做出创造性劳动前提下所获 得的所有其他实施例, 都属于本发明保护的范围。  The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
图 1为本发明第一实施例的方法流程示意图, 包括:  FIG. 1 is a schematic flowchart of a method according to a first embodiment of the present invention, including:
步骤 11 : Web请求调度系统解析接收的 Web请求获取文件路径信息, 并发送緩存请求, 携带所述文件路径信息;  Step 11: The web request scheduling system parses the received web request to obtain file path information, and sends a cache request to carry the file path information.
步骤 12: Web请求调度系统获取与所述文件路径信息对应的文件标识码, 获取并返回与所述文件标识码对应的緩存数据, 其中, 文件标识码与緩存数 据为——对应关系。  Step 12: The web request scheduling system acquires a file identification code corresponding to the file path information, and obtains and returns cache data corresponding to the file identification code, where the file identification code and the cache data are in a corresponding relationship.
本实施例通过每个文件标识码对应唯一的緩存数据, 可以使得请求实质 内容相同的 Web请求对应同一份緩存数据, 可以提升緩存的利用率、 降低 Web Λ良务环境的成本。  In this embodiment, each file identifier code corresponding to the unique cache data can make the request for the same web content corresponding to the same cache data, which can improve the cache utilization rate and reduce the cost of the Web service environment.
图 2为本发明实施例对应的系统架构图一, 包括转发单元 /处理单元 21、 文件元数据存储单元 22、 共享緩存单元 23和文件系统 24, 转发单元 /处理单 元 21包括请求处理模块 211和本地緩存模块 212。 请求处理模块 211和本地 緩存模块 212之间的接口为 H2接口, 本地緩存模块 212与文件元数据存储 单元 22之间的接口为 F1接口,本地緩存模块 212与共享緩存单元 23之间的 接口为 T1接口, 共享緩存单元 23与文件系统 24之间的接口为 F2接口, 文 件元数据存储单元 22与共享緩存单元 23之间的接口为 F1接口。 2 is a system architecture diagram corresponding to an embodiment of the present invention, including a forwarding unit/processing unit 21, a file metadata storage unit 22, a shared cache unit 23, and a file system 24, and a forwarding unit/processing list. The element 21 includes a request processing module 211 and a local cache module 212. The interface between the request processing module 211 and the local cache module 212 is an H2 interface, the interface between the local cache module 212 and the file metadata storage unit 22 is an F1 interface, and the interface between the local cache module 212 and the shared cache unit 23 is On the T1 interface, the interface between the shared cache unit 23 and the file system 24 is an F2 interface, and the interface between the file metadata storage unit 22 and the shared cache unit 23 is an F1 interface.
其中, 请求处理模块 211主要负责 Web请求的解析, 例如, 解析 URL、 请求头等。解析之后通过 H2接口来请求查询该 Web请求是否对应緩存数据, 緩存数据可以为对应的文件、 脚本文件的字节码或者脚本文件解析后的内存 数据。 其中, 脚本是指使用脚本编程语言编写的程序, 如 PHP、 Ruby等程序 语言编写的程序。  The request processing module 211 is mainly responsible for parsing the web request, for example, parsing the URL, requesting the header, and the like. After parsing, the H2 interface is used to request whether the web request corresponds to the cached data, and the cached data may be the corresponding file, the bytecode of the script file, or the memory data parsed by the script file. Among them, a script is a program written in a scripting language, such as a program written in a programming language such as PHP or Ruby.
本地緩存模块 212是緩存数据查找的引擎,现有技术中本地緩存模块 212 中保存的是文件路径信息与緩存数据的对应关系, 例如, URL与緩存数据的 对应关系, 通过该对应关系及 URL可以查询获取对应的緩存数据。 本发明实 施例中, 本地緩存模块 212还需要保存文件标识码与緩存数据的对应关系, 文件标识码可以唯一代表文件内容, 例如文件的 md5值。 并且, 本发明实施 例中, 每个文件标识码只对应一份緩存数据。  The local cache module 212 is an engine for caching data search. The local cache module 212 stores the correspondence between the file path information and the cache data, for example, the correspondence between the URL and the cache data, and the corresponding relationship and the URL may be used. The query obtains the corresponding cached data. In the embodiment of the present invention, the local cache module 212 also needs to save the correspondence between the file identification code and the cached data, and the file identification code can uniquely represent the file content, such as the md5 value of the file. Moreover, in the embodiment of the present invention, each file identification code only corresponds to one cache data.
请求处理模块 211和本地緩存模块 212之间可以通过内部接口 H2进行 通信, 例如, 请求处理模块 211接收到 Web请求后, 向本地緩存模块 212发 送緩存请求, 携带文件路径信息和緩存类型, 緩存类型是指请求的緩存数据 为文件緩存还是脚本緩存, 如果本地緩存模块 212中有对应的緩存数据, 则 可以通过 H2接口返回给请求处理模块 211 ;如果本地緩存模块 212中没有对 应的緩存数据, 则可以通过 T1接口从共享緩存单元 23中获取緩存数据并返 回给请求处理模块 211 , T1接口可以为远程通信接口。  The request processing module 211 and the local cache module 212 can communicate with each other through the internal interface H2. For example, after receiving the web request, the request processing module 211 sends a cache request to the local cache module 212, carrying the file path information and the cache type, and the cache type. If the cached data of the request is a file cache or a script cache, if there is corresponding cache data in the local cache module 212, it can be returned to the request processing module 211 through the H2 interface; if there is no corresponding cache data in the local cache module 212, The cache data can be obtained from the shared cache unit 23 through the T1 interface and returned to the request processing module 211, which can be a remote communication interface.
文件元数据存储单元 22是指存储所有 Web应用文件元数据的存储单元, 元数据存储单元中的元数据需要包含文件的信息, 文件的信息包括但不限于 文件标识码、 文件路径信息。 文件标识码可以唯一标识一份文件, 如文件的 md5值。文件元数据存储单元 22可以通过 F1接口对外开放元数据查询接口。 使用 F1接口可以通过文件路径信息及文件元数据存储单元 22中保存的文件 路径信息与文件元数据的对应关系查询到文件标识码。 The file metadata storage unit 22 refers to a storage unit that stores metadata of all the web application files. The metadata in the metadata storage unit needs to include information of the file, and the information of the file includes but is not limited to the file identification code and the file path information. The file identification code can uniquely identify a file, such as a file Md5 value. The file metadata storage unit 22 can open the metadata query interface to the outside through the F1 interface. Using the F1 interface, the file identification code can be queried by the file path information and the correspondence between the file path information and the file metadata stored in the file metadata storage unit 22.
共享緩存单元 23独立于转发单元 /处理单元 21来提供共享的緩存存储, 并通过 T1接口对外开放緩存查询。 当接收到緩存查询请求时,如果共享緩存 单元 23上不存在緩存数据,共享緩存单元 23可以通过 F2接口从文件系统读 取数据; 对于脚本緩存, 可以在文件系统中获取脚本文件后再经过编译得到 脚本緩存。共享緩存单元 23提供通过文件路径信息或者文件标识码的方式来 查询緩存数据, 可以提供文件緩存、 字节码緩存或者脚本编译后的内存结构 緩存。  The shared cache unit 23 provides shared cache storage independently of the forwarding unit/processing unit 21, and opens the cache query through the T1 interface. When receiving the cache query request, if there is no cache data on the shared cache unit 23, the shared cache unit 23 can read data from the file system through the F2 interface; for the script cache, the script file can be obtained in the file system and then compiled. Get the script cache. The shared cache unit 23 provides a way to query the cached data by means of file path information or a file identification code, and can provide a file cache, a bytecode cache, or a cached memory structure cache.
图 3为本发明实施例中共享緩存单元的结构示意图一, 包括文件緩存模 块 31、 脚本緩存模块 32和脚本引擎模块 33。 在共享緩存单元中, 可以将图 2所示的 T1接口分解为 T1.1和 T1.2两种接口, T1.1接口对应文件緩存读取 请求, T 1.2接口对应脚本緩存读取请求。 当然, T 1.1接口与 T 1.2接口也可以 合并, 通过输入参数增加获取緩存的类型, 再由内部调度模块来分别处理。  FIG. 3 is a schematic structural diagram 1 of a shared cache unit according to an embodiment of the present invention, including a file cache module 31, a script cache module 32, and a script engine module 33. In the shared cache unit, the T1 interface shown in Figure 2 can be decomposed into two interfaces: T1.1 and T1.2. The T1.1 interface corresponds to the file cache read request, and the T 1.2 interface corresponds to the script cache read request. Of course, the T 1.1 interface and the T 1.2 interface can also be combined, and the type of the cache is obtained by input parameters, and then processed by the internal scheduling module.
其中, 文件緩存模块 31负责文件类型緩存操作, 当收到文件緩存时通过 携带参数的文件路径信息或者文件标识码, 文件緩存模块会查询自身是否已 经緩存了对应的数据, 如果存在则返回存在的数据, 判断方法为: 通过文件 路径的緩存请求如果通过文件路径信息无法查询到,将通过 F1接口查询文件 标识码, 再通过文件标识码查询该文件标识码对应的数据是否緩存, 同时文 件路径信息和 /或文件标识码到緩存数据的对应关系也会被緩存, 如果通过文 件路径信息及文件标识码都不能获取緩存的数据, 则文件緩存模块 31 通过 F2接口向文件系统 24获取数据, 从文件系统 24获取的数据可以由文件緩存 模块 31緩存, 以供下次緩存查询。  The file cache module 31 is responsible for the file type cache operation. When the file cache is received, the file cache module searches for the file path information or the file identifier code. The file cache module queries whether the corresponding data has been cached, and if it exists, returns the existing data. The data is judged as follows: If the cache request through the file path cannot be queried through the file path information, the file identification code is queried through the F1 interface, and the data corresponding to the file identification code is queried by the file identification code, and the file path information is also obtained. And the corresponding relationship between the file identifier and the cached data is also cached. If the cached data cannot be obtained through the file path information and the file identifier, the file cache module 31 obtains data from the file system 24 through the F2 interface. The data acquired by system 24 can be cached by file caching module 31 for the next cached query.
脚本緩存读取请求由脚本緩存模块 32和脚本引擎模块 33共同完成处理, 脚本緩存模块 32收到脚本緩存读取请求后, 将查询自身是否存在脚本緩存。 其中, 类似于文件緩存, 脚本緩存读取请求中可以携带脚本文件的文件路径 信息或者文件标识码。 在查询緩存时, 也可以类似于文件緩存, 可以通过文 件路径信息或者文件标识码查询緩存数据, 并建立文件路径信息、 文件标识 码与緩存数据的对应关系。 如果有将返回緩存数据, 如果没有, 脚本緩存模 块 32将通过 N1请求脚本引擎模块 33读取并编译脚本文件。 脚本引擎模块 33收到 N1接口调用后, 将通过 F2接口读取脚本文件, 读取后将编译脚本文 件, 并将编译后的脚本数据返回给脚本緩存模块 32, 编译后的脚本数据可以 由脚本緩存模块 32进行緩存以供下次緩存查询。 The script cache read request is processed by the script cache module 32 and the script engine module 33. After receiving the script cache read request, the script cache module 32 will query whether there is a script cache. Similar to the file cache, the script cache read request may carry the file path information or the file identification code of the script file. When querying the cache, it can also be similar to the file cache. The cached data can be queried through the file path information or the file identification code, and the correspondence between the file path information, the file identification code, and the cached data is established. If there is any cached data to be returned, if not, the script cache module 32 will read and compile the script file through the N1 request script engine module 33. After receiving the N1 interface call, the script engine module 33 reads the script file through the F2 interface, compiles the script file after reading, and returns the compiled script data to the script cache module 32, and the compiled script data can be scripted. The cache module 32 caches for the next cached query.
图 4为本发明实施例对应的系统架构图二, 图 5为本发明实施例中共享 緩存单元的结构示意图二。 与图 2-3不同的是, 用文件标识码计算模块 41、 51替代上述的文件元数据存储单元, 文件标识码计算模块用于计算緩存数据 的文件标识码文件标识码例如为緩存数据的 MD5值。 以文件緩存为例,本地 緩存模块根据文件路径信息查询不到对应的文件緩存数据后, 则向文件系统 获取文件数据, 获取文件数据后使用文件标识码计算模块计算出文件内容的 标识码。 由文件緩存模块建立文件标识码与緩存数据以及文件路径信息与緩 存数据的对应关系。 后续请求如果发现计算出来的文件标识码已经存在緩存 模块, 则直接建立文件路径与已存在的緩存数据的关系, 而不需要再緩存一 份同样的数据。 其余模块功能与上述相同, 不再赘述。  FIG. 4 is a second structural diagram of a system according to an embodiment of the present invention. FIG. 5 is a second schematic structural diagram of a shared cache unit according to an embodiment of the present invention. Different from FIG. 2-3, the file identification code calculation module 41, 51 is used instead of the file metadata storage unit, and the file identification code calculation module is used to calculate the file identification code file identification code of the cached data, for example, the MD5 of the cached data. value. Taking the file cache as an example, after the local cache module cannot query the corresponding file cache data according to the file path information, the file data is obtained from the file system, and after the file data is obtained, the file identifier code calculation module calculates the identification code of the file content. The file identification code and the cache data and the correspondence between the file path information and the cache data are established by the file cache module. If the subsequent request finds that the calculated file identifier already exists in the cache module, the relationship between the file path and the existing cached data is directly established, and it is not necessary to cache the same data. The functions of the remaining modules are the same as above, and will not be described again.
下面将以图 2或图 3所示的结构图为例说明本发明实施例, 图 4-5所示 的结构可以参照执行。本发明实施例的具体流程可以具体参见下述各实施例。  The embodiment of the present invention will be described below by taking the structural diagram shown in Fig. 2 or Fig. 3 as an example. The structure shown in Fig. 4-5 can be referred to for execution. The specific processes of the embodiments of the present invention may be specifically referred to the following embodiments.
图 6为本发明第二实施例的方法流程示意图, 本实施例以本地存在文件 路径信息对应的文件緩存数据为例。 参见图 6, 本实施例包括:  FIG. 6 is a schematic flowchart of a method according to a second embodiment of the present invention. In this embodiment, file cache data corresponding to file path information locally exists as an example. Referring to Figure 6, this embodiment includes:
步骤 601: 请求处理模块接收 Web请求。  Step 601: The request processing module receives the web request.
步骤 602: 请求处理模块对 Web请求进行解析, 获取对应的文件路径信 息, 并向本地緩存模块发送緩存请求, 携带文件路径信息。 步骤 603 : 本地緩存模块以文件路径信息查询本地是否存在文件緩存数 据。 Step 602: The request processing module parses the web request, obtains corresponding file path information, and sends a cache request to the local cache module to carry the file path information. Step 603: The local cache module queries, by using the file path information, whether the file cache data exists locally.
步骤 604: 如果存在对应的文件緩存数据, 本地緩存模块向请求处理模 块返回文件緩存数据。  Step 604: If there is corresponding file cache data, the local cache module returns file cache data to the request processing module.
其中, 本地緩存模块中保存文件路径信息与文件緩存数据的对应关系, 通过该对应关系, 可以查询到緩存请求中携带的文件路径信息是否存在对应 的文件緩存数据。 进一步地, 如果存在对应的文件緩存数据, 可以返回该查 询到的文件緩存数据。  The mapping between the file path information and the file cache data is saved in the local cache module. The corresponding relationship can be used to query whether the file path information carried in the cache request has corresponding file cache data. Further, if there is corresponding file cache data, the file cache data of the query can be returned.
图 7为本发明第三实施例的方法流程示意图, 本实施例以本地不存在文 件路径信息对应的文件緩存数据, 但存在文件标识码对应的文件緩存数据为 例。 参见图 7, 本实施例包括:  FIG. 7 is a schematic flowchart of a method according to a third embodiment of the present invention. In this embodiment, the file cache data corresponding to the file path information does not exist locally, but the file cache data corresponding to the file identifier code is used as an example. Referring to Figure 7, this embodiment includes:
步骤 701: 请求处理模块接收 Web请求。  Step 701: The request processing module receives the web request.
步骤 702: 请求处理模块对 Web请求进行解析, 获取对应的文件路径信 息, 并向本地緩存模块发送緩存请求, 携带文件路径信息。  Step 702: The request processing module parses the web request, obtains corresponding file path information, and sends a cache request to the local cache module to carry the file path information.
步骤 703 : 本地緩存模块以文件路径信息查询本地是否存在文件緩存数 据。  Step 703: The local cache module queries the local file cache data by using the file path information.
步骤 704: 如果不存在对应的文件緩存数据, 本地緩存模块向文件元数 据存储单元发送查询文件标识码请求, 携带文件路径信息。  Step 704: If there is no corresponding file cache data, the local cache module sends a query file identifier request to the file metadata storage unit, and carries the file path information.
步骤 705: 文件元数据存储单元向本地緩存模块返回文件标识码。  Step 705: The file metadata storage unit returns a file identification code to the local cache module.
其中, 文件元数据存储单元中保存文件路径信息与文件标识码的对应关 系, 通过该对应关系, 可以查询到与查询文件标识码请求中携带的文件路径 信息对应的文件标识码。  The file metadata storage unit stores a correspondence between the file path information and the file identification code, and the file identification code corresponding to the file path information carried in the query file identification code request can be queried by the corresponding relationship.
步骤 706: 本地緩存模块以文件标识码查询本地是否存在文件緩存数据。 步骤 707: 如果存在对应的文件緩存数据, 本地緩存模块建立文件路径 信息与文件緩存数据的对应关系。  Step 706: The local cache module queries, by using a file identifier, whether file cache data exists locally. Step 707: If there is corresponding file cache data, the local cache module establishes a correspondence between the file path information and the file cache data.
步骤 708: 本地緩存模块向请求处理模块返回文件緩存数据。 本地緩存模块中保存文件标识码与文件緩存数据的对应关系, 通过该对 应关系, 可以查询到文件标识码是否存在对应的文件緩存数据。 进一步地, 如果存在对应的文件緩存数据, 可以返回给文件緩存数据。 并且, 为了下次 可以较快的获取文件緩存数据, 还可以通过文件标识码建立文件路径信息与 文件緩存数据的对应关系。 Step 708: The local cache module returns file cache data to the request processing module. The corresponding relationship between the file identifier and the file cache data is saved in the local cache module. The corresponding relationship can be used to query whether the file identifier has corresponding file cache data. Further, if there is corresponding file cache data, it can be returned to the file cache data. Moreover, in order to obtain the file cache data faster, the correspondence between the file path information and the file cache data may also be established by using the file identifier.
图 8为本发明第四实施例的方法流程示意图, 本实施例以本地不存在文 件路径信息对应的文件緩存数据, 也不存在文件标识码对应的文件緩存数据 为例。 参见图 8, 本实施例包括:  FIG. 8 is a schematic flowchart of a method according to a fourth embodiment of the present invention. In this embodiment, file cache data corresponding to file path information does not exist locally, and file cache data corresponding to the file identifier code does not exist as an example. Referring to Figure 8, this embodiment includes:
步骤 801: 请求处理模块接收 Web请求。  Step 801: The request processing module receives the web request.
步骤 802: 请求处理模块对 Web请求进行解析, 获取对应的文件路径信 息, 并向本地緩存模块发送緩存请求, 携带文件路径信息。  Step 802: The request processing module parses the web request, obtains corresponding file path information, and sends a cache request to the local cache module to carry the file path information.
步骤 803 : 本地緩存模块以文件路径信息查询本地是否存在文件緩存数 据。  Step 803: The local cache module queries the local file cache data by using the file path information.
步骤 804: 如果不存在对应的文件緩存数据, 本地緩存模块向文件元数 据存储单元发送查询文件标识码请求, 携带文件路径信息。  Step 804: If the corresponding file cache data does not exist, the local cache module sends a query file identifier request to the file metadata storage unit, and carries the file path information.
步骤 805: 文件元数据存储单元箱本地緩存模块返回文件标识码。  Step 805: The file metadata storage unit box local cache module returns a file identification code.
其中, 文件元数据存储单元中保存文件路径信息与文件标识码的对应关 系, 通过该对应关系, 可以查询到与查询文件标识码请求中携带的文件路径 信息对应的文件标识码。  The file metadata storage unit stores a correspondence between the file path information and the file identification code, and the file identification code corresponding to the file path information carried in the query file identification code request can be queried by the corresponding relationship.
步骤 806: 本地緩存模块以文件标识码查询本地是否存在文件緩存数据。 步骤 807: 如果不存在对应的文件緩存数据, 本地緩存模块向共享緩存 单元发送緩存查询请求, 携带文件路径信息或者文件标识码。  Step 806: The local cache module queries the local file cache code for the file cache data. Step 807: If there is no corresponding file cache data, the local cache module sends a cache query request to the shared cache unit, carrying the file path information or the file identifier code.
步骤 808: 共享緩存单元执行内部流程, 获取文件緩存数据。  Step 808: The shared cache unit executes an internal process to obtain file cache data.
具体可以参见图 9-15所示的实施例。  For details, refer to the embodiment shown in Figures 9-15.
步骤 809: 共享緩存单元将获取的文件緩存数据返回给本地緩存模块。 步骤 810: 本地緩存模块建立文件路径信息与文件緩存数据的对应关系 以及文件标识码与文件緩存数据的对应关系。 Step 809: The shared cache unit returns the obtained file cache data to the local cache module. Step 810: The local cache module establishes a correspondence between the file path information and the file cache data. And the correspondence between the file identification code and the file cache data.
步骤 811 : 本地緩存模块向请求处理模块返回文件緩存数据。  Step 811: The local cache module returns file cache data to the request processing module.
图 9为本发明实施例中共享緩存单元的内部流程一的示意图, 本实施例 以获取文件緩存且存在文件路径信息对应的文件緩存数据为例。 参见图 9, 本实施例包括:  FIG. 9 is a schematic diagram of an internal process 1 of a shared cache unit according to an embodiment of the present invention. In this embodiment, file cache data corresponding to file path information is obtained as an example. Referring to Figure 9, this embodiment includes:
步骤 901 : 本地緩存模块向文件緩存模块发送文件緩存读取请求, 携带 文件路径信息。  Step 901: The local cache module sends a file cache read request to the file cache module, and carries the file path information.
步骤 902: 文件緩存模块查询本地是否存在该文件路径信息对应的文件 緩存数据。  Step 902: The file cache module queries whether the file cache data corresponding to the file path information exists locally.
步骤 903 : 如果存在, 文件緩存模块将该对应的文件緩存数据返回给本 地緩存模块。  Step 903: If yes, the file caching module returns the corresponding file cache data to the local cache module.
其中, 文件緩存模块中保存文件路径信息与文件緩存数据的对应关系, 通过该对应关系, 可以查询到文件緩存读取请求中携带的文件路径信息是否 存在对应的文件緩存数据。 进一步地, 如果存在对应的文件緩存数据, 可以 返回该文件緩存数据。  The file cache module stores the correspondence between the file path information and the file cache data. The corresponding relationship can be used to query whether the file path information carried in the file cache read request has corresponding file cache data. Further, if there is corresponding file cache data, the file cache data can be returned.
图 10为本发明实施例中共享緩存单元的内部流程二的示意图,本实施例 以获取文件緩存且不存在文件路径信息对应的文件緩存数据为例。参见图 10, 本实施例包括:  FIG. 10 is a schematic diagram of an internal process 2 of a shared cache unit according to an embodiment of the present invention. In this embodiment, file cache data corresponding to file path information is obtained as an example. Referring to FIG. 10, this embodiment includes:
步骤 1001 : 本地緩存模块向文件緩存模块发送文件緩存读取请求, 携带 文件路径信息。  Step 1001: The local cache module sends a file cache read request to the file cache module, and carries the file path information.
步骤 1002: 文件緩存模块查询本地是否存在该文件路径信息对应的文件 緩存数据。  Step 1002: The file cache module queries whether the file cache data corresponding to the file path information exists locally.
步骤 1003: 如果不存在对应的文件緩存数据, 文件緩存模块向文件元数 据存储单元发送查询文件标识码请求, 携带文件路径信息。  Step 1003: If the corresponding file cache data does not exist, the file cache module sends a query file identifier request to the file metadata storage unit, and carries the file path information.
步骤 1004: 文件元数据存储单元向文件緩存模块返回文件标识码。  Step 1004: The file metadata storage unit returns a file identification code to the file cache module.
其中, 文件元数据存储单元中保存文件路径信息与文件标识码的对应关 系, 通过该对应关系, 可以查询到与查询文件标识码请求中携带的文件路径 信息对应的文件标识码。 Wherein, the file metadata storage unit stores the corresponding relationship between the file path information and the file identification code The file identification code corresponding to the file path information carried in the query file identifier code request may be queried by the corresponding relationship.
步骤 1005: 文件緩存模块查询本地是否存在与该文件标识码对应的文件 緩存数据。  Step 1005: The file caching module queries whether there is file cache data corresponding to the file identification code locally.
步骤 1006: 如果存在对应的文件緩存数据, 文件緩存模块建立文件路径 信息与文件緩存数据的对应关系。  Step 1006: If there is corresponding file cache data, the file cache module establishes a correspondence between the file path information and the file cache data.
步骤 1007: 文件緩存模块向本地緩存模块返回文件緩存数据。  Step 1007: The file cache module returns file cache data to the local cache module.
文件緩存模块中保存文件标识码与文件緩存数据的对应关系, 通过该对 应关系, 可以查询到文件标识码是否存在对应的文件緩存数据。 进一步地, 如果存在对应的文件緩存数据, 可以返回给文件緩存数据。 并且, 为了下次 可以较快的获取文件緩存数据, 还可以通过文件标识码建立文件路径信息与 文件緩存数据的对应关系。  The file cache module stores a correspondence between the file identifier code and the file cache data. Through the corresponding relationship, the file identifier code can be queried for the corresponding file cache data. Further, if there is corresponding file cache data, it can be returned to the file cache data. Moreover, in order to obtain the file cache data faster, the correspondence between the file path information and the file cache data may be established by using the file identification code.
图 11为本发明实施例中共享緩存单元的内部流程三的示意图,本实施例 以获取文件緩存且不存在文件路径信息对应的文件緩存数据以及不存在文件 标识码对应的文件緩存数据为例。 参见图 11 , 本实施例包括:  FIG. 11 is a schematic diagram of the internal process 3 of the shared cache unit in the embodiment of the present invention. In this embodiment, the file cache data corresponding to the file path information and the file cache data corresponding to the file identifier code are not present. Referring to FIG. 11, this embodiment includes:
步骤 1101 : 本地緩存模块向文件緩存模块发送文件緩存读取请求, 携带 文件路径信息。  Step 1101: The local cache module sends a file cache read request to the file cache module, and carries the file path information.
步骤 1102: 文件緩存模块查询本地是否存在该文件路径信息对应的文件 緩存数据。  Step 1102: The file cache module queries whether the file cache data corresponding to the file path information exists locally.
步骤 1103: 如果不存在对应的文件緩存数据, 文件緩存模块向文件元数 据存储单元发送查询文件标识码请求, 携带文件路径信息。  Step 1103: If the corresponding file cache data does not exist, the file cache module sends a query file identifier code request to the file metadata storage unit, and carries the file path information.
步骤 1104: 文件元数据存储单元向文件緩存模块返回文件标识码。  Step 1104: The file metadata storage unit returns a file identification code to the file cache module.
其中, 文件元数据存储单元中保存文件路径信息与文件标识码的对应关 系, 通过该对应关系, 可以查询到与查询文件标识码请求中携带的文件路径 信息对应的文件标识码。  The file metadata storage unit stores a correspondence between the file path information and the file identification code, and the file identification code corresponding to the file path information carried in the query file identification code request can be queried by the corresponding relationship.
步骤 1105:文件緩存模块以文件标识码查询本地是否存在文件緩存数据。 步骤 1106: 如果不存在对应的文件緩存数据, 文件緩存模块向文件系统 发送读取文件数据请求, 携带文件标识码。 Step 1105: The file cache module queries, by using the file identifier code, whether file cache data exists locally. Step 1106: If the corresponding file cache data does not exist, the file cache module sends a read file data request to the file system, and carries the file identifier code.
步骤 1107: 文件系统向文件緩存模块返回与该文件标识码对应的文件数 据。  Step 1107: The file system returns file data corresponding to the file identification code to the file cache module.
或者文件緩存模块向文件系统发送的读取文件数据请求中携带文件路径 信息, 文件系统根据文件路径信息获取对应的文件数据。  Or the file cache module carries the file path information in the read file data request sent by the file system, and the file system obtains the corresponding file data according to the file path information.
步骤 1108: 文件緩存模块緩存文件系统返回的文件数据, 建立文件路径 信息与文件緩存数据的对应关系以及文件标识码与文件緩存数据的对应关 系。  Step 1108: The file cache module caches the file data returned by the file system, establishes a correspondence between the file path information and the file cache data, and a correspondence between the file identification code and the file cache data.
步骤 1109: 文件緩存模块向本地緩存模块返回文件緩存数据。  Step 1109: The file caching module returns file cache data to the local cache module.
图 9-11所示的实施例共享緩存的内部流程的示意,并不限于上述实施例, 也可以是, 在本地緩存模块向文件緩存模块发送的文件緩存读取请求中既携 带文件路径信息, 也携带文件标识码, 此时, 对应的步骤 1003-1004无需再 执行, 直接根据该携带的文件标识码查询是否存在文件緩存数据。 另外, 也 可以是上述的文件緩存读取请求中携带文件标识码,而不携带文件路径信息, 此时步骤 902、 903、 步骤 1002-1004以及步骤 1102-1104无需执行, 直接根 据查询该携带的文件标识码是否存在文件緩存数据。  The schematic diagram of the internal flow of the shared cache in the embodiment shown in FIG. 9-11 is not limited to the foregoing embodiment, and the file cache information may be carried in the file cache read request sent by the local cache module to the file cache module. The file identifier code is also carried. In this case, the corresponding step 1003-1004 does not need to be executed, and the file cache code is directly queried according to the carried file identifier code. In addition, the file identifier reading request carries the file identifier code, and does not carry the file path information. In this case, steps 902, 903, steps 1002-1004, and steps 1102-1104 do not need to be performed, and are directly carried according to the query. Whether the file identifier has file cache data.
上述是以文件緩存为例, 对应的緩存数据为文件緩存数据, 下面将以脚 本緩存为例, 对应的緩存数据为脚本緩存数据。  The above is the file cache as an example. The corresponding cache data is file cache data. The following takes the script cache as an example, and the corresponding cache data is the script cache data.
图 12为本发明实施例中共享緩存单元的内部流程四的示意图,本实施例 以获取脚本緩存且存在文件路径信息对应的脚本緩存数据为例。 参见图 12, 本实施例包括:  FIG. 12 is a schematic diagram of the internal flow of the shared cache unit in the embodiment of the present invention. This example takes the script cache data corresponding to the file path information and the file cache information as an example. Referring to FIG. 12, this embodiment includes:
步骤 1201 : 本地緩存模块向脚本緩存模块发送脚本緩存读取请求, 携带 文件路径信息。  Step 1201: The local cache module sends a script cache read request to the script cache module, and carries file path information.
步骤 1202: 脚本緩存模块查询本地是否存在该文件路径信息对应的脚本 緩存数据。 步骤 1203: 如果存在, 脚本緩存模块将该对应的脚本緩存数据返回给本 地緩存模块。 Step 1202: The script cache module queries whether the script cache data corresponding to the file path information exists locally. Step 1203: If yes, the script cache module returns the corresponding script cache data to the local cache module.
其中, 脚本緩存模块中保存文件路径信息与脚本緩存数据的对应关系, 通过该对应关系, 可以查询到文件緩存读取请求中携带的文件路径信息是否 存在对应的脚本緩存数据。 进一步地, 如果存在对应的脚本緩存数据, 可以 返回该脚本緩存数据。  The corresponding relationship between the file path information and the script cache data is saved in the script cache module. The corresponding relationship can be used to query whether the file path information carried in the file cache read request has corresponding script cache data. Further, if there is a corresponding script cache data, the script cache data can be returned.
图 13为本发明实施例中共享緩存单元的内部流程五的示意图,本实施例 以获取脚本緩存且不存在文件路径信息对应的脚本緩存数据为例。参见图 13 , 本实施例包括:  FIG. 13 is a schematic diagram of an internal process 5 of a shared cache unit according to an embodiment of the present invention. This example takes the script cache data corresponding to the file path information and the file path information as an example. Referring to Figure 13, this embodiment includes:
步骤 1301 : 本地緩存模块向脚本緩存模块发送脚本緩存读取请求, 携带 文件路径信息。  Step 1301: The local cache module sends a script cache read request to the script cache module to carry file path information.
步骤 1302: 脚本緩存模块查询本地是否存在该文件路径信息对应的脚本 緩存数据。  Step 1302: The script cache module queries whether the script cache data corresponding to the file path information exists locally.
步骤 1303: 如果不存在对应的脚本緩存数据, 脚本緩存模块向文件元数 据存储单元发送查询文件标识码请求, 携带文件路径信息。  Step 1303: If the corresponding script cache data does not exist, the script cache module sends a query file identifier request to the file metadata storage unit, and carries the file path information.
步骤 1304: 文件元数据存储单元向脚本緩存模块返回文件标识码。  Step 1304: The file metadata storage unit returns a file identification code to the script cache module.
其中, 文件元数据存储单元中保存文件路径信息与文件标识码的对应关 系, 通过该对应关系, 可以查询到与查询文件标识码请求中携带的文件路径 信息对应的文件标识码。  The file metadata storage unit stores a correspondence between the file path information and the file identification code, and the file identification code corresponding to the file path information carried in the query file identification code request can be queried by the corresponding relationship.
步骤 1305:脚本緩存模块以文件标识码查询本地是否存在脚本緩存数据。 步骤 1306: 如果存在对应的脚本緩存数据, 脚本緩存模块建立文件路径 信息与脚本緩存数据的对应关系。  Step 1305: The script cache module queries, by using the file identifier, whether the script cache data exists locally. Step 1306: If there is a corresponding script cache data, the script cache module establishes a correspondence between the file path information and the script cache data.
步骤 1307: 脚本緩存模块向本地緩存模块返回脚本緩存数据。  Step 1307: The script cache module returns the script cache data to the local cache module.
脚本緩存模块中保存文件标识码与脚本緩存数据的对应关系, 通过该对 应关系, 可以查询到文件标识码是否存在对应的脚本緩存数据。 进一步地, 如果存在对应的脚本緩存数据, 可以返回给脚本緩存数据。 并且, 为了下次 可以较快的获取脚本緩存数据, 还可以通过文件标识码建立文件路径信息与 脚本緩存数据的对应关系。 The corresponding relationship between the file identifier and the script cache data is saved in the script cache module. The corresponding relationship can be used to query whether the file identifier has the corresponding script cache data. Further, if there is a corresponding script cache data, it can be returned to the script cache data. And, for the next time The script cache data can be obtained relatively quickly, and the correspondence between the file path information and the script cache data can also be established through the file identification code.
图 14为本发明实施例中共享緩存单元的内部流程六的示意图,本实施例 以获取脚本緩存且不存在文件路径信息对应的脚本緩存数据以及不存在文件 标识码对应的脚本緩存数据为例。 参见图 14, 本实施例包括:  FIG. 14 is a schematic diagram of the internal flow of the shared cache unit in the embodiment of the present invention. In this embodiment, the script cache data corresponding to the file path information and the script cache data corresponding to the file identifier code are not present. Referring to Figure 14, this embodiment includes:
步骤 1401 : 本地緩存模块向脚本緩存模块发送脚本緩存读取请求, 携带 文件路径信息。  Step 1401: The local cache module sends a script cache read request to the script cache module, and carries the file path information.
步骤 1402: 脚本緩存模块查询本地是否存在该文件路径信息对应的脚本 緩存数据。  Step 1402: The script cache module queries whether the script cache data corresponding to the file path information exists locally.
步骤 1403: 如果不存在对应的脚本緩存数据, 脚本緩存模块向文件元数 据存储单元发送查询文件标识码请求, 携带文件路径信息。  Step 1403: If the corresponding script cache data does not exist, the script cache module sends a query file identifier code request to the file metadata storage unit, and carries the file path information.
步骤 1404: 文件元数据存储单元向脚本緩存模块返回文件标识码。  Step 1404: The file metadata storage unit returns a file identification code to the script cache module.
其中, 文件元数据存储单元中保存文件路径信息与文件标识码的对应关 系, 通过该对应关系, 可以查询到与查询文件标识码请求中携带的文件路径 信息对应的文件标识码。  The file metadata storage unit stores a correspondence between the file path information and the file identification code, and the file identification code corresponding to the file path information carried in the query file identification code request can be queried by the corresponding relationship.
步骤 1405:脚本緩存模块以文件标识码查询本地是否存在脚本緩存数据。 步骤 1406: 如果不存在对应的脚本緩存数据, 脚本緩存模块向脚本引擎 模块发送编译请求, 携带文件路径信息。  Step 1405: The script cache module queries, by using the file identifier, whether the script cache data exists locally. Step 1406: If the corresponding script cache data does not exist, the script cache module sends a compile request to the script engine module to carry the file path information.
步骤 1407: 脚本引擎模块向文件系统发送读取脚本数据请求, 携带与文 件路径信息对应的文件标识码。  Step 1407: The script engine module sends a read script data request to the file system, and carries a file identifier code corresponding to the file path information.
步骤 1408: 文件系统向脚本引擎模块返回脚本数据。  Step 1408: The file system returns script data to the script engine module.
步骤 1409: 脚本引擎模块对该脚本数据进行编译。  Step 1409: The script engine module compiles the script data.
编译是指将脚本数据转化为字节码数据或者脚本文件解析后的可以代表 脚本执行的内存结构数据。  Compilation refers to the conversion of script data into bytecode data or memory structure data that can be represented by a script after parsing the script file.
步骤 1410: 脚本引擎模块向脚本緩存模块返回编译后的脚本数据。  Step 1410: The script engine module returns the compiled script data to the script cache module.
步骤 1411 : 脚本緩存模块緩存编译后的脚本数据, 建立文件路径信息与 脚本緩存数据的对应关系以及文件标识码与脚本緩存数据的对应关系。 Step 1411: The script cache module caches the compiled script data, and establishes file path information and The correspondence between the script cache data and the correspondence between the file identifier and the script cache data.
步骤 1412: 脚本緩存模块向本地緩存模块返回脚本緩存数据。  Step 1412: The script cache module returns the script cache data to the local cache module.
图 12-14所示的实施例共享緩存的内部流程的示意, 并不限于上述实施 例, 也可以是, 在本地緩存模块向文件緩存模块发送的脚本緩存读取请求中 既携带文件路径信息, 也携带文件标识码, 此时, 对应的步骤 1303-1304无 需再执行, 直接根据该携带的文件标识码查询是否存在脚本緩存数据。 另夕卜, 也可以是上述的文件緩存读取请求中携带文件标识码, 而不携带文件路径信 息, 此时步骤 1202、 1203、 步骤 1302-1304以及步骤 1402-1404无需执行, 直接根据查询该携带的文件标识码是否存在脚本緩存数据。  The schematic diagram of the internal flow of the shared cache in the embodiment shown in FIG. 12-14 is not limited to the foregoing embodiment, and the file cache information may be carried in the script cache read request sent by the local cache module to the file cache module. The file identifier code is also carried. In this case, the corresponding step 1303-1304 does not need to be executed, and the file cache code is directly queried according to the carried file identifier code. In addition, the file cache read request carries the file identifier code, and does not carry the file path information. In this case, steps 1202, 1203, steps 1302-1304, and steps 1402-1404 need not be performed, directly according to the query. Whether the file identifier code is carried in the script cache data.
在上述各流程中, 緩存数据、 文件路径、 文件标识码的对应关系可以参 见图 15 , 图 15为本发明实施例中緩存数据、 文件路径信息、 文件标识码的 对应关系示意图, 参见图 15 , 假设緩存数据为 datal、 data2... dataN , 文件路 径信息为 urll、 url2...urlN, 文件标识码为 keyl、 key2...keyN。 其中该对应关 系可以通过 hash算法或者其他算法进行查找获取。 其中, 文件标识码与緩存 数据是——对应关系, 例如 keyl对应 data3 , key3对应 data3; 緩存数据与文 件路径信息可以为一对多或者多对一或者——对应关系, 例如, urll 和 url2 均对应 data3。  For the corresponding relationship between the cache data, the file path, and the file identifier, refer to FIG. 15. FIG. 15 is a schematic diagram of correspondence between cache data, file path information, and file identification code according to an embodiment of the present invention. Suppose the cache data is datal, data2...dataN, the file path information is urll, url2...urlN, and the file identifier is keyl, key2...keyN. The corresponding relationship can be obtained by using a hash algorithm or other algorithms. The file identification code and the cache data are-corresponding relationships, for example, key1 corresponds to data3, and key3 corresponds to data3; cache data and file path information may be one-to-many or many-to-one or-correspondence, for example, urll and url2 Corresponds to data3.
可以理解的是, 上述方法及设备中的相关特征可以相互参考。 另外, 上 述实施例中的 "第一" 、 "第二" 等是用于区分各实施例, 而并不代表各实 施例的 ύ劣。  It can be understood that related features in the above methods and devices can be referred to each other. In addition, "first", "second", and the like in the above embodiments are used to distinguish the embodiments, and do not represent the disadvantages of the embodiments.
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分步骤 可以通过程序指令相关的硬件来完成, 前述的程序可以存储于计算机可读取 存储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述的 存储介质包括: ROM, RAM,磁碟或者光盘等各种可以存储程序代码的介质。  A person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to program instructions. The foregoing program may be stored in a computer readable storage medium, and when executed, the program includes The foregoing steps of the method embodiment; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对其 限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通技术 人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修改, 或 者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不使相应技 术方案的本质脱离本发明各实施例技术方案的精神和范围。 Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, and are not intended to be limiting thereof; although the present invention has been described in detail with reference to the foregoing embodiments, It should be understood that: the technical solutions described in the foregoing embodiments may be modified, or some of the technical features may be equivalently replaced; and the modifications or substitutions do not deviate from the essence of the corresponding technical solutions. The spirit and scope of the technical programme.

Claims

权 利 要 求 Rights request
1、 一种 Web请求调度方法, 其特征在于, 包括:  A web request scheduling method, comprising:
解析接收的 Web请求获取文件路径信息, 并发送緩存请求, 携带所述文 件路径信息;  Parsing the received web request to obtain file path information, and sending a cache request, carrying the file path information;
获取与所述文件路径信息对应的文件标识码, 获取并返回与所述文件标 识码对应的緩存数据, 其中, 文件标识码与緩存数据为——对应关系。  Obtaining a file identification code corresponding to the file path information, and obtaining and returning cache data corresponding to the file identification code, where the file identification code and the cache data are corresponding to each other.
2、 根据权利要求 1所述的方法, 其特征在于, 所述获取与所述文件路径 信息对应的文件标识码, 包括:  The method according to claim 1, wherein the obtaining the file identification code corresponding to the file path information comprises:
本地緩存模块向文件元数据存储单元发送查询文件标识码请求, 所述查 询文件标识码请求中携带所述文件路径信息; 接收所述文件元数据存储单元 返回的与所述文件路径信息对应的文件标识码, 所述文件元数据存储单元中 保存文件路径信息与文件标识码的对应关系;  The local cache module sends a query file identifier code request to the file metadata storage unit, where the query file identifier code request carries the file path information; and receives a file corresponding to the file path information returned by the file metadata storage unit An identifier, where the file metadata storage unit stores a correspondence between file path information and a file identification code;
或者,  Or,
本地緩存模块从文件标识码计算模块获取所述文件标识码。  The local cache module obtains the file identification code from the file identification code calculation module.
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述获取并返回与所 述文件标识码对应的緩存数据, 包括:  The method according to claim 1 or 2, wherein the acquiring and returning the cached data corresponding to the file identification code comprises:
如果本地緩存模块中保存有与所述文件标识码对应的緩存数据, 则返回 本地保存的緩存数据。  If the cache data corresponding to the file identification code is stored in the local cache module, the locally saved cache data is returned.
4、 根据权利要求 1或 2所述的方法, 其特征在于, 所述获取并返回与所 述文件标识码对应的緩存数据, 包括:  The method according to claim 1 or 2, wherein the acquiring and returning the cached data corresponding to the file identification code comprises:
如果本地緩存模块中没有保存有与所述文件标识码对应的緩存数据, 则 向共享緩存单元发送緩存查询请求, 所述緩存查询请求中携带所述文件路径 信息和 /或文件标识码;  And if the cached data corresponding to the file identifier is not stored in the local cache module, the cache query request is sent to the shared cache unit, where the cache query request carries the file path information and/or the file identifier code;
接收所述共享緩存单元返回的与所述文件路径信息和 /或文件标识码对 应的緩存数据;  Receiving, by the shared cache unit, cache data corresponding to the file path information and/or the file identification code;
返回所述緩存数据, 并建立文件标识码与緩存数据的对应关系以及文件 路径信息与緩存数据的对应关系。 Returning the cached data, and establishing a correspondence between the file identification code and the cached data and the file Correspondence between path information and cached data.
5、 根据权利要求 4所述的方法, 其特征在于, 还包括:  5. The method according to claim 4, further comprising:
共享緩存单元接收所述緩存查询请求;  The shared cache unit receives the cache query request;
如果所述共享緩存单元中没有保存与所述文件路径信息对应的緩存数 据, 则获取与所述文件路径信息对应的文件标识码;  Obtaining a file identifier corresponding to the file path information if the cache data corresponding to the file path information is not saved in the shared cache unit;
如果所述共享緩存单元中保存有与所述文件标识码对应的緩存数据, 则 向所述本地緩存模块返回对应的緩存数据, 并建立文件路径信息与緩存数据 的对应关系。  And if the cached data corresponding to the file identifier is stored in the shared cache unit, returning corresponding cache data to the local cache module, and establishing a correspondence between the file path information and the cache data.
6、 根据权利要求 4所述的方法, 其特征在于, 还包括:  6. The method according to claim 4, further comprising:
共享緩存单元接收所述緩存查询请求;  The shared cache unit receives the cache query request;
如果所述共享緩存单元中没有保存与所述文件路径信息对应的緩存数 据, 则获取与所述文件路径信息对应的文件标识码;  Obtaining a file identifier corresponding to the file path information if the cache data corresponding to the file path information is not saved in the shared cache unit;
如果所述共享緩存单元中没有保存与所述文件标识码对应的緩存数据, 则从文件系统获取并緩存数据;  If the cache data corresponding to the file identification code is not saved in the shared cache unit, the data is obtained and cached from the file system;
共享緩存单元向所述本地緩存模块返回对应的緩存数据, 并建立文件路 径信息与緩存数据的对应关系以及文件标识码与緩存数据的对应关系。  The shared cache unit returns corresponding cache data to the local cache module, and establishes a correspondence between the file path information and the cache data and a correspondence between the file identification code and the cache data.
7、 根据权利要求 5或 6所述的方法, 其特征在于, 所述获取与所述文件 路径信息对应的文件标识码, 包括:  The method according to claim 5 or 6, wherein the obtaining the file identification code corresponding to the file path information comprises:
如果所述緩存查询请求中携带文件标识码, 则从所述緩存查询请求中获 取所述文件标识码;  And if the cache query request carries the file identifier, the file identifier is obtained from the cache query request;
或者,  Or,
如果所述緩存查询请求中没有携带文件标识码, 则接收文件元数据存储 单元根据文件路径信息以及文件路径信息与文件标识码的对应关系, 获取的 文件标识码;  If the file identification code is not carried in the cache query request, the received file metadata storage unit obtains the file identification code according to the file path information and the correspondence between the file path information and the file identification code;
或者,  Or,
如果所述緩存查询请求中没有携带文件标识码, 则从文件标识码计算模 块中获取所述文件标识码。 If the file identification code is not carried in the cache query request, the file identification code is calculated. The file identification code is obtained in the block.
8、 根据权利要求 6所述的方法, 其特征在于, 所述从文件系统获取并緩 存数据包括:  8. The method according to claim 6, wherein the obtaining and buffering data from the file system comprises:
如果要获取文件緩存数据, 则共享緩存模块向文件系统发送读取文件数 据请求, 所述读取文件数据请求中携带文件标识码; 并接收所述文件系统根 据所述文件标识码返回的文件数据;  If the file cache data is to be obtained, the shared cache module sends a read file data request to the file system, where the read file data request carries the file identification code; and receives the file data returned by the file system according to the file identification code. ;
或者,  Or,
如果要获取脚本緩存数据, 则共享緩存模块向文件系统发送读取脚本数 据请求, 所述读取脚本数据请求中携带文件标识码; 并接收所述文件系统根 据所述文件标识码返回的脚本数据; 对所述脚本数据进行编译, 緩存编译后 的脚本数据。  If the script cache data is to be obtained, the shared cache module sends a read script data request to the file system, where the read script data request carries the file identifier code; and receives the script data returned by the file system according to the file identifier code. Compile the script data and cache the compiled script data.
9、 一种 Web请求调度系统, 其特征在于, 包括:  9. A web request scheduling system, comprising:
请求处理模块, 用于解析接收的 Web请求获取文件路径信息, 并发送緩 存请求, 携带所述文件路径信息;  a request processing module, configured to parse the received web request to obtain file path information, and send a cache request, and carry the file path information;
本地緩存模块, 用于获取与所述文件路径信息对应的文件标识码, 获取 并返回与所述文件标识码对应的緩存数据, 其中, 文件标识码与緩存数据为 ——对应关系。  The local cache module is configured to obtain a file identifier corresponding to the file path information, obtain and return cache data corresponding to the file identifier, where the file identifier and the cache data are corresponding relationships.
10、 根据权利要求 9所述的系统, 其特征在于, 还包括:  10. The system according to claim 9, further comprising:
文件元数据存储单元,用于保存文件路径信息与文件标识码的对应关系; 所述本地緩存模块具体用于根据所述文件路径信息从所述文件元数据存 储单元获取对应的文件标识码。  And a file metadata storage unit, configured to save a corresponding relationship between the file path information and the file identification code; the local cache module is configured to obtain a corresponding file identification code from the file metadata storage unit according to the file path information.
11、 根据权利要求 9所述的系统, 其特征在于, 还包括:  11. The system according to claim 9, further comprising:
文件标识码计算模块, 用于计算文件标识码;  a file identification code calculation module, configured to calculate a file identification code;
所述本地緩存模块具体用于从所述文件标识码计算模块获取所述文件标 识码。  The local cache module is specifically configured to obtain the file identification code from the file identifier calculation module.
12、 根据权利要求 9-11任一项所述的系统, 其特征在于, 所述本地緩存模块具体用于: 如果本地緩存模块中保存有与所述文件标 识码对应的緩存数据, 则返回本地保存的緩存数据。 12. A system according to any of claims 9-11, characterized in that The local cache module is specifically configured to: if the cache data corresponding to the file identification code is saved in the local cache module, return the locally saved cache data.
13、 根据权利要求 9-11任一项所述的系统, 其特征在于, 还包括: 共享緩存单元, 用于根据所述文件路径信息和 /或文件标识码向所述本地 緩存模块返回緩存数据;  The system according to any one of claims 9-11, further comprising: a shared cache unit, configured to return cached data to the local cache module according to the file path information and/or the file identification code ;
所述本地緩存模块具体用于: 如果本地緩存模块中没有保存有与所述文 件标识码对应的緩存数据, 则向共享緩存单元发送緩存查询请求, 所述緩存 查询请求中携带所述文件路径信息和 /或文件标识码; 接收所述共享緩存单元 返回的与所述文件路径信息和 /或文件标识码对应的緩存数据; 返回所述緩存 数据, 并建立文件标识码与緩存数据的对应关系以及文件路径信息与緩存数 据的对应关系。  The local cache module is specifically configured to: if the cached data corresponding to the file identifier is not stored in the local cache module, send a cache query request to the shared cache unit, where the cache query request carries the file path information And/or a file identification code; receiving cache data corresponding to the file path information and/or the file identification code returned by the shared cache unit; returning the cached data, and establishing a correspondence between the file identification code and the cached data, and Correspondence between file path information and cached data.
14、 根据权利要求 13所述的系统, 其特征在于,  14. The system of claim 13 wherein:
所述共享緩存单元包括: 文件緩存模块, 用于如果没有保存有与所述文 件路径信息对应的文件緩存数据, 则向文件系统发送读取文件数据请求, 所 述读取文件数据请求中携带文件标识码;  The shared cache unit includes: a file cache module, configured to send a read file data request to the file system if the file cache data corresponding to the file path information is not saved, where the read file data request carries the file Identification code;
所述系统还包括: 文件系统, 用于根据所述文件标识码获取并向所述文 件緩存模块返回对应的文件緩存数据。  The system further includes: a file system, configured to obtain and return corresponding file cache data to the file cache module according to the file identification code.
15、根据权利要求 13所述的系统,其特征在于,所述共享緩存单元包括: 脚本緩存模块, 用于如果保存有与所述文件路径信息对应的脚本緩存数 据, 则向所述本地緩存模块返回对应的脚本緩存数据。  The system according to claim 13, wherein the shared cache unit comprises: a script cache module, configured to: if the script cache data corresponding to the file path information is saved, to the local cache module Returns the corresponding script cache data.
16、 根据权利要求 13所述的系统, 其特征在于,  16. The system of claim 13 wherein:
所述共享緩存单元包括: 脚本緩存模块和脚本引擎模块, 所述脚本緩存 模块用于如果没有保存有与所述文件路径信息对应的脚本緩存数据, 则向脚 本引擎模块发送编译请求; 所述脚本引擎模块向文件系统发送读取脚本请求 所述读取脚本请求中携带文件标识码;  The shared cache unit includes: a script cache module and a script engine module, where the script cache module is configured to send a compile request to the script engine module if the script cache data corresponding to the file path information is not saved; The engine module sends a read script to the file system to request that the read script request carries the file identifier code;
所述系统还包括: 文件系统, 用于根据所述文件标识码获取并向所述脚 本引擎模块返回对应的脚本数据; The system further includes: a file system, configured to acquire and feed the foot according to the file identification code The engine module returns corresponding script data;
所述脚本引擎模块还用于对所述脚本数据进行编译; 所述脚本緩存模块还用于接收并緩存编译后的脚本数据。  The script engine module is further configured to compile the script data; the script cache module is further configured to receive and cache the compiled script data.
PCT/CN2010/079740 2010-12-14 2010-12-14 Web request scheduling method and system WO2011110042A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2010/079740 WO2011110042A1 (en) 2010-12-14 2010-12-14 Web request scheduling method and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
PCT/CN2010/079740 WO2011110042A1 (en) 2010-12-14 2010-12-14 Web request scheduling method and system
CN2010800046912A CN102216930A (en) 2010-12-14 2010-12-14 Web request scheduling method and system

Publications (1)

Publication Number Publication Date
WO2011110042A1 true WO2011110042A1 (en) 2011-09-15

Family

ID=44562864

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/079740 WO2011110042A1 (en) 2010-12-14 2010-12-14 Web request scheduling method and system

Country Status (2)

Country Link
CN (1) CN102216930A (en)
WO (1) WO2011110042A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102929958A (en) * 2012-10-10 2013-02-13 无锡江南计算技术研究所 Metadata processing method, agenting and forwarding equipment, server and computing system
CN102970358B (en) * 2012-11-08 2016-06-15 百度在线网络技术(北京)有限公司 The control method of the local cache of mobile client and device in net dish
CN105812839B (en) * 2014-12-31 2018-12-14 华为技术有限公司 Video stream data acquisition, page data transmission method, system and network server

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1601526A (en) * 2003-09-23 2005-03-30 国际商业机器公司 Method and appts for searching within a computer network
CN1852170A (en) * 2006-03-21 2006-10-25 华为技术有限公司 Method and system for realizing apparatus management based on standard platform
CN101408899A (en) * 2008-11-21 2009-04-15 北京中企开源信息技术有限公司 Method and apparatus for switching website multiple data sources
US20090313241A1 (en) * 2008-06-16 2009-12-17 Cisco Technology, Inc. Seeding search engine crawlers using intercepted network traffic

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100591078C (en) * 2007-09-28 2010-02-17 北京金山软件有限公司 A website buffering method and device
CN101719936A (en) * 2009-12-09 2010-06-02 成都市华为赛门铁克科技有限公司 Method, device and cache system for providing file downloading service

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1601526A (en) * 2003-09-23 2005-03-30 国际商业机器公司 Method and appts for searching within a computer network
CN1852170A (en) * 2006-03-21 2006-10-25 华为技术有限公司 Method and system for realizing apparatus management based on standard platform
US20090313241A1 (en) * 2008-06-16 2009-12-17 Cisco Technology, Inc. Seeding search engine crawlers using intercepted network traffic
CN101408899A (en) * 2008-11-21 2009-04-15 北京中企开源信息技术有限公司 Method and apparatus for switching website multiple data sources

Also Published As

Publication number Publication date
CN102216930A (en) 2011-10-12

Similar Documents

Publication Publication Date Title
US10664375B2 (en) Method and apparatus for stress management in a searchable data service
US10896182B2 (en) Multi-partitioning determination for combination operations
JP3620448B2 (en) System and method for intelligent caching and refreshing of dynamically created and static web content
WO2017050141A1 (en) Distributed storage-based file delivery system and method
JP5193056B2 (en) Method and system for maintaining up-to-date data of wireless devices
JP5509596B2 (en) Data management device
US20190095493A1 (en) Multi-partition operation in combination operations
WO2007115477A1 (en) Data synchronization method und system
JP4806462B2 (en) Peer-to-peer gateway
TW201246103A (en) Category information transmission method, system and apparatus
EP3022708B1 (en) Content source discovery
WO2010025652A1 (en) Mobile searching method and system, and method for synchronizing search ability of searching server
WO2007035580A2 (en) Providing local access to managed content
JP2011503703A5 (en)
US9959286B1 (en) Method, System and apparatus for synchronizing changes in a directory service
CN104794190A (en) Method and device for effectively storing big data
JP2016021232A (en) Checking freshness of data for data integration system (dis)
KR20170088950A (en) Method and apparatus for providing website authentication data for search engine
WO2013120382A1 (en) System, method, and device for offline downloading resource and computer storage medium
WO2011110042A1 (en) Web request scheduling method and system
CN101325611A (en) Point-to-point download method and apparatus
US9164781B2 (en) Client bundle resource creation
KR20170125665A (en) Semantic Information Management Method for a M2M/IoT platform
WO2016101759A1 (en) Data routing method, data management device and distributed storage system
US10708379B1 (en) Dynamic proxy for databases

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201080004691.2

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10847300

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase in:

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10847300

Country of ref document: EP

Kind code of ref document: A1