[go: up one dir, main page]

CN105915619A - Access heat regarded cyber space information service high performance memory caching method - Google Patents

Access heat regarded cyber space information service high performance memory caching method Download PDF

Info

Publication number
CN105915619A
CN105915619A CN201610283274.5A CN201610283274A CN105915619A CN 105915619 A CN105915619 A CN 105915619A CN 201610283274 A CN201610283274 A CN 201610283274A CN 105915619 A CN105915619 A CN 105915619A
Authority
CN
China
Prior art keywords
cache
request
address
memory
cache object
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610283274.5A
Other languages
Chinese (zh)
Other versions
CN105915619B (en
Inventor
郭明强
黄颖
谢忠
吴亮
罗显刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Zhongdi University Ecological Environment Research Institute Co ltd
Original Assignee
China University of Geosciences Wuhan
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 China University of Geosciences Wuhan filed Critical China University of Geosciences Wuhan
Priority to CN201610283274.5A priority Critical patent/CN105915619B/en
Publication of CN105915619A publication Critical patent/CN105915619A/en
Application granted granted Critical
Publication of CN105915619B publication Critical patent/CN105915619B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5682Policies or rules for updating, deleting or replacing the stored data
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

本发明公开了一种顾及访问热度的网络空间信息服务高性能内存缓存方法,包括以下步骤:服务器端接收客户端发送的空间数据请求,获得请求的访问地址;将地址作为关键字在全局内存缓存中检索缓存对象,如果检索没命中,则将客户端请求地址作为关键字从临时缓存中检索对应的临时缓存对象,若检索命中,根据临时缓存对象的访问次数决定是否加入全局内存缓存中,若未命中,则将当前请求信息加入到临时缓存。本发明方法能够控制缓存模块仅将访问热度达到一定阈值的空间数据缓存到有限的服务器内存中,减少内存缓存的置换次数,避免过多地对内存缓存数据进行淘汰处理,提高服务器端的内存缓存性能和网络空间信息服务的并发访问性能。

The invention discloses a high-performance memory caching method for network space information service in consideration of access heat, which comprises the following steps: the server end receives the space data request sent by the client, and obtains the requested access address; uses the address as a key in the global memory cache Retrieve the cache object in the cache object. If the retrieval misses, use the address requested by the client as a key to retrieve the corresponding temporary cache object from the temporary cache. If the retrieval hits, decide whether to add it to the global memory cache according to the number of accesses of the temporary cache object. If If there is a miss, add the current request information to the temporary cache. The method of the invention can control the cache module to only cache the space data whose access heat reaches a certain threshold in the limited server memory, reduce the number of memory cache replacements, avoid excessive elimination of memory cache data, and improve the memory cache performance of the server and the concurrent access performance of cyberspatial information services.

Description

顾及访问热度的网络空间信息服务高性能内存缓存方法A high-performance memory caching method for cyberspace information services taking into account access heat

技术领域 technical field

本发明涉及网络地理信息系统技术,尤其是一种顾及访问热度的网络空间信息服务高性能内存缓存方法。 The invention relates to network geographic information system technology, in particular to a high-performance memory caching method for network space information service taking into account access heat.

背景技术 Background technique

网络空间信息服务高性能内存缓存是网络地理信息系统(WebGIS)中需要解决的重要问题之一,利用服务器内存的高性能并发读写性能,将网络空间信息服务请求数据缓存到服务器的高速内存中,能够提高客户端请求的并发响应效率,但服务器的内存资源是有限的,对于大规模的海量空间数据,只能缓存部分数据到服务器的内存中,当大用户量密集并发访问时,由于大量临时访问数据被加入到有限的内存缓存中,会导致频繁地对内存缓存中的数据进行淘汰处理,降低了内存缓存的效率和缓存命中率。 High-performance memory caching of web space information service is one of the important problems to be solved in web geographic information system (WebGIS). Utilizing the high-performance concurrent read and write performance of server memory, the web space information service request data is cached in the high-speed memory of the server , can improve the efficiency of concurrent response to client requests, but the memory resources of the server are limited. For large-scale massive spatial data, only part of the data can be cached in the server's memory. When a large number of users access intensively concurrently, due to a large number Temporary access data is added to the limited memory cache, which will result in frequent elimination of data in the memory cache, reducing the efficiency of the memory cache and the cache hit rate.

发明内容 Contents of the invention

本发明要解决的技术问题在于针对现有技术中的缺陷,提供一种顾及访问热度的网络空间信息服务高性能内存缓存方法,降低服务器上内存缓存的淘汰频率,提高网络空间信息服务内存缓存性能。 The technical problem to be solved by the present invention is to provide a high-performance memory caching method for cyberspace information services that takes into account the access heat to reduce the elimination frequency of memory caches on servers and improve the performance of memory caching for cyberspace information services in view of the defects in the prior art .

本发明解决其技术问题所采用的技术方案是:一种顾及访问热度的网络空间信息服务高性能内存缓存方法,其包括以下步骤: The technical solution adopted by the present invention to solve the technical problem is: a high-performance memory caching method for cyberspace information services that takes into account access heat, which includes the following steps:

步骤1:设置服务器端的空间数据请求次数缓存阈值(ACT),全局内存缓存对象最大个数(GCT),临时缓存对象最大个数(TCT)。 Step 1: Set the server-side spatial data request cache threshold (ACT), the maximum number of global memory cache objects (GCT), and the maximum number of temporary cache objects (TCT).

步骤2:服务器端接收客户端发送的空间数据请求,获得请求的访问地址。 Step 2: The server receives the spatial data request sent by the client, and obtains the requested access address.

步骤3:将地址作为关键字从全局内存缓存中去检索缓存对象,如果全局缓存命中,转步骤4;如果全局内存缓存没命中,转步骤6。 Step 3: Use the address as a key to retrieve the cached object from the global memory cache. If the global memory cache is hit, go to step 4; if the global memory cache is not hit, go to step 6.

步骤4:更新命中的全局内存缓存对象的最后访问时间属性。 Step 4: Update the last access time attribute of the hit global memory cache object.

步骤5:将命中的缓存对象中存储的结果数据直接返回给客户端,结束。 Step 5: directly return the result data stored in the hit cache object to the client, and end.

步骤6:从空间数据库中检索客户端请求的数据。 Step 6: Retrieve the data requested by the client from the spatial database.

步骤7:将结果数据返回给客户端。 Step 7: Return the result data to the client.

步骤8:将客户端请求地址作为关键字从临时缓存中检索对应的临时缓存对象,如果临时缓存命中,转步骤9;如果临时缓存未命中,转步骤15。 Step 8: Use the client request address as a key to retrieve the corresponding temporary cache object from the temporary cache. If the temporary cache is hit, go to step 9; if the temporary cache is not hit, go to step 15.

步骤9:获取临时缓存对象的访问次数(RAC)。如果RAC>ACT,转步骤10;反之则转步骤14。 Step 9: Obtain the access count (RAC) of the temporary cache object. If RAC>ACT, go to step 10; otherwise, go to step 14.

步骤10:将当前请求得到的结果数据增加到全局内存缓存中。 Step 10: Add the result data obtained by the current request to the global memory cache.

步骤11:删除当前请求的临时缓存对象, Step 11: Delete the temporary cache object of the current request,

步骤12:获取全局内存缓存中的缓存个数(GCC),如果GCC>GCT,转步骤13,如果GCC<GCT,结束。 Step 12: Obtain the number of caches (GCC) in the global memory cache. If GCC>GCT, go to step 13. If GCC<GCT, end.

步骤13:删除全局内存缓存中最久未被访问的一个缓存对象,结束。 Step 13: Delete a cache object that has not been accessed for the longest time in the global memory cache, and end.

步骤14:将临时缓存对象的访问次数(RAC)加1,并更新临时缓存对象的最后访问时间,结束。 Step 14: Add 1 to the access count (RAC) of the temporary cache object, and update the last access time of the temporary cache object, and end.

步骤15:将当前请求的临时缓存对象的访问次数初始为1,并将其增加到临时缓存中。 Step 15: Initialize the access count of the temporary cache object currently requested as 1, and add it to the temporary cache.

步骤16:获取临时缓存中的缓存对象个数(TCC),如果TCC>TCT,转步骤17;如果TCC<TCT,结束。 Step 16: Obtain the number of cache objects (TCC) in the temporary cache, if TCC>TCT, go to step 17; if TCC<TCT, end.

步骤17:删除临时缓存中最久未被访问的一个缓存对象,结束。 Step 17: Delete a cache object that has not been accessed for the longest time in the temporary cache, and end.

按上述方案,所述步骤1)中临时缓存和全局缓存都采用键值对的形式存储,其中,键均为请求的地址,值分别为临时缓存对象和全局缓存对象。 According to the above solution, both the temporary cache and the global cache in step 1) are stored in the form of key-value pairs, where the key is the requested address, and the values are the temporary cache object and the global cache object respectively.

按上述方案,所述每个临时缓存对象的值中包括其键对应的请求地址的最后访问时间和对该地址的访问次数;所述每个全局缓存对象的值中包括其键对应的请求地址的最后访问时间和该请求对应的结果数据。 According to the above scheme, the value of each temporary cache object includes the last access time of the request address corresponding to its key and the number of visits to this address; the value of each global cache object includes the request address corresponding to its key The last access time of and the result data corresponding to the request.

按上述方案,所述步骤9)中,仅当请求地址的访问次数超过阈值时才将请求地址对应的结果数据缓存到全局缓存中。 According to the above solution, in the step 9), the result data corresponding to the request address is cached in the global cache only when the number of visits to the request address exceeds the threshold.

本发明的有益效果是能够根据网络空间信息服务访问请求的访问热度来判断是否将请求数据缓存到服务器的内存缓存中,以避免将一些临时访问次数较少的数据存储到服务器的内存缓存中,减少服务器内存缓存的转换次数,提高服务器端内存缓存效率和缓存命中率,提高网络空间信息服务的大用户量并发请求处理性能。 The beneficial effect of the present invention is that it is possible to judge whether to cache the requested data in the memory cache of the server according to the access heat of the network space information service access request, so as to avoid storing some data with a small number of temporary visits in the memory cache of the server, Reduce the number of server memory cache conversions, improve server-side memory cache efficiency and cache hit rate, and improve the performance of concurrent request processing for a large number of users of cyberspace information services.

附图说明 Description of drawings

下面将结合附图及实施例对本发明作进一步说明,附图中: The present invention will be further described below in conjunction with accompanying drawing and embodiment, in the accompanying drawing:

图1是本发明的方法流程图。 Fig. 1 is a flow chart of the method of the present invention.

具体实施方式 detailed description

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。 In order to make the object, technical solution and advantages of the present invention more clear, the present invention will be further described in detail below in conjunction with the examples. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

如图1所示,图1是本发明提供的顾及访问热度的网络空间信息服务高性能内存缓存方法流程图,所述方法包括以下步骤: As shown in Figure 1, Figure 1 is a flow chart of a high-performance memory caching method for cyberspace information services that takes into account access heat provided by the present invention, and the method includes the following steps:

步骤1:设置服务器端的空间数据请求次数缓存阈值(ACT),全局内存缓存对象最大个数(GCT),临时缓存对象最大个数(TCT)。 Step 1: Set the server-side spatial data request cache threshold (ACT), the maximum number of global memory cache objects (GCT), and the maximum number of temporary cache objects (TCT).

步骤2:服务器端接收客户端发送的空间数据请求,获得请求访问的HTTP地址。 Step 2: The server receives the spatial data request sent by the client, and obtains the HTTP address for the requested access.

步骤3:将地址作为关键字从全局内存缓存中去检索缓存对象,如果全局缓存命中,转步骤4;如果全局内存缓存没命中,转步骤6。 Step 3: Use the address as a key to retrieve the cached object from the global memory cache. If the global memory cache is hit, go to step 4; if the global memory cache is not hit, go to step 6.

全局缓存对象使用键值对的形式存储,请求访问的HTTP地址作为键,值为一个全局缓存对象类(GlobalCacheItem),其包含请求的结果数据(data)和请求的最后访问时间(lastAccessTime)。全局缓存对象类定义如下: The global cache object is stored in the form of key-value pairs. The HTTP address of the request is used as the key, and the value is a global cache object class (GlobalCacheItem), which contains the result data of the request (data) and the last access time of the request (lastAccessTime). The global cache object class is defined as follows:

Public class GlobalCacheItem Public class GlobalCacheItem

{ {

Public byte[] data; Public byte[] data;

Public DateTime lastAccessTime; Public DateTime lastAccessTime;

} }

步骤4:获取命中的全局内存缓存对象(globalCacheObj),更新globalCacheObj的最后访问时间(lastAccessTime)属性,将其更新为当前时间。 Step 4: Obtain the hit global memory cache object (globalCacheObj), update the last access time (lastAccessTime) attribute of globalCacheObj, and update it to the current time.

步骤5:将命中的缓存对象中存储的结果数据(globalCacheObj.data)直接返回给客户端,结束。 Step 5: directly return the result data (globalCacheObj.data) stored in the hit cache object to the client, and end.

步骤6:从空间数据库中检索客户端请求的数据。 Step 6: Retrieve the data requested by the client from the spatial database.

步骤7:将结果数据返回给客户端。 Step 7: Return the result data to the client.

步骤8:将客户端请求地址作为关键字从临时缓存中检索对应的临时缓存对象,如果临时缓存命中,转步骤9;如果临时缓存未命中,转步骤15。 Step 8: Use the client request address as a key to retrieve the corresponding temporary cache object from the temporary cache. If the temporary cache is hit, go to step 9; if the temporary cache is not hit, go to step 15.

临时缓存对象使用键值对的形式存储,请求访问的HTTP地址作为键,值为一个临时缓存对象类(TempCacheItem),其包含请求的访问次数(RAC)和请求的最后访问时间(lastAccessTime)。临时缓存对象类定义如下: Temporary cache objects are stored in the form of key-value pairs. The HTTP address of the requested access is used as the key, and the value is a temporary cache object class (TempCacheItem), which contains the number of requested accesses (RAC) and the last access time of the request (lastAccessTime). The temporary cache object class is defined as follows:

Public class TempCacheItem Public class TempCacheItem

{ {

Public int RAC; Public int RAC;

Public DateTime lastAccessTime; Public DateTime lastAccessTime;

} }

步骤9:获取命中的临时缓存对象(tempCacheObj),获取临时缓存对象的访问次数(tempCacheObj.RAC)。如果tempCacheObj.RAC>ACT,转步骤10;反之则转步骤14。 Step 9: Obtain the hit temporary cache object (tempCacheObj), and obtain the access times of the temporary cache object (tempCacheObj.RAC). If tempCacheObj.RAC>ACT, go to step 10; otherwise, go to step 14.

步骤10:将步骤6中得到的当前请求的结果数据增加到全局内存缓存中。 Step 10: Add the result data of the current request obtained in step 6 to the global memory cache.

步骤11:删除当前请求的临时缓存对象(tempCacheObj), Step 11: Delete the temporary cache object (tempCacheObj) of the current request,

步骤12:获取全局内存缓存中的缓存个数(GCC),如果GCC>GCT,转步骤13,如果GCC<GCT,结束。 Step 12: Obtain the number of caches (GCC) in the global memory cache. If GCC>GCT, go to step 13. If GCC<GCT, end.

步骤13:根据全局内存缓存中各个缓存对象的最后访问时间属性(lastAccessTime),删除全局内存缓存中最久未被访问的一个缓存对象,结束。 Step 13: According to the last access time attribute (lastAccessTime) of each cache object in the global memory cache, delete a cache object that has not been accessed for the longest time in the global memory cache, and end.

步骤14:将临时缓存对象的访问次数(tempCacheObj.RAC)加1,并更新临时缓存对象的最后访问时间(tempCacheObj.lastAccessTime),结束。 Step 14: Add 1 to the access count (tempCacheObj.RAC) of the temporary cache object, and update the last access time (tempCacheObj.lastAccessTime) of the temporary cache object, and end.

步骤15:为当前请求新建一个临时缓存对象,将当前请求的临时缓存对象的访问次数(RAC)初始为1,最后访问时间(lastAccessTime)初始为当前时间,并将其增加到临时缓存中。 Step 15: Create a new temporary cache object for the current request, initialize the access count (RAC) of the temporary cache object of the current request to 1, and initialize the last access time (lastAccessTime) to the current time, and add it to the temporary cache.

步骤16:获取临时缓存中的缓存对象个数(TCC),如果TCC>TCT,转步骤17;如果TCC<TCT,结束。 Step 16: Obtain the number of cache objects (TCC) in the temporary cache, if TCC>TCT, go to step 17; if TCC<TCT, end.

步骤17:根据临时缓存中各个缓存对象的最后访问时间属性(lastAccessTime),删除临时缓存中最久未被访问的一个缓存对象,结束。 Step 17: According to the last access time attribute (lastAccessTime) of each cache object in the temporary cache, delete a cache object that has not been accessed for the longest time in the temporary cache, and end.

本发明最明显的不同在于增加了临时缓存模块,当服务器接收到大用户量并发访问请求时,不直接将新的请求的结果数据增加到全局内存缓存中,而仅将请求的访问次数和最后访问时间存储到临时缓存中,当访问次数超过预设的阈值时才将请求的结果数据缓存到全局内存缓存中。此方法能够避免临时访问次数较少的数据被存储到全局内存缓存中,减少全局内存缓存的置换频率,提高全局内存缓存效率和命中率,提高网络空间信息服务的并发处理性能,尤其是在服务器内存资源较少时,该方法的优势更加明显。 The most obvious difference of the present invention is the addition of a temporary cache module. When the server receives concurrent access requests from a large number of users, it does not directly add the result data of the new request to the global memory cache, but only adds the requested access times and the last The access time is stored in the temporary cache, and the requested result data is cached in the global memory cache only when the number of accesses exceeds the preset threshold. This method can prevent data with a small number of temporary accesses from being stored in the global memory cache, reduce the replacement frequency of the global memory cache, improve the efficiency and hit rate of the global memory cache, and improve the concurrent processing performance of the network space information service, especially in the server The advantage of this approach is even more pronounced when memory resources are low.

实施例一: Embodiment one:

为了更清晰的说明本发明的思想,下面对顾及访问热度的网络空间信息服务高性能内存缓存方法进行进一步的说明,以网络空间信息服务中的OGC WMS服务的GetCapabilities请求为例,空间数据请求次数缓存阈值设置为10,全局内存缓存对象最大个数设置为10000,临时缓存对象最大个数设置为100。具体步骤如下: In order to illustrate the idea of the present invention more clearly, the following is a further description of the high-performance memory caching method for cyberspace information services that takes into account access heat, using OGC in cyberspace information services Take the GetCapabilities request of the WMS service as an example. The cache threshold for the number of spatial data requests is set to 10, the maximum number of global memory cache objects is set to 10,000, and the maximum number of temporary cache objects is set to 100. Specific steps are as follows:

步骤1:设置服务器端的空间数据请求次数缓存阈值(ACT=10),全局内存缓存对象最大个数(GCT=10000),临时缓存对象最大个数(TCT=100)。 Step 1: Set the server-side cache threshold for spatial data requests (ACT=10), the maximum number of global memory cache objects (GCT=10000), and the maximum number of temporary cache objects (TCT=100).

步骤2:服务器端接收客户端发送的WMS服务的GetCapabilities请求,获得GetCapabilities请求访问的HTTP地址,请求地址格式如下: Step 2: The server receives the GetCapabilities request of the WMS service sent by the client, and obtains the HTTP address accessed by the GetCapabilities request. The format of the request address is as follows:

http://domain/wms?REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS http://domain/wms?REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS

步骤3:将步骤2中获得的地址作为关键字从全局内存缓存中去检索缓存对象,如果全局缓存命中,转步骤4;如果全局内存缓存没命中,转步骤6。 Step 3: Use the address obtained in step 2 as a key to retrieve the cached object from the global memory cache. If the global memory cache is hit, go to step 4; if the global memory cache is not hit, go to step 6.

步骤4:获取命中的全局内存缓存对象(globalCacheObj),更新globalCacheObj的最后访问时间(lastAccessTime)属性,将其更新为当前时间。 Step 4: Obtain the hit global memory cache object (globalCacheObj), update the last access time (lastAccessTime) attribute of globalCacheObj, and update it to the current time.

步骤5:将命中的缓存对象中存储的结果数据(globalCacheObj.data)直接返回给客户端,结束。 Step 5: directly return the result data (globalCacheObj.data) stored in the hit cache object to the client, and end.

步骤6:从空间数据库中检索客户端请求的数据,按照WMS服务的接口规范生成符合GetCapabilities服务接口要求的结果数据。 Step 6: Retrieve the data requested by the client from the spatial database, and generate result data that meets the requirements of the GetCapabilities service interface according to the interface specification of the WMS service.

步骤7:将结果数据返回给客户端。 Step 7: Return the result data to the client.

步骤8:将客户端请求地址作为关键字从临时缓存中检索对应的临时缓存对象,如果临时缓存命中,转步骤9;如果临时缓存未命中,转步骤15。 Step 8: Use the client request address as a key to retrieve the corresponding temporary cache object from the temporary cache. If the temporary cache is hit, go to step 9; if the temporary cache is not hit, go to step 15.

步骤9:获取命中的临时缓存对象(tempCacheObj),获取临时缓存对象的访问次数(tempCacheObj.RAC)。如果tempCacheObj.RAC>10,转步骤10;反之则转步骤14。 Step 9: Obtain the hit temporary cache object (tempCacheObj), and obtain the access times of the temporary cache object (tempCacheObj.RAC). If tempCacheObj.RAC>10, go to step 10; otherwise, go to step 14.

步骤10:使用步骤2中获得的客户端请求地址作为键,创建一个新的GlobalCacheItem类的实例对象(globalItem),设置其lastAccessTime属性为当前时间,并设置为data属性为步骤6中得到的当前请求的结果数据,然后将该请求的全局缓存对象globalItem增加到全局内存缓存中。 Step 10: Use the client request address obtained in step 2 as a key to create a new instance object (globalItem) of the GlobalCacheItem class, set its lastAccessTime property to the current time, and set its data property to the current request obtained in step 6 The result data, and then add the requested global cache object globalItem to the global memory cache.

步骤11:删除当前请求的临时缓存对象(tempCacheObj), Step 11: Delete the temporary cache object (tempCacheObj) of the current request,

步骤12:获取全局内存缓存中的缓存个数(GCC),如果GCC>10000,转步骤13,如果GCC<10000,结束。 Step 12: Obtain the number of caches (GCC) in the global memory cache. If GCC>10000, go to step 13. If GCC<10000, end.

步骤13:根据全局内存缓存中各个缓存对象的最后访问时间属性(lastAccessTime),删除全局内存缓存中最久未被访问的一个缓存对象,结束。 Step 13: According to the last access time attribute (lastAccessTime) of each cache object in the global memory cache, delete a cache object that has not been accessed for the longest time in the global memory cache, and end.

步骤14:将临时缓存对象的访问次数(tempCacheObj.RAC)加1,并更新临时缓存对象的最后访问时间(tempCacheObj.lastAccessTime)为当前时间,结束。 Step 14: Add 1 to the access times (tempCacheObj.RAC) of the temporary cache object, and update the last access time (tempCacheObj.lastAccessTime) of the temporary cache object to the current time, and end.

步骤15:为当前请求新建一个TempCacheItem类的实例对象(tempItem),将其访问次数(RAC)初始为1,最后访问时间(lastAccessTime)初始为当前时间,使用步骤2中获得的客户端请求地址作为键,将该请求的临时缓存对象tempItem增加到临时缓存中。 Step 15: Create a new TempCacheItem instance object (tempItem) for the current request, set its access count (RAC) to 1 initially, and the last access time (lastAccessTime) to the current time, and use the client request address obtained in step 2 as key, add the temporary cache object tempItem of the request to the temporary cache.

步骤16:获取临时缓存中的缓存对象个数(TCC),如果TCC>100,转步骤17;如果TCC<100,结束。 Step 16: Obtain the number of cache objects (TCC) in the temporary cache, if TCC>100, go to step 17; if TCC<100, end.

步骤17:根据临时缓存中各个缓存对象的最后访问时间属性(lastAccessTime),删除临时缓存中最久未被访问的一个缓存对象,结束。 Step 17: According to the last access time attribute (lastAccessTime) of each cache object in the temporary cache, delete a cache object that has not been accessed for the longest time in the temporary cache, and end.

采用本发明设计的顾及访问热度的网络空间信息服务高性能内存缓存方法,在服务器端接收大用户量的并发访问请求时,能够避免临时访问的请求数据过多地加入到全局内存缓存中,有效地减少全局内存缓存的置换次数,有助于提高全局内存缓存的效率和命中率,提升大用户量密集并发访问时网络空间信息服务的并发处理性能。 Adopting the high-performance memory caching method of network space information service designed in the present invention, which takes into account the access heat, can prevent the temporary access request data from being added to the global memory cache too much when the server receives concurrent access requests from a large number of users, effectively Minimizing the replacement times of the global memory cache helps to improve the efficiency and hit rate of the global memory cache, and improves the concurrent processing performance of the network spatial information service when a large number of users intensively access concurrently.

应当理解的是,对本领域普通技术人员来说,可以根据上述说明加以改进或变换,而所有这些改进和变换都应属于本发明所附权利要求的保护范围。 It should be understood that those skilled in the art can make improvements or changes based on the above description, and all these improvements and changes should belong to the protection scope of the appended claims of the present invention.

Claims (4)

1. take the cyberspace information service high-performance memory cache method accessing temperature into account for one kind, it is characterised in that it comprises the following steps:
Step 1) arranges spatial data request number of times cache threshold ACT of server end, global memory's cache object maximum number GCT, temporal cache object maximum number TCT;
Step 2) received server-side client send spatial data request, it is thus achieved that the reference address of request;
Cache object is retrieved as keyword in global memory caches in address by step 3), if retrieval hit, goes to step 4) if in retrieval recklessly, going to step 6);
It is current time that step 4) updates the last time attribute that accesses of global memory's cache object of hit;
The result data of storage in the cache object of hit is directly returned to client by step 5), terminates;
Step 6) retrieves the data of client request from spatial database;
Result data is returned to client by step 7);
Client request address is retrieved the temporal cache object of correspondence from temporal cache by step 8) as keyword, if temporal cache hit object, goes to step 9);If temporal cache is miss object, go to step 15);
Step 9) obtains access times RAC of temporal cache object;If RAC > ACT, go to step 10);Otherwise then go to step 14);
The result data that current request is obtained by step 10) increases in global memory's caching;
Step 11) deletes the temporal cache object of current request;
Step 12) obtains caching number GCC in global memory's caching, if GCC>GCT, goes to step 13, if GCC<GCT, terminates;
Step 13: delete in global memory's caching and be not accessed for a global buffer object at most, terminate;
Access times RAC of temporal cache object are added 1 by step 14), and update the last access time of temporal cache object, terminate;
The object of current request is increased to as temporal cache object in temporal cache by step 15), and the access times of this temporal cache object are initially 1;
Step 16) obtain cache object number TCC in temporal cache, if TCC > TCT, go to step 17;If TCC < TCT, terminate;
Step 17) delete in temporal cache and be not accessed for a temporal cache object at most, terminate.
The cyberspace information service high-performance memory cache method taking access temperature into account the most according to claim 1, it is characterized in that, in described step 1), temporal cache and global buffer all use the form of key-value pair to store, wherein, key is the address of request, and value is respectively temporal cache object and global buffer object.
The cyberspace information service high-performance memory cache method taking access temperature into account the most according to claim 2, it is characterized in that, the value of described each temporal cache object includes the last access time of request address and the access times to this address that its key is corresponding;The value of described each global buffer object includes the result data corresponding with this request of the last access time of the request address that its key is corresponding.
The cyberspace information service high-performance memory cache method taking access temperature into account the most according to claim 1, it is characterized in that, in described step 9), only just result data corresponding for request address is cached in global buffer when the access times of request address exceed threshold value.
CN201610283274.5A 2016-04-29 2016-04-29 Take the cyberspace information service high-performance memory cache method of access temperature into account Expired - Fee Related CN105915619B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610283274.5A CN105915619B (en) 2016-04-29 2016-04-29 Take the cyberspace information service high-performance memory cache method of access temperature into account

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610283274.5A CN105915619B (en) 2016-04-29 2016-04-29 Take the cyberspace information service high-performance memory cache method of access temperature into account

Publications (2)

Publication Number Publication Date
CN105915619A true CN105915619A (en) 2016-08-31
CN105915619B CN105915619B (en) 2019-07-05

Family

ID=56753259

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610283274.5A Expired - Fee Related CN105915619B (en) 2016-04-29 2016-04-29 Take the cyberspace information service high-performance memory cache method of access temperature into account

Country Status (1)

Country Link
CN (1) CN105915619B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108334505A (en) * 2017-01-19 2018-07-27 阿里巴巴集团控股有限公司 A kind of data processing method, device, server and inventory system
CN109815425A (en) * 2018-12-14 2019-05-28 平安科技(深圳)有限公司 Cache data processing method, device, computer equipment and storage medium
CN110753099A (en) * 2019-10-12 2020-02-04 平安健康保险股份有限公司 Distributed cache system and cache data updating method
CN112269947A (en) * 2020-09-23 2021-01-26 咪咕文化科技有限公司 Caching method, device, electronic device and storage medium for spatial text data
CN112738148A (en) * 2019-10-28 2021-04-30 中兴通讯股份有限公司 Batch deletion method, device and equipment for cache content and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7451225B1 (en) * 2006-09-12 2008-11-11 Emc Corporation Configuring a cache prefetch policy in a computer system employing object addressable storage
CN101958834A (en) * 2010-09-27 2011-01-26 清华大学 On-chip network system supporting cache coherence and data request method
CN104217019A (en) * 2014-09-25 2014-12-17 中国人民解放军信息工程大学 Content inquiry method and device based on multiple stages of cache modules
CN104598394A (en) * 2013-10-31 2015-05-06 中国石油天然气集团公司 Data caching method and system capable of conducting dynamic distribution

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7451225B1 (en) * 2006-09-12 2008-11-11 Emc Corporation Configuring a cache prefetch policy in a computer system employing object addressable storage
CN101958834A (en) * 2010-09-27 2011-01-26 清华大学 On-chip network system supporting cache coherence and data request method
CN104598394A (en) * 2013-10-31 2015-05-06 中国石油天然气集团公司 Data caching method and system capable of conducting dynamic distribution
CN104217019A (en) * 2014-09-25 2014-12-17 中国人民解放军信息工程大学 Content inquiry method and device based on multiple stages of cache modules

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108334505A (en) * 2017-01-19 2018-07-27 阿里巴巴集团控股有限公司 A kind of data processing method, device, server and inventory system
CN108334505B (en) * 2017-01-19 2022-01-07 阿里巴巴集团控股有限公司 Data processing method and device, server and inventory system
CN109815425A (en) * 2018-12-14 2019-05-28 平安科技(深圳)有限公司 Cache data processing method, device, computer equipment and storage medium
CN109815425B (en) * 2018-12-14 2024-12-06 平安科技(深圳)有限公司 Cache data processing method, device, computer equipment and storage medium
CN110753099A (en) * 2019-10-12 2020-02-04 平安健康保险股份有限公司 Distributed cache system and cache data updating method
CN110753099B (en) * 2019-10-12 2023-09-29 平安健康保险股份有限公司 Distributed cache system and cache data updating method
CN112738148A (en) * 2019-10-28 2021-04-30 中兴通讯股份有限公司 Batch deletion method, device and equipment for cache content and readable storage medium
CN112738148B (en) * 2019-10-28 2024-05-14 中兴通讯股份有限公司 Batch deletion method, device and equipment of cache content and readable storage medium
US12182072B2 (en) 2019-10-28 2024-12-31 Zte Corporation Batch deletion method and apparatus for cache contents, device and readable storage medium
CN112269947A (en) * 2020-09-23 2021-01-26 咪咕文化科技有限公司 Caching method, device, electronic device and storage medium for spatial text data

Also Published As

Publication number Publication date
CN105915619B (en) 2019-07-05

Similar Documents

Publication Publication Date Title
CN108810041B (en) Data writing and capacity expansion method and device for distributed cache system
US8463846B2 (en) File bundling for cache servers of content delivery networks
CN102014158B (en) Cloud storage service client high-efficiency fine-granularity data caching system and method
CN101510219B (en) File data accessing method, apparatus and system
US10409728B2 (en) File access predication using counter based eviction policies at the file and page level
CN103678523B (en) Distributed cache cache data access methods and device
CN102546751B (en) Hierarchical metadata cache control method of distributed file system
CN108156267B (en) A method of using cache to improve website access latency in fog computing architecture
CN105426321B (en) Using RDMA close friend&#39;s caching method of remote location information
CN101236569B (en) An Efficient Dynamic Path Resolution Method Based on ContextFS Context File System
CN105472056B (en) DNS recursion server is layered caching method and system
CN105183839A (en) Hadoop-based storage optimizing method for small file hierachical indexing
CN105915619B (en) Take the cyberspace information service high-performance memory cache method of access temperature into account
WO2023185770A1 (en) Cloud data caching method and apparatus, device and storage medium
CN102694828A (en) Method and apparatus for data access in distributed caching system
CN105701219A (en) Distributed cache implementation method
CN107368608A (en) The HDFS small documents buffer memory management methods of algorithm are replaced based on ARC
US7249219B1 (en) Method and apparatus to improve buffer cache hit rate
CN111782612A (en) Edge caching method for file data in cross-domain virtual data space
Meizhen et al. The design and implementation of LRU-based web cache
CN101404649B (en) A data processing system and method based on CACHE
CN106686113A (en) A Distributed File System Intelligent Pre-reading Implementation Method
WO2025124246A1 (en) Cache management method for cdn network
CN109002503A (en) A kind of metadata read method, device, equipment and readable storage medium storing program for executing
CN105701233A (en) Method for optimizing server cache management

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200723

Address after: 430074 Wuhan Road, Hongshan, Shandong Province, Lu Lu Road, No. 388, No.

Patentee after: Wuhan in the big asset management Co.,Ltd.

Address before: 430074 Wuhan Road, Hongshan, Shandong Province, Lu Lu Road, No. 388, No.

Patentee before: CHINA University OF GEOSCIENCES (WUHAN CITY)

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210423

Address after: 274000, 500m north of East Sunan expressway, Liumin Road, industrial park, Helou office, Mudan District, Heze City, Shandong Province

Patentee after: Shandong Zhongdi University Ecological Environment Research Institute Co.,Ltd.

Address before: 430074 Wuhan Road, Hongshan, Shandong Province, Lu Lu Road, No. 388, No.

Patentee before: Wuhan in the big asset management Co.,Ltd.

TR01 Transfer of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20190705

CF01 Termination of patent right due to non-payment of annual fee