CN103747072A - Data reading and writing method and application server - Google Patents

Data reading and writing method and application server Download PDF

Info

Publication number
CN103747072A
CN103747072A CN 201310745987 CN201310745987A CN103747072A CN 103747072 A CN103747072 A CN 103747072A CN 201310745987 CN201310745987 CN 201310745987 CN 201310745987 A CN201310745987 A CN 201310745987A CN 103747072 A CN103747072 A CN 103747072A
Authority
CN
Grant status
Application
Patent type
Prior art keywords
data
target data
application server
cbase
stored
Prior art date
Application number
CN 201310745987
Other languages
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

Links

Abstract

The embodiment of the invention provides a data reading and writing method and an application server, and relates to the technical field of communication. The data reading and writing speed of the application server can be increased, and the response of the application server is quickened. The method comprises the following steps of receiving a data request message from a client by using the application server, and performing read operation or write operation on target data when the target data corresponding to identification information in the data request message are determined to be stored in CDN (content distribution network) cache equipment; when the target data are determined not to be stored in the CDN cache equipment, acquiring the target data from equipment with the target data, storing the acquired target data in the CDN cache equipment, and performing read operation or write operation indicated by the data request message on the target data stored in the CDN cache equipment after the acquired target data are stored in the CDN cache equipment. The embodiment of the invention is used for data reading and writing.

Description

一种读写数据的方法和应用服务器 A method of reading and writing data and application servers

技术领域 FIELD

[0001] 本发明涉及通信技术领域,尤其涉及一种读写数据的方法和应用服务器。 [0001] The present invention relates to communication technologies, particularly to a data read and write method and the application server.

背景技术 Background technique

[0002] 随着互联网技术的不断普及,互联网上传输的数据量出现了爆发式的增长,其中,应用服务器从数据库中读取数据并在浏览器中显示,许多网络应用也都将数据保存到数据库中。 [0002] With the growing popularity of Internet technology, the Internet amount of data transmitted emerged explosive growth, wherein the application server to read data from the database and displayed in the browser, many network applications also will save the data to database. 随着数据量的增大、访问的集中,增加了数据库的负担并造成了数据库的响应恶化,网站显示延迟等影响。 With the increased amount of data, access concentration, increasing the burden on the database and create a response database deteriorates, the site shows the effect of delay.

[0003] 现有技术中,应用服务器在接收到客户端的数据请求消息时,会对该数据请求消息进行分析和处理,而后对数据库中相应的数据进行数据请求消息所指示的读操作或写操作。 [0003] the prior art, the application server upon receiving the data request from the client message, will the data request message analysis and processing, and then in the database respective data of a data read is requested message indicated or write operation . 并且该应用服务器在下一次接收到相同的数据请求消息时,会再次对该数据请求消息进行分析和处理,并对数据库中相应的数据进行数据请求消息所指示的读操作或写操作。 And the application server next receive the same data request message will be the data request message again analyzed and processed, and the database corresponding data data requests a read message indicated or write operation. 由于数据库往往设置在距离应用服务器较远的地方,应用服务器每次完成对数据库的访问都需要花费较多的处理资源且需要较长的处理时间,这样,在存在高并发数据请求而使得该应用服务器短时间内接收到大量的数据请求消息时,该应用服务器需针对每一个数据请求消息对数据库进行相应的访问,从而导致该应用服务器的响应时间过长的问题。 Because the database is often set in place from the application server remote application server each time to complete access to the database you need to spend more processing resources and require longer processing time, so that high concurrent data requests in presence makes the application server within a short time receive a large number of data request message, the application server needs to request message to the database the appropriate access, thereby causing a problem long response time of the application server for each data.

发明内容 SUMMARY

[0004] 本发明提供一种读写数据的方法和应用服务器,能够提高该应用服务器读写数据的速度,减短了该应用服务器的响应时间。 [0004] The present invention provides a data read and write methods and application servers can increase the speed of the application server to read and write data, a short response time of the application server is reduced.

[0005] 为达到上述目的,本发明的实施例采用如下技术方案: [0005] To achieve the above object, embodiments of the present invention adopts the following technical solutions:

[0006] 第一方面,提供一种读写数据的方法,包括: [0006] In a first aspect, there is provided a read and write data, comprising:

[0007] 应用服务器接收客户端发送的数据请求消息;所述数据请求消息包括目标数据的标识信息; [0007] The data application server receives a client sends a request message; the data request message includes identification information of the target data;

[0008] 根据所述标识信息,查询所述应用服务器所接入的内容分发网络CDN中距离所述应用服务器最近的CDN缓存设备内是否存储有所述标识信息对应的目标数据;其中,所述CDN缓存设备用于对所述应用服务器从包括数据库在内的其他设备处获取到的数据进行缓存; [0008] The content of the identification information, querying the application server access to the distribution network in the CDN from the application server is stored within the last CDN cache device with said identification information corresponding to the target data; wherein said CDN cache device for the application server acquired from the device at the other, including the database to the data cache;

[0009] 当查询到所述CDN缓存设备内存储有所述目标数据时,对所述目标数据进行所述数据请求消息所指示的读操作或写操作; [0009] When a query into the CDN cache device stores the target data, the data of the target data requests a read message indicated or write operation;

[0010] 在确定所述CDN缓存设备内没有存储所述目标数据时,从存储有所述目标数据的设备处获取所述目标数据,将获取的所述目标数据存储到所述CDN缓存设备内,并在获取的所述目标数据存储到所述CDN缓存设备内后,对所述CDN缓存设备内存储的所述目标数据进行所述数据请求消息所指示的读操作或写操作。 [0010] When determining not to store the target data within the CDN cache device from the stored device at the target data to acquire the target data, to obtain the target data is stored in the CDN cache device later, and the target data acquired is stored into the CDN cache device, the target data within the CDN cache device stored the data request read operation message indicated or write operation.

[0011] 在第一方面的第一种可能的实现方式中,所述应用服务器在确定所述CDN缓存设备内没有存储所述目标数据时,从存储有所述目标数据的设备处获取所述目标数据,包括: [0011] In a first possible implementation manner of the first aspect, the application server when it is determined not to store the target data within the CDN cache device from the stored device at the target data obtaining said target data, including:

[0012] 所述应用服务器在确定所述CDN缓存设备内没有存储所述目标数据时,确定分布式缓存设备Cbase内是否存储有所述标识信息对应的目标数据; [0012] the application server when it is determined not to store the target data within the CDN cache device, determines whether to store the target data of the identification information corresponding to the distributed cache device Cbase;

[0013] 若确定分布式缓存设备Cbase内存储有所述标识信息对应的目标数据,则从所述Cbase处获取所述目标数据; [0013] If it is determined within the distributed cache device Cbase stores the identification target corresponding data information, from the Cbase at acquiring the target data;

[0014] 若确定所述Cbase内没有存储所述标识信息对应的目标数据,则从所述数据库内获取所述目标数据。 [0014] If it is determined there is no target data storing said identification information corresponding to said Cbase, from the acquisition of the target data in the database.

[0015] 结合第一种可能的实现方式,在第二种可能的实现方式中,所述标识信息包括数据键值Key ;则 [0015] The first possible implementation manner, in a second possible implementation, the identification information comprises data key Key; the

[0016] 所述应用服务器确定分布式缓存设备Cbase内是否存储有所述标识信息对应的目标数据,包括: [0016] The application server determines whether to store the target data of the identification information corresponding to the distributed cache apparatus Cbase, comprising:

[0017] 所述应用服务器确定所述Cbase内是否存在与所述Key对应的数据值Value ; [0017] The application server determines whether there is the data value of Value to the Key corresponding to said Cbase;

[0018] 若确定所述Cbase内存在与所述Key对应的数据值Value,则确定所述Cbase内存储有所述目标数据; [0018] When determining the Cbase memory data values ​​Value of the Key corresponding to determining that the Cbase stored therein the target data;

[0019] 若确定所述Cbase内不存在与所述Key对应的数据值Value,则确定所述Cbase内未存储有所述目标数据。 [0019] If determined that there is the Key data value corresponding to Value, it is determined not stored within said Cbase for the target data in the Cbase.

[0020] 结合第一种可能的实现方式,在第三种可能的实现方式中,所述数据请求消息还包括与所述目标数据相关的其他目标数据的标识信息;则 [0020] The first possible implementation manner, in a third possible implementation manner, the data request message further comprises information related to the target data identification information of the other target data; is

[0021] 所述应用服务器对所述目标数据进行所述数据请求消息所指示的读操作或写操作之后,所述方法还包括: After [0021] the application server for the data request message indicated by the read or write operation on the target data, the method further comprising:

[0022] 所述应用服务器将所述数据库内存储的所述其他目标数据存储到所述Cbase内,以便所述应用服务器在接收到包含所述其他目标数据的标识信息的数据请求消息时,将所述Cbase内存储的所述其他目标数据存储到所述CDN缓存设备内。 When [0022] the application server, the said database storing additional target data is stored in the Cbase, so that the application server is received containing data of the other target data identification information request message, the stored within said Cbase additional target data is stored in the CDN cache device.

[0023] 结合第一种可能的实现方式至第三种可能的实现方式中的任意一种可能的实现方式,在第四种可能的实现方式中,在所述应用服务器对所述目标数据进行所述数据请求消息所指示的写操作后,所述方法还包括: Any [0023] combination with the first possible implementation to third possible implementation of one possible implementation, in a fourth possible implementation manner, for the target data in the application server after the data request write message indicated, the method further comprising:

[0024] 所述应用服务器根据所述CDN缓存设备内的被执行了所述写操作的所述目标数据,更新所述Cbase和所述数据库。 [0024] The application server according to be carried out within the CDN cache device of the writing operation of the target data, updating the Cbase and the database.

[0025] 本发明第二方面提供一种应用服务器,包括: [0025] The present invention is a second aspect provides an application server, comprising:

[0026] 接收单元,用于接收客户端发送的数据请求消息;所述数据请求消息包括目标数据的标识信息; [0026] a receiving unit for receiving data sent by a client request message; the data request message includes identification information of the target data;

[0027] 处理单元,用于根据所述标识信息,查询所述应用服务器所接入的内容分发网络CDN中距离所述应用服务器最近的CDN缓存设备内是否存储有所述标识信息对应的目标数据;当查询到所述CDN缓存设备内存储有所述目标数据时,对所述目标数据进行所述数据请求消息所指示的读操作或写操作;其中,所述CDN缓存设备用于对所述应用服务器从包括数据库在内的其他设备处获取到的数据进行缓存; [0027] a processing unit, the target data is stored the identification information corresponding to the distribution network in the CDN from the application server nearest CDN caching apparatus according to the content of the identification information, querying the application server access to the ; when a query into the CDN cache device stores the target data, the data of the target data request message indicates a read or write operation; wherein the CDN cache device for the the application server acquired from the device at the other, including the database to the data cache;

[0028] 所述处理单元还用于,在确定所述CDN缓存设备内没有存储所述目标数据时,从存储有所述目标数据的设备处获取所述目标数据,将获取的所述目标数据存储到所述CDN缓存设备内,并在获取的所述目标数据存储到所述CDN缓存设备内后,对所述CDN缓存设备内存储的所述目标数据进行所述数据请求消息所指示的读操作或写操作。 The target data [0028] The processing unit is further configured to, when it is determined not to store the target data within the CDN cache device from the stored device at the target data to acquire the target data, the acquired reading the target data store is stored in the CDN cache device, and the acquired after said CDN cache device, the target data within the CDN cache device stored the data request message indicated or write operation.

[0029] 在第二方面的第一种可能的实现方式中,所述处理单元具体用于: [0029] In a first possible implementation manner of the second aspect, the processing unit is configured to:

[0030] 在确定所述CDN缓存设备内没有存储所述目标数据时,确定分布式缓存设备Cbase内是否存储有所述标识信息对应的目标数据; [0030] When determining not to store the target data within the CDN cache device, determine whether to store within the distributed cache device Cbase with said identification information corresponding to the target data;

[0031] 若确定分布式缓存设备Cbase内存储有所述标识信息对应的目标数据,则从所述Cbase处获取所述目标数据; [0031] If it is determined within the distributed cache device Cbase stores the identification target corresponding data information, from the Cbase at acquiring the target data;

[0032] 若确定所述Cbase内没有存储所述标识信息对应的目标数据,则从所述数据库内获取所述目标数据。 [0032] If it is determined there is no target data storing said identification information corresponding to said Cbase, from the acquisition of the target data in the database.

[0033] 结合第一种可能的实现方式,在第二种可能的实现方式中,所述标识信息包括数据键值Key ;则所述处理单元具体用于,确定所述Cbase内是否存在与所述Key对应的数据值Value ; [0033] The first possible implementation manner, in a second possible implementation, the identification information comprises data key Key; the processing unit is configured to determine whether there is the said Cbase said Key data value corresponding to the value;

[0034] 若确定所述Cbase内存在与所述Key对应的数据值Value,则确定所述Cbase内存储有所述目标数据; [0034] When determining the Cbase memory data values ​​Value of the Key corresponding to determining that the Cbase stored therein the target data;

[0035] 若确定所述Cbase内不存在与所述Key对应的数据值Value,则确定所述Cbase内未存储有所述目标数据。 [0035] If determined that there is the Key data value corresponding to Value, it is determined not stored within said Cbase for the target data in the Cbase.

[0036] 结合第一种可能的实现方式,在第三种可能的实现方式中,所述数据请求消息还包括与所述目标数据相关的其他目标数据的标识信息;则所述处理单元还用于,将所述数据库内存储的所述其他目标数据存储到所述Cbase内,以便所述应用服务器在接收到包含所述其他目标数据的标识信息的数据请求消息时,将所述Cbase内存储的所述其他目标数据存储到所述CDN缓存设备内。 [0036] The first possible implementation manner, in a third possible implementation manner, the data request message further comprises information related to the target data identification information of the other target data; the processing unit further with when on, the said database storing additional target data is stored in the Cbase, so that the application server is received containing data of the other target data identification information request message, the Cbase the storage the other target data is stored in the CDN cache device.

[0037] 结合第一种可能的实现方式至第三种可能的实现方式中的任意一种可能的实现方式,在第四种可能的实现方式中,在所述对所述目标数据进行所述数据请求消息所指示的写操作后,所述处理单元还用于,根据所述CDN缓存设备内的被执行了所述写操作的所述目标数据,更新所述Cbase和所述数据库。 [0037] The first possible implementation manner to any third possible implementation of one possible implementation, in a fourth possible implementation manner, for the target data in the after the data request write message indicated, the processing unit is further configured to, according to be carried out within the CDN cache device of the writing operation of the target data, updating the Cbase and the database.

[0038] 采用上述方案,应用服务器接收客户端发送的数据请求消息,并在确定CDN(Content Delivery Network,内容分发网络)缓存设备内存储有该数据请求消息中的标识信息对应的目标数据时,对该目标数据进行读操作或写操作;在确定该CDN缓存设备内没有存储该目标数据时,从存储有该目标数据的设备处获取该目标数据,将获取的该目标数据存储到该CDN缓存设备内,并在获取的该目标数据存储到该CDN缓存设备内后,对该CDN缓存设备内存储的该目标数据进行该数据请求消息所指示的读操作或写操作。 When [0038] the above embodiment, data application server receives a client sends a request message, and determining the CDN (Content Delivery Network, the content distribution network) cache device storing the data request identification information corresponding to the message in the target data, for the target data read or write operation; when it is determined that the CDN is not stored in the target data within the cache device from the stored device at the target data acquisition of the target data, the acquisition of the target data stored in the CDN cache after the apparatus and the target data acquired is stored into the CDN cache device, to perform the data read is requested message indicated or write operation on the the target data stored within the CDN cache device. 这样,该应用服务器在接收到数据请求消息后,无需对该数据请求消息进行分析处理即可直接对该CDN缓存设备内的目标数据进行读操作或写操作,避免了每次都从数据库中读写数据,提高了该应用服务器读写数据的速度,减短了该应用服务器的响应时间。 Thus, the application server receives the data request message without the data request message analysis processing can be read directly on the target data within the CDN caching apparatus or a write operation, avoiding every read from the database write data to improve the speed of the application server to read and write data, to shorten the response time of the application server.

附图说明 BRIEF DESCRIPTION

[0039] 图1为本发明实施例提供的一种读写数据的方法的流程示意图; Flow of the method [0039] FIG 1. A read and write data according to an embodiment of the present invention, a schematic diagram;

[0040] 图2为本发明实施例提供的另一种读写数据的方法的流程示意图; [0040] FIG. 2 is a schematic flowchart of a method of another read and write data according to an embodiment of the present invention;

[0041] 图3为本发明实施例提供的一种应用服务器的应用场景的示意图; [0041] FIG. 3 is a schematic diagram provided scenarios an application server embodiment of the invention;

[0042] 图4为本发明实施例提供的一种应用服务器的结构示意图。 [0042] FIG. 4 is a schematic structure of an application server according to an embodiment of the present invention. 具体实施方式 Detailed ways

[0043] 下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。 [0043] below in conjunction with the present invention in the accompanying drawings, technical solutions of embodiments of the present invention are clearly and completely described, obviously, the described embodiments are merely part of embodiments of the present invention, but not all embodiments example. 基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。 Based on the embodiments of the present invention, all other embodiments to those of ordinary skill in the art without any creative effort shall fall within the scope of the present invention.

[0044] 本发明实施例提供一种读写数据的方法,如图1所示,该方法包括: [0044] The embodiment provides a data read and write process of the invention, shown in Figure 1, the method comprising:

[0045] S101、应用服务器接收客户端发送的数据请求消息,该数据请求消息包括目标数据的标识信息。 [0045] S101, the application server receives a client sends a data request message, the data request message includes identification information of the target data.

[0046] S102、该应用服务器根据该标识信息,查询该应用服务器所接入的内容分发网络CDN中距离该应用服务器最近的CDN缓存设备内是否存储有该标识信息对应的目标数据。 [0046] S102, the application server according to the identification information, queries the application server access to the distribution network CDN whether storing the identification information corresponding to the target data within the last CDN cache device from the application server.

[0047] 其中,该CDN缓存设备用于对该应用服务器从包括数据库在内的其他设备处获取到的数据进行缓存。 [0047] wherein the CDN cache device for the application server acquired from the device at the other, including the database to the data cache.

[0048] S103、当该应用服务器查询到该CDN缓存设备内存储有该目标数据时,对该目标数据进行该数据请求消息所指示的读操作或写操作。 [0048] S103, when the application server queries within the CDN cache device storing the target data, the target data, the data read is requested message indicated or write operation.

[0049] S104、该应用服务器在确定该CDN缓存设备内没有存储该目标数据时,从存储有该目标数据的设备处获取该目标数据,将获取的该目标数据存储到该CDN缓存设备内,并在获取的该目标数据存储到该CDN缓存设备内后,对该CDN缓存设备内存储的该目标数据进行该数据请求消息所指示的读操作或写操作。 When the [0049] S104, the application server determines not to store the target data within the CDN cache device from the stored acquires the target data of the target device data, storing the target data acquired into the CDN cache device, after storing the target data and the acquired into the CDN cache device, to perform the data read is requested message indicated or write operation on the the target data stored within the CDN cache device.

[0050] 采用上述方案,应用服务器接收客户端发送的数据请求消息,并在确定CDN(Content Delivery Network,内容分发网络)缓存设备内存储有该数据请求消息中的标识信息对应的目标数据时,对该目标数据进行读操作或写操作;在确定该CDN缓存设备内没有存储该目标数据时,从存储有该目标数据的设备处获取该目标数据,将获取的该目标数据存储到该CDN缓存设备内,并在获取的该目标数据存储到该CDN缓存设备内后,对该CDN缓存设备内存储的该目标数据进行该数据请求消息所指示的读操作或写操作。 When [0050] the above embodiment, data application server receives a client sends a request message, and determining the CDN (Content Delivery Network, the content distribution network) cache device storing the data request identification information corresponding to the message in the target data, for the target data read or write operation; when it is determined that the CDN is not stored in the target data within the cache device from the stored device at the target data acquisition of the target data, the acquisition of the target data stored in the CDN cache after the apparatus and the target data acquired is stored into the CDN cache device, to perform the data read is requested message indicated or write operation on the the target data stored within the CDN cache device. 这样,该应用服务器在接收到数据请求消息后,无需对该数据请求消息进行分析处理即可直接对该CDN缓存设备内的目标数据进行读操作或写操作,避免了每次都从数据库中读写数据,提高了该应用服务器读写数据的速度,减短了该应用服务器的响应时间。 Thus, the application server receives the data request message without the data request message analysis processing can be read directly on the target data within the CDN caching apparatus or a write operation, avoiding every read from the database write data to improve the speed of the application server to read and write data, to shorten the response time of the application server.

[0051] 为了使本领域技术人员能够更清楚地理解本发明实施例提供的技术方案,下面通过具体的实施例,对本发明实施例提供的另一种读写数据的方法进行详细说明,如图2所示,该方法包括: [0051] In order that those skilled in the art to more clearly understand the embodiments of the invention provide a technical solution, following by specific embodiments, the present invention provides another data read and write method is described in detail, as 2, the method comprising:

[0052] S201、应用服务器接收客户端发送的数据请求消息,所述数据请求消息包括目标数据的标识信息。 [0052] S201, the application server receives a client sends a data request message, the data request message includes identification information of the target data.

[0053] 具体地,用户在浏览网页时,通过点击调用该网页内的应用程序,向该应用服务器发送数据请求消息,其中,该数据请求消息可以是对目标数据的写请求或者读请求,该数据请求消息包括该目标数据的标识信息。 [0053] Specifically, the user browse the Web, the calling application by clicking within the web page, sending a data request message to the application server, wherein the request message may be a data write request or the read request of the target data, the data request message includes identification information of the target data.

[0054] 需要说明的是,该应用服务器的应用场景如图3所示,图3包括CDN缓存设备,用于短时间缓存数据,客户端可以通过该应用服务器直接从该CDN缓存设备中调用数据,显示网页;Cbase,用于长时间缓存数据,减轻数据库的负担,提高数据访问的速度;数据库,用于存储数据的存储介质,如磁盘;应用服务器,用于根据数据请求消息查找对应的目标数据,以及对各存储空间进行维护。 [0054] Incidentally, the application scenario of the application server shown in Figure 3, Figure 3 includes CDN caching apparatus, for a short time the cache data, the client can call data by the application server directly from the CDN cache apparatus web page is displayed; Cbase, for long-cached data, reduce the burden on the database, increase the speed of data access; database, storage medium for storing data, such as a disk; an application server, a request message to find the corresponding target based on the data data, and perform maintenance on each of the storage space.

[0055] S202、该应用服务器确定CDN缓存设备内是否存储有对应该标识信息的目标数据。 [0055] S202, the application server determines whether to store the target data to be the identification information in the CDN cache device.

[0056] 需要说明的是,多个⑶N缓存设备可以分布在不同的地域,则某一地域的用户在进行网页浏览时,该应用服务器可以根据接收到的数据请求消息访问离该地域最近的CDN缓存设备,另外,由于该CDN缓存设备中的数据失效时间很快,约两分钟,因此该CDN缓存设备只能短时间的存储目标数据。 [0056] Incidentally, a plurality ⑶N cache device may be distributed in different regions, then a local user when web browsing is performed, the application server request message to access the data received from the area nearest CDN cache device, Further, since the data of the CDN cache device failure time quickly, about two minutes, so that the CDN cache device only a short period of storage target data.

[0057] 若该应用服务器确定CDN缓存设备内存储有对应该标识信息的目标数据,执行步骤S203 ;若该应用服务器确定CDN缓存设备内没有存储对应该标识信息的目标数据,执行步骤S204。 [0057] If the application server determines the CDN cache device stores the target data should be identification information, executing step S203; if the application server determines that no inner CDN cache device stores should be identified as target data, the step S204.

[0058] S203、该应用服务器根据该数据请求消息对该CDN缓存设备内存储的该目标数据进行相应的读操作或写操作。 [0058] S203, the application server request message based on the data of the corresponding read or write operation on the the target data stored within the CDN cache device.

[0059] 示例地,用户在网页中点击播放音乐时,在应用服务器接收到数据请求消息后,若该CDN缓存设备中存储有该数据请求消息对应的音乐数据,则该应用服务器可直接读取该音乐数据,并将该音乐数据发送给该网页客户端。 When the [0059] example, the user clicks play music page, the application server receives a data request message, if the CDN cache device stores the data request message corresponding to the music data, the application server may directly read the music data, and sends the music data to the web client.

[0060] S204、该应用服务器确定分布式缓存设备Cbase内是否存储有对应该标识信息的目标数据。 [0060] S204, the application server determines whether to store the target data to be identification information within the distributed cache device Cbase.

[0061] 可选地,该标识信息包括数据键值Key,若该应用服务器确定该Cbase内存在与该Key对应的数据值Value,则确定该Cbase内存储有该目标数据;若确定该Cbase内不存在与该Key对应的数据值Value,则确定该Cbase内未存储有该目标数据。 [0061] Alternatively, the identification information includes data key Key, if the application server determines that the Cbase memory in the Key data corresponding to the value Value, it is determined that Cbase within stores the target data; if it is determined that Cbase within Key does not exist corresponding to the data value value, it is determined that there is not stored within the Cbase the target data.

[0062] 需要说明的是,数据由Key (键)和Value (值)两部分构成,其中,Key相当于数据的索引,Value是Key所代表的数据内容,一个Value可能具有多个键值,用户可以根据键值访问到数据内容。 [0062] Incidentally, the data composed Key (key) and a Value (value) in two parts, wherein, Key corresponding to the index data, Value is the data content Key represents, a Value may have a plurality of keys, users can access content according to the data key. 另外,该Cbase中可以持久化缓存数据。 Further, the Cbase may be persistent caching data.

[0063] 若该应用服务器确定该Cbase内存储有对应该标识信息的目标数据,执行步骤S205 ;若该应用服务器确定该Cbase内没有存储对应该标识信息的目标数据,执行步骤S206。 [0063] If the application server determines within which Cbase stores target data should be identification information, executing step S205; if the application server determines that no inside the Cbase stores should be identified as target data, the step S206.

[0064] S205、该应用服务器将该Cbase内存储的该目标数据存储到该CDN缓存设备内,并根据该数据请求消息对该CDN缓存设备内存储的该目标数据进行相应的读操作或写操作。 [0064] S205, the application server sends the target data storage Cbase stored therein into the CDN cache device, and the request message based on the data corresponding to a read of the target data within the CDN cache device stores or writes .

[0065] S206、该应用服务器从对应的数据库内获取该目标数据,将该目标数据存储到该CDN缓存设备和该Cbase内,并对该CDN缓存设备内存储的该目标数据进行读操作或写操作。 [0065] S206, the application server acquires from a database corresponding to the target data, the target data is stored in the cache device and the CDN Cbase, and reads the stored data of the target within the CDN or write cache device operating.

[0066] 具体地,在该CDN缓存设备和该Cbase内都没有存储该目标数据时,该应用服务器在数据库中获取该目标数据,并将该目标数据存储到该CDN缓存设备和该Cbase中,并对该CDN缓存设备内存储的该目标数据进行读操作或写操作,完成本次数据请求,并且该应用服务器再次接收到对应该目标数据的数据请求消息时,该应用服务器能够直接根据该数据请求消息对该CDN缓存设备中存储的该目标数据进行读操作或写操作;若该应用服务器再次接收到对应该目标数据的数据请求消息时,该CDN缓存设备中存储的该目标数据失效,则该应用服务器根据该数据请求消息从该Cbase中获取到该目标数据,避免了再次从数据库中获取,这样,该应用服务器对相同的目标数据只需要进行一次计算并从数据库中获取,并在之后再次读写该目标数据时无需计算,因为,该应用服务器在 When [0066] Specifically, in the CDN cache device and the Cbase are not the target data storage, the application server acquires the target data in the database, and stores the target data to the CDN cache device and the Cbase in when and the the target data stored within the CDN cache device read or write operation, the completion of this data request, and the application server receives the data to be object data request message again, the application server directly according to the data the request message to the target cache device CDN data stored in a read or write operation; If the application server receives the data request message should be re-target data, the target data stored in the CDN cache device failure, the the application server request message based on the data acquired from the Cbase into the target data, to avoid obtaining from the database again, so, the application server the same target data only once calculated and acquired from the database, and after no need to calculate when to read and write the target data again, because the application server 通过数据请求消息从数据库中获取目标数据时,需要对多个数据库和多张表的数据通过计算以确定目标数据,消耗了较多的时间,则通过该CDN缓存设备和该Cbase 二重缓存机制,减少了该应用服务器在数据库中获取目标数据的次数,提高了该应用服务器读写数据的速度,同时减轻了数据库的负担。 Acquiring target data from the database via a data request message, requiring data for a plurality of databases and a plurality of tables to determine the target data by calculation, it consumes more time, through the CDN cache device and the Cbase double caching mechanism , reducing the number of the target application server to obtain data in the database, increasing the speed of the application server to read and write data, while reducing the burden on the database.

[0067] 需要说明的是,由于在数据库访问权限以及安全级别均高于CDN缓存设备和Cbase,因此,该应用服务器在CDN缓存设备和Cbase中访问数据的速度高于在数据库访问数据的速度。 [0067] It should be noted that, due to database access and security levels are higher than CDN caching device and Cbase, therefore, the application server speed access to data in CDN caching device and Cbase higher than the speed of database access data.

[0068] 可选地,该数据请求消息还包括与该目标数据相关的其他目标数据的标识信息,则该应用服务器在对该CDN设备内存储的该目标数据进行读操作或写操作之后,将数据库内存储的该其他目标数据存储到该Cbase内,以便该应用服务器在接收到对应该其他目标数据的数据请求消息时,将该Cbase内存储的该其他目标数据存储到该CDN缓存设备内。 [0068] Alternatively, the data request message also includes the target data relating to other target data identification information, the application server in the CDN equipment stored within the target data read or write operation after the the other target data stored in the database is stored in the Cbase, so that the application server receiving to be data other target data request message, the other target data of the inner Cbase stored in the memory into the CDN cache device.

[0069] 具体地,有上述可知,该应用服务器在通过数据请求消息从数据库中获取目标数据时,需要耗费较长的时间,若该应用服务器在接收到该数据请求消息时再通过计算确定数据库中的目标数据,延长了该应用服务器的响应时间,因此,该应用服务器在接收到该数据请求消息之前,可以预先将该目标数据存储到该Cbase内,则该应用服务器在接收到该数据请求消息时,可以直接从该Cbase内获取到该目标数据,减短了该应用服务器的响应时间。 [0069] Specifically, the above can be seen, the application server in acquiring the target data from the database via a data request message, it takes a long time, and then determine the database by calculating if the application server receives the data request message the target data, to extend the response time of the application server, and therefore, the application server prior to receiving the data request message, may be previously the target data is stored in the Cbase, the application server receives the data request message may be obtained directly from the Cbase to the target data, the short response time of the application server is reduced.

[0070] S207、该应用服务器该应用服务器根据该CDN缓存设备内的被执行了该写操作的该目标数据,更新该Cbase和该数据库。 [0070] S207, the application server, the application server according to be carried out the target data of the write operation within the CDN cache device, update the Cbase and the database.

[0071] 示例地,该数据请求消息为写请求消息,则该应用服务器在根据该写请求消息对该CDN缓存设备内存储的目标数据进行写操作,修改该目标数据的值后,将修改后的目标数据存储到该Cbase和该数据库中。 After [0071] Illustratively, the data request message is a write request message, the application server in the request message according to the write for the write operation on the target data within the CDN cache apparatus store, modify the value of the target data, the modified the target data is stored in the Cbase and the database.

[0072] 这样,该应用服务器在接收到数据请求消息后,无需对该数据请求消息进行分析处理即可直接对该CDN缓存设备内的目标数据进行读操作或写操作,避免了每次都从数据库中读写数据,提高了该应用服务器读写数据的速度,减短了该应用服务器的响应时间。 [0072] Thus, the application server receives the data request message without the data request message analysis processing can be read directly on the target data within the CDN caching apparatus or a write operation, avoiding every time from database read and write data to improve the application server to read and write data faster, shortening the application server response time.

[0073] 另外,对于上述方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。 [0073] Further, the above-described method embodiments, for ease of description, it is described as a series combination of actions, those skilled in the art should understand that the present invention is not limited by the order of acts described, secondly, those skilled in the art should also understand that the embodiments described in the specification are part of the preferred embodiments, acts, and modules involved are not necessarily required by the present invention.

[0074] 本发明实施例提供一种应用服务器40,如图4所示,包括: [0074] The present invention provides an application server 40, shown in Figure 4, comprising:

[0075] 接收单元41,用于接收客户端发送的数据请求消息。 [0075] The receiving unit 41, for receiving the data sent by the client request message.

[0076] 该数据请求消息包括目标数据的标识信息。 [0076] The data request message includes identification information of the target data.

[0077] 处理单元42,用于根据该标识信息,查询该应用服务器所接入的内容分发网络CDN中距离该应用服务器最近的CDN缓存设备内是否存储有该标识信息对应的目标数据;当查询到该CDN缓存设备内存储有该目标数据时,对该目标数据进行该数据请求消息所指示的读操作或写操作。 [0077] The processing unit 42, a Content Distribution Network CDN the application server accessed distance the application server is stored within the last CDN cache device has the identification information corresponding to the target data according to the identification, query; when a query when the CDN to the cache device stores the target data, the data request message read operation or write operation indicated by the target data.

[0078] 其中,该CDN缓存设备用于对该应用服务器从包括数据库在内的其他设备处获取到的数据进行缓存。 [0078] wherein the CDN cache device for the application server acquired from the device at the other, including the database to the data cache.

[0079] 该处理单元还用于,在确定该CDN缓存设备内没有存储该目标数据时,从存储有该目标数据的设备处获取该目标数据,将获取的该目标数据存储到该CDN缓存设备内,并在获取的该目标数据存储到该CDN缓存设备内后,对该CDN缓存设备内存储的该目标数据进行该数据请求消息所指示的读操作或写操作。 [0079] The processing unit is further configured to, when it is determined that the CDN is not stored in the target data in the buffer device, the stored acquires the target data of the target device data, acquired the target data stored in the CDN cache device inside, and the target data acquired is stored into the inside of the CDN cache device, the the target data stored within the CDN cache device to perform the data read is requested message indicated or write operation.

[0080] 具体地,用户在浏览网页时,通过点击调用该网页内的应用程序,向该应用服务器发送数据请求消息,其中,该数据请求消息可以是对目标数据的写请求或者读请求,该数据请求消息包括该目标数据的标识信息。 [0080] Specifically, the user browse the Web, by clicking the calling application in the web page, sending a data request message to the application server, wherein the data request message may be a write request or a read request of the target data, the data request message includes identification information of the target data.

[0081] 需要说明的是,多个⑶N缓存设备可以分布在不同的地域,则某一地域的用户在进行网页浏览时,该应用服务器可以根据接收到的数据请求消息访问离该地域最近的CDN缓存设备,另外,由于该CDN缓存设备中的数据失效时间很快,约两分钟,因此该CDN缓存设备只能短时间的存储目标数据。 [0081] Incidentally, a plurality ⑶N cache device may be distributed in different regions, then a local user when web browsing is performed, the application server request message to access the data received from the area nearest CDN cache device, Further, since the data in the cache device CDN quickly failure time, about two minutes, so that only a short CDN cache device stores object data.

[0082] 示例地,用户在网页中点击播放音乐时,在应用服务器接收到数据请求消息后,若该CDN缓存设备中存储有该数据请求消息对应的音乐数据,则该应用服务器可直接读取该音乐数据,并将该音乐数据发送给该网页客户端。 When the [0082] example, the user clicks play music page, the application server receives a data request message, if the CDN cache device stores the data request message corresponding to the music data, the application server may directly read the music data, and sends the music data to the web client.

[0083] 可选地,该处理单元42具体用于,在确定该CDN缓存设备内没有存储该目标数据时,确定分布式缓存设备Cbase内是否存储有该标识信息对应的目标数据,若确定分布式缓存设备Cbase内存储有该标识信息对应的目标数据,则从该Cbase处获取该目标数据;若确定该Cbase内没有存储该标识信息对应的目标数据,则从该数据库内获取该目标数据。 [0083] Alternatively, the processing unit 42 is specifically configured to, when it is determined that the CDN is not stored in the target data in the buffer device, determine whether to store within the distributed cache device Cbase have the identification information corresponding to the target data, if it is determined the distribution the caching apparatus Cbase stores target data of the identification information corresponding to from acquiring the target data of the Cbase place; if it is determined not to store the identification information corresponding to the target data in the Cbase, from acquiring the target data within the database.

[0084] 需要说明的是,数据由Key (键)和Value (值)两部分构成,其中,Key相当于数据的索引,Value是Key所代表的数据内容,一个Value可能具有多个键值,用户可以根据键值访问到数据内容。 [0084] Incidentally, the data composed Key (key) and a Value (value) in two parts, wherein, Key corresponding to the index data, Value is the data content Key represents, a Value may have a plurality of keys, users can access data content based on a key. 另外,该Cbase中可以持久化缓存数据。 Further, the Cbase may be persistent caching data.

[0085] 可选地,该标识信息包括数据键值Key,则该处理单元具体用于,确定该Cbase内是否存在与该Key对应的数据值Value,若确定该Cbase内存在与该Key对应的数据值Value,则确定该Cbase内存储有该目标数据;若确定该Cbase内不存在与该Key对应的数据值Value,则确定该Cbase内未存储有该目标数据。 [0085] Alternatively, the identification information includes data key Key, the processing unit is specifically configured to determine whether there is a data value corresponding to Value and the Key within the Cbase, if it is determined that the Cbase memory corresponding to this Key data value value, it is determined within the Cbase storing the target data; if it is determined the data value value corresponding to the Key does not exist in the Cbase, it is determined not stored within the Cbase has the target data.

[0086] 需要说明的是,数据由Key (键)和Value (值)两部分构成,其中,Key相当于数据的索引,Value是Key所代表的数据内容,一个Value可能具有多个键值,用户可以根据键值访问到数据内容。 [0086] Incidentally, the data composed Key (key) and a Value (value) in two parts, wherein, Key corresponding to the index data, Value is the data content Key represents, a Value may have a plurality of keys, users can access data content based on a key. 另外,该Cbase中可以持久化缓存数据。 In addition, the Cbase can be persistent cache data.

[0087] 可选地,该数据请求消息还包括与该目标数据相关的其他目标数据的标识信息,则该处理单元还用于,将该数据库内存储的该其他目标数据存储到该Cbase内,以便该应用服务器在接收到包含该其他目标数据的标识信息的数据请求消息时,将该Cbase内存储的该其他目标数据存储到该CDN缓存设备内。 [0087] Alternatively, the data request message further includes identification information of additional target data associated with the target data, the processing unit is further for storing the the other target data stored in the database into the Cbase, so that the application server receiving including the data identification information of other object data request message, the other target data of the inner Cbase stored in the memory into the CDN cache device.

[0088] 具体地,在该CDN缓存设备和该Cbase内都没有存储该目标数据时,该应用服务器在数据库中获取该目标数据,并将该目标数据存储到该CDN缓存设备和该Cbase中,并对该CDN缓存设备内存储的该目标数据进行读操作或写操作,完成本次数据请求,并且该应用服务器再次接收到对应该目标数据的数据请求消息时,该应用服务器能够直接根据该数据请求消息对该CDN缓存设备中存储的该目标数据进行读操作或写操作;若该应用服务器再次接收到对应该目标数据的数据请求消息时,该CDN缓存设备中存储的该目标数据失效,则该应用服务器根据该数据请求消息从该Cbase中获取到该目标数据,避免了再次从数据库中获取,这样,该应用服务器对相同的目标数据只需要进行一次计算并从数据库中获取,并在之后再次读写该目标数据时无需计算,因为,该应用服务器在 When [0088] Specifically, in the CDN cache device and the Cbase are not the target data storage, the application server acquires the target data in the database, and stores the target data to the CDN cache device and the Cbase in when and the the target data stored within the CDN cache device read or write operation, the completion of this data request, and the application server receives the data to be object data request message again, the application server directly according to the data request message to the the target data CDN cache device stored in a read or write operation; If the application server receives the data to be object data request message again, the target data of the CDN caches stored in the device fails, the application server request message based on the data acquired from the Cbase into the target data, to avoid obtaining from the database again, so, the application server the same target data only once calculated and acquired from the database, and after no need to calculate when to read and write the target data again, because the application server 通过数据请求消息从数据库中获取目标数据时,需要对多个数据库和多张表的数据通过计算以确定目标数据,消耗了较多的时间,则通过该CDN缓存设备和该Cbase 二重缓存机制,减少了该应用服务器在数据库中获取目标数据的次数,提高了该应用服务器读写数据的速度,同时减轻了数据库的负担。 Acquiring target data from the database via a data request message, requiring data for a plurality of databases and a plurality of tables to determine the target data by calculation, it consumes more time, through the CDN cache device and the Cbase double caching mechanism , reducing the number of the application server to obtain objective data in the database, increasing the speed of the application server to read and write data, while reducing the burden on the database.

[0089] 需要说明的是,由于在数据库访问权限以及安全级别均高于CDN缓存设备和Cbase,因此,该应用服务器在CDN缓存设备和Cbase中访问数据的速度高于在数据库访问数据的速度。 [0089] It should be noted that, due to database access and security levels are higher than CDN caching device and Cbase, therefore, the application server speed access to data in CDN caching device and Cbase higher than the speed of database access data.

[0090] 可选地,在该应用服务器对该目标数据进行该数据请求消息所指示的写操作后,该处理单元还用于,根据该CDN缓存设备内的被执行了该写操作的该目标数据,更新该Cbase和该数据库。 [0090] Alternatively, after the write operation of the application server for the data to the target data request message is indicated, the processing unit is further configured to, according to the target is performed within the CDN cache device of the write operation data, updating the Cbase and the database.

[0091] 示例地,该数据请求消息为写请求消息,则该应用服务器在根据该写请求消息对该CDN缓存设备内存储的目标数据进行写操作,修改该目标数据的值后,将修改后的目标数据存储到该Cbase和该数据库中。 After [0091] Illustratively, the data request message is a write request message, the application server in the request message according to the write for the write operation on the target data within the CDN cache apparatus store, modify the value of the target data, the modified the target data is stored in the Cbase and the database.

[0092] 采用上述应用服务器,该应用服务器接收客户端发送的数据请求消息,并在确定CDN (Content Delivery Network,内容分发网络)缓存设备内存储有该数据请求消息中的标识信息对应的目标数据时,对该目标数据进行读操作或写操作;在确定该CDN缓存设备内没有存储该目标数据时,从存储有该目标数据的设备处获取该目标数据,将获取的该目标数据存储到该CDN缓存设备内,并在获取的该目标数据存储到该CDN缓存设备内后,对该CDN缓存设备内存储的该目标数据进行该数据请求消息所指示的读操作或写操作。 [0092] The said application server, the application server receives the data sent by the client request message, and determining the CDN (Content Delivery Network, the content distribution network) in the buffer device storing the data request identification information in the message corresponding to the target data when, the object data read or write operation; when it is determined that the CDN is not stored in the target data in the buffer device, the stored acquires the target data of the target device data, acquired the target data stored in this after the CDN cache device, the target data and stores the acquired into the CDN cache device, to perform the data read is requested message indicated or write operation on the the target data stored within the CDN cache device. 这样,该应用服务器在接收到数据请求消息后,无需对该数据请求消息进行分析处理即可直接对该CDN缓存设备内的目标数据进行读操作或写操作,避免了每次都从数据库中读写数据,提高了该应用服务器读写数据的速度,减短了该应用服务器的响应时间。 Thus, the application server receives the data request message without the data request message analysis processing can be read directly on the target data within the CDN caching apparatus or a write operation, avoiding every read from the database write data to improve the speed of the application server to read and write data, to shorten the response time of the application server.

[0093] 以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。 [0093] The above are only specific embodiments of the present invention, but the scope of the present invention is not limited thereto, any skilled in the art in the art within the scope of the invention disclosed can be easily thought of the changes or alternatively, shall fall within the protection scope of the present invention. 因此,本发明的保护范围应以权利要求的保护范围为准。 Accordingly, the scope of the present invention should be defined by the scope of the claims.

Claims (10)

  1. 1.一种读写数据的方法,其特征在于,包括: 应用服务器接收客户端发送的数据请求消息;所述数据请求消息包括目标数据的标识信息; 根据所述标识信息,查询所述应用服务器所接入的内容分发网络CDN中距离所述应用服务器最近的CDN缓存设备内是否存储有所述标识信息对应的目标数据;其中,所述CDN缓存设备用于对所述应用服务器从包括数据库在内的其他设备处获取到的数据进行缓存; 当查询到所述CDN缓存设备内存储有所述目标数据时,对所述目标数据进行所述数据请求消息所指示的读操作或写操作; 在确定所述CDN缓存设备内没有存储所述目标数据时,从存储有所述目标数据的设备处获取所述目标数据,将获取的所述目标数据存储到所述CDN缓存设备内,并在获取的所述目标数据存储到所述CDN缓存设备内后,对所述CDN缓存设备内存储的所述目标数 1. A method of reading and writing data, characterized by comprising: an application server receiving data sent by a client request message; the data request message includes identification information of the target data; according to the identification information, queries the application server the access to the content delivery network CDN distance the application server is stored within the last CDN cache device with said identification information corresponding to the target data; wherein, the CDN cache device for the application server from the group consisting database Get other devices at the inside of the data cache; when a query to the CDN cache device stored therein the target data, the target data, the data request read operation message indicated or write operation; in when determining not to store the target data within the CDN cache device from the stored acquire the target data device at the target data, to acquire the target data is stored in the CDN cache device, and acquires after the target data stored into the CDN cache apparatus, the target number of said CDN cache device storage 据进行所述数据请求消息所指示的读操作或写操作。 It performs the data read is requested message indicated or write operation.
  2. 2.根据权利要求1所述的方法,其特征在于,所述应用服务器在确定所述CDN缓存设备内没有存储所述目标数据时,从存储有所述目标数据的设备处获取所述目标数据,包括: 所述应用服务器在确定所述CDN缓存设备内没有存储所述目标数据时,确定分布式缓存设备Cbase内是否存储有所述标识信息对应的目标数据; 若确定分布式缓存设备Cbase内存储有所述标识信息对应的目标数据,则从所述Cbase处获取所述目标数据; 若确定所述Cbase内没有存储所述标识信息对应的目标数据,则从所述数据库内获取所述目标数据。 According to claim 1 of the method, wherein the application server determining that the CDN caching device within not store the target data from stores with the target data at the device to acquire the target data , including: the application server determining that the CDN caching device within not store the target data, to determine the distributed cache device Cbase within whether stored the identification information corresponding to the target data; if it is determined distributed caching device Cbase within stores the identification information corresponding to the target data, to acquire the target data from said Cbase place; if it is determined there is no target data storing said identification information corresponding to said Cbase, from the database to acquire the target data. ` `
  3. 3.根据权利要求2所述的方法,其特征在于,所述标识信息包括数据键值Key ;则所述应用服务器确定分布式缓存设备Cbase内是否存储有所述标识信息对应的目标数据,包括: 所述应用服务器确定所述Cbase内是否存在与所述Key对应的数据值Value ; 若确定所述Cbase内存在与所述Key对应的数据值Value,则确定所述Cbase内存储有所述目标数据; 若确定所述Cbase内不存在与所述Key对应的数据值Value,则确定所述Cbase内未存储有所述目标数据。 3. The method according to claim 2, wherein said identification information comprises a data key Key; if the application server determines whether to store within the distributed cache device Cbase information corresponding to the target data of the identifier, comprising : the application server determines whether there is the Key corresponding to the data value value said Cbase; if it is determined the Cbase memory in the Key data value corresponding to value, it is determined that said Cbase stores the target transactions; if determined that there is the Key data value corresponding to value, it is determined not stored within said Cbase for the target data in the Cbase.
  4. 4.根据权利要求2所述的方法,其特征在于,所述数据请求消息还包括与所述目标数据相关的其他目标数据的标识信息;则所述应用服务器对所述目标数据进行所述数据请求消息所指示的读操作或写操作之后,所述方法还包括: 所述应用服务器将所述数据库内存储的所述其他目标数据存储到所述Cbase内,以便所述应用服务器在接收到包含所述其他目标数据的标识信息的数据请求消息时,将所述Cbase内存储的所述其他目标数据存储到所述CDN缓存设备内。 4. The method according to claim 2, wherein said data request message further includes identification information of additional target data associated with the target data; if the application server the data of the target data after requesting a read operation message indicated or write operations, the method further comprising: the application server, the said database storing additional target data is stored in the Cbase, so that the application server receiving comprises the data identification information of the other object data request message, storing the stored within the Cbase additional target data within the CDN cache device.
  5. 5.根据权利要求2至4任一项所述的方法,其特征在于,在所述应用服务器对所述目标数据进行所述数据请求消息所指示的写操作后,所述方法还包括: 所述应用服务器根据所述CDN缓存设备内的被执行了所述写操作的所述目标数据,更新所述Cbase和所述数据库。 5. The method of any of claims 2-4 claim, characterized in that, for the data of the target data in the application server requests a write operation message indicated, the method further comprising: the said application server according been performed within the CDN cache device of the writing operation of the target data, updating the Cbase and the database.
  6. 6.一种应用服务器,其特征在于,包括: 接收单元,用于接收客户端发送的数据请求消息;所述数据请求消息包括目标数据的标识信息; 处理单元,用于根据所述标识信息,查询所述应用服务器所接入的内容分发网络CDN中距离所述应用服务器最近的CDN缓存设备内是否存储有所述标识信息对应的目标数据;当查询到所述CDN缓存设备内存储有所述目标数据时,对所述目标数据进行所述数据请求消息所指示的读操作或写操作;其中,所述CDN缓存设备用于对所述应用服务器从包括数据库在内的其他设备处获取到的数据进行缓存; 所述处理单元还用于,在确定所述CDN缓存设备内没有存储所述目标数据时,从存储有所述目标数据的设备处获取所述目标数据,将获取的所述目标数据存储到所述CDN缓存设备内,并在获取的所述目标数据存储到所述CDN缓存设备内后, An application server, characterized by comprising: a receiving unit for receiving the client sends the data request message; the data request message includes the target data identification information; a processing unit, according to the identification information, querying the application server accesses the content distribution network in the CDN from the application server is stored within the last CDN cache device with said identification information corresponding to the target data; when the query into the CDN cache device stores the when the target data, the data request message indicated by the read or write operation on the target data; wherein, the CDN cache device is configured to obtain from the device at the other, including the database to the application server the target of the processing unit is further configured to, when it is determined not to store the target data within the CDN cache device from the stored device at the target data to acquire the target data acquired; data cache the target data store data into the CDN cache device, and stores the acquired after said CDN cache device, 所述CDN缓存设备内存储的所述目标数据进行所述数据请求消息所指示的读操作或写操作。 The target data in the buffer device stored in the CDN for the data request read operation message indicated or write operation.
  7. 7.根据权利要求6所述的应用服务器,其特征在于,所述处理单元具体用于: 在确定所述CDN缓存设备内没有存储所述目标数据时,确定分布式缓存设备Cbase内是否存储有所述标识信息对应的目标数据; 若确定分布式缓存设备Cbase内存储有所述标识信息对应的目标数据,则从所述Cbase处获取所述目标数据; 若确定所述Cbase内没有存储所述标识信息对应的目标数据,则从所述数据库内获取所述目标数据。 The use of claim server of claim 6, wherein the processing unit is specifically configured to: when it is determined not to store the target data within the CDN cache device, determine whether to store within the distributed cache device Cbase have the identification information corresponding to the target data; if it is determined within the distributed cache device Cbase stores target data of the identification information corresponding to from the Cbase at acquiring the target data; if it is determined not to store the said Cbase identification information corresponding to the target data, obtaining the target data within said from the database.
  8. 8.根据权利要求7所述的应用服务器,其特征在于,所述标识信息包括数据键值Key ;则所述处理单元具体用于,确定所述Cbase内是否存在与所述Key对应的数据值Value ; 若确定所述Cbase内存在与所述Key对应的数据值Value,则确定所述Cbase内存储有所述目标数据; 若确定所述Cbase内不存在与所述Key对应的数据值Value,则确定所述Cbase内未存储有所述目标数据。 According to claim application server of claim 7, wherein said identification information comprises a data key Key; the processing unit is configured to determine whether there is the Key corresponding to data values ​​within said Cbase value; if it is determined the Cbase memory in the Key data value corresponding to value, it is determined that the Cbase stored therein the target data; the Key corresponding to the data value value does not exist in when determining the Cbase, it is determined not stored target data within the Cbase.
  9. 9.根据权利要求7所述的应用服务器,其特征在于,所述数据请求消息还包括与所述目标数据相关的其他目标数据的标识信息;则所述处理单元还用于,将所述数据库内存储的所述其他目标数据存储到所述Cbase内,以便所述应用服务器在接收到包含所述其他目标数据的标识信息的数据请求消息时,将所述Cbase内存储的所述其他目标数据存储到所述⑶N缓存设备内。 According to claim application server of claim 7, wherein said data request message further includes identification information of additional target data associated with the target data; the processing unit is further configured, the database said stored within other target data is stored in the Cbase, so that the application server is received containing data of the other target data identification information request message, the said Cbase stored within the other target data It is stored in the ⑶N cache device.
  10. 10.根据权利要求7至9任一项所述的应用服务器,其特征在于,在所述对所述目标数据进行所述数据请求消息所指示的写操作后,所述处理单元还用于,根据所述CDN缓存设备内的被执行了所述写操作的所述目标数据,更新所述Cbase和所述数据库。 10. The application server according to claim 7-1 according to claims 9, characterized in that, for the data of the target data in the request message indicated by the write operation, the processing unit is further configured to, according been performed within the CDN cache device of the writing operation of the target data, updating the Cbase and the database.
CN 201310745987 2013-12-30 2013-12-30 Data reading and writing method and application server CN103747072A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201310745987 CN103747072A (en) 2013-12-30 2013-12-30 Data reading and writing method and application server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201310745987 CN103747072A (en) 2013-12-30 2013-12-30 Data reading and writing method and application server

Publications (1)

Publication Number Publication Date
CN103747072A true true CN103747072A (en) 2014-04-23

Family

ID=50504058

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201310745987 CN103747072A (en) 2013-12-30 2013-12-30 Data reading and writing method and application server

Country Status (1)

Country Link
CN (1) CN103747072A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104391662A (en) * 2014-12-12 2015-03-04 北京奇虎科技有限公司 Data reading and writing method and device
CN104765888A (en) * 2015-04-30 2015-07-08 北京奇艺世纪科技有限公司 Data access system, method and device
WO2015196692A1 (en) * 2014-06-24 2015-12-30 中兴通讯股份有限公司 Cloud computing system and processing method and apparatus for cloud computing system
CN105447171A (en) * 2015-12-07 2016-03-30 北京奇虎科技有限公司 Data caching method and apparatus
CN105915600A (en) * 2016-04-13 2016-08-31 乐视控股(北京)有限公司 Data writing-in method based CDN network system and CDN network system thereof

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002071242A1 (en) * 2001-03-01 2002-09-12 Akamai Technologies, Inc. Optimal route selection in a content delivery network
CN1777880A (en) * 2002-02-14 2006-05-24 塞维斯公司 Managed object replication and delivery
CN102047244A (en) * 2008-04-04 2011-05-04 第三雷沃通讯有限责任公司 Handling long-tail content in a content delivery network (CDN)
CN102231749A (en) * 2011-08-12 2011-11-02 乐视网信息技术(北京)股份有限公司 System and method for transmitting live stream by utilizing content delivery network (CDN)
CN103268318A (en) * 2013-04-16 2013-08-28 华中科技大学 Distributed key value database system with strong consistency and read-write method thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002071242A1 (en) * 2001-03-01 2002-09-12 Akamai Technologies, Inc. Optimal route selection in a content delivery network
CN1777880A (en) * 2002-02-14 2006-05-24 塞维斯公司 Managed object replication and delivery
CN102047244A (en) * 2008-04-04 2011-05-04 第三雷沃通讯有限责任公司 Handling long-tail content in a content delivery network (CDN)
CN102231749A (en) * 2011-08-12 2011-11-02 乐视网信息技术(北京)股份有限公司 System and method for transmitting live stream by utilizing content delivery network (CDN)
CN103268318A (en) * 2013-04-16 2013-08-28 华中科技大学 Distributed key value database system with strong consistency and read-write method thereof

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015196692A1 (en) * 2014-06-24 2015-12-30 中兴通讯股份有限公司 Cloud computing system and processing method and apparatus for cloud computing system
CN104391662A (en) * 2014-12-12 2015-03-04 北京奇虎科技有限公司 Data reading and writing method and device
CN104765888A (en) * 2015-04-30 2015-07-08 北京奇艺世纪科技有限公司 Data access system, method and device
CN105447171A (en) * 2015-12-07 2016-03-30 北京奇虎科技有限公司 Data caching method and apparatus
CN105915600A (en) * 2016-04-13 2016-08-31 乐视控股(北京)有限公司 Data writing-in method based CDN network system and CDN network system thereof

Similar Documents

Publication Publication Date Title
US7555484B2 (en) Load balancing based on cache content
US20070260609A1 (en) System and method for high throughput with remote storage servers
US20130054514A1 (en) System and Method for Providing Offline Access in a Hosted Document Service
US6973546B2 (en) Method, system, and program for maintaining data in distributed caches
US20110289126A1 (en) Content delivery network
US20110213894A1 (en) Mechanism for supporting user content feeds
Dong et al. A novel approach to improving the efficiency of storing and accessing small files on hadoop: a case study by powerpoint files
US7818324B1 (en) Searching indexed and non-indexed resources for content
US20110145321A1 (en) Setting Cookies in Conjunction with Phased Delivery of Structured Documents
US8108377B2 (en) Predictive resource identification and phased delivery of structured documents
US20110161825A1 (en) Systems and methods for testing multiple page versions across multiple applications
US20110093461A1 (en) Extensible Custom Variables for Tracking User Traffic
CN102385594A (en) Method and device for controlling inner cores of multi-core browser
US8645362B1 (en) Using resource load times in ranking search results
CN102402518A (en) Method and device for accessing webpage
Das et al. Big data analytics: A framework for unstructured data analysis
CN103886090A (en) Content recommendation method and device based on user favorites
US20110022582A1 (en) Indexing of Partitioned External Data Sources
CN102624920A (en) Method and device for performing access through proxy server
CN101997927A (en) Method and system for caching data of WEB platform
US20140040231A1 (en) Methods and systems for searching software applications
US20110302485A1 (en) Component-based content rendering system
US20120016857A1 (en) System and method for providing search engine optimization analysis
US20110276569A1 (en) Caching electronic document resources in a client device having an electronic resource database
US20120084297A1 (en) Network-Resource-Specific Search Assistance

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
C41 Transfer of patent application or patent right or utility model