CN105915619B - Take the cyberspace information service high-performance memory cache method of access temperature into account - Google Patents

Take the cyberspace information service high-performance memory cache method of access temperature into account Download PDF

Info

Publication number
CN105915619B
CN105915619B CN201610283274.5A CN201610283274A CN105915619B CN 105915619 B CN105915619 B CN 105915619B CN 201610283274 A CN201610283274 A CN 201610283274A CN 105915619 B CN105915619 B CN 105915619B
Authority
CN
China
Prior art keywords
cache
request
temporal
memory
temporal cache
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.)
Expired - Fee Related
Application number
CN201610283274.5A
Other languages
Chinese (zh)
Other versions
CN105915619A (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
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 filed Critical China University of Geosciences
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

Abstract

The invention discloses a kind of cyberspace information service high-performance memory cache methods for taking access temperature into account, comprising the following steps: the spatial data request that received server-side client is sent obtains the access address of request;Cache object is retrieved in global memory's caching using address as keyword, if in retrieval recklessly, corresponding temporal cache object is then retrieved from temporal cache using client request address as keyword, if retrieval hit, decide whether to be added in global memory's caching according to the access times of temporal cache object, if miss, current request information is added to temporal cache.The method of the present invention can control cache module and only the spatial data that access temperature reaches certain threshold value is cached in limited server memory, reduce the displacement number of memory cache, avoid too much it is data cached to memory carry out eliminate processing, improve the memory cache performance of server end and the concurrent access performance of cyberspace information service.

Description

Take the cyberspace information service high-performance memory cache method of access temperature into account
Technical field
The present invention relates to network geographic information system technology, especially a kind of cyberspace information clothes for taking access temperature into account Business high-performance memory cache method.
Background technique
Cyberspace information service high-performance memory cache is to need to solve in network geographic information system (WebGIS) One of major issue is delayed cyberspace information service request data using the high-performance concurrent reading and writing performance of server memory It is stored in the high-speed internal memory of server, can be improved the concurrent response efficiency of client request, but the memory source of server is It is limited, for large-scale massive spatial data, partial data can only be cached into the memory of server, when large user's amount is close When collection concurrently accesses, since a large amount of temporary visit data are added into limited memory cache, it will lead to continually to memory Data in caching carry out eliminating processing, reduce the efficiency and cache hit rate of memory cache.
Summary of the invention
The technical problem to be solved in the present invention is that for the defects in the prior art, provides and a kind of take access temperature into account Cyberspace information service high-performance memory cache method reduces the superseded frequency of memory cache on server, and it is empty to improve network Between information service memory cache performance.
The technical solution adopted by the present invention to solve the technical problems is: a kind of cyberspace information for taking access temperature into account Service high-performance memory cache method comprising following steps:
Step 1: the spatial data request number of times cache threshold (ACT) of server end is set, and global memory's cache object is most Big number (GCT), temporal cache object maximum number (TCT).
Step 2: the spatial data request that received server-side client is sent obtains the access address of request.
Step 3: retrieval cache object is removed from global memory's caching using address as keyword, if global buffer is ordered In, go to step 4;If global memory's caching goes to step 6 in losing one's life.
Step 4: updating the last access time attribute of global memory's cache object of hit.
Step 5: the result data stored in the cache object of hit being directly returned to client, is terminated.
Step 6: the data of client request are retrieved from spatial database.
Step 7: result data is returned into client.
Step 8: retrieving corresponding temporal cache object from temporal cache using client request address as keyword, such as The hit of fruit temporal cache, goes to step 9;If temporal cache miss, goes to step 15.
Step 9: obtaining the access times (RAC) of temporal cache object.If RAC > ACT goes to step 10;It is on the contrary then turn to walk Rapid 14.
Step 10: the result data that current request is obtained increases in global memory's caching.
Step 11: the temporal cache object of current request is deleted,
Step 12: the caching number (GCC) obtained in global memory's caching goes to step 13 if GCC > GCT, if GCC < GCT terminates.
Step 13: deleting a cache object not visited at most in global memory's caching, terminate.
Step 14: by the access times (RAC) of temporal cache object plus 1, and updating the last access of temporal cache object Time terminates.
Step 15: the access times of the temporal cache object of current request being initially 1, and are increased to temporal cache In.
Step 16: the cache object number (TCC) obtained in temporal cache goes to step 17 if TCC > TCT;If TCC < TCT terminates.
Step 17: deleting a cache object not visited at most in temporal cache, terminate.
According to the above scheme, temporal cache and global buffer are stored all in the form of key-value pair in the step 1), wherein Key is the address of request, and value is respectively temporal cache object and global buffer object.
It according to the above scheme, include the last access of the corresponding request address of its key in the value of each temporal cache object Time and access times to the address;In the value of each global buffer object most including the corresponding request address of its key Access time result data corresponding with the request afterwards.
According to the above scheme, in the step 9), only when the access times of request address are more than threshold value just by request address Corresponding result data is cached in global buffer.
The beneficial effects of the invention are as follows can judge to be according to the access temperature of cyberspace information service access request It is no that request data is cached in the memory cache of server, it is arrived to avoid by some temporary visit number less data storages In the memory cache of server, the conversion times of server memory caching are reduced, it is gentle to improve server end memory cache efficiency Hit rate is deposited, the large user for improving cyberspace information service measures concurrent request processing performance.
Detailed description of the invention
Present invention will be further explained below with reference to the attached drawings and examples, in attached drawing:
Fig. 1 is flow chart of the method for the present invention.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to embodiments, to the present invention It is further elaborated.It should be appreciated that described herein, specific examples are only used to explain the present invention, is not used to limit The fixed present invention.
As shown in Figure 1, Fig. 1 is that the cyberspace information service high-performance memory provided by the invention for taking access temperature into account is slow Method flow diagram is deposited, the described method comprises the following steps:
Step 1: the spatial data request number of times cache threshold (ACT) of server end is set, and global memory's cache object is most Big number (GCT), temporal cache object maximum number (TCT).
Step 2: the spatial data request that received server-side client is sent obtains the http address requested access to.
Step 3: retrieval cache object is removed from global memory's caching using address as keyword, if global buffer is ordered In, go to step 4;If global memory's caching goes to step 6 in losing one's life.
Global buffer object is stored using the form of key-value pair, and the http address requested access to is worth complete for one as key Office's cache object class (GlobalCacheItem), it includes the last access times of the result data of request (data) and request (lastAccessTime).Global buffer object class is defined as follows:
Public class GlobalCacheItem
{
Public byte[] data;
Public DateTime lastAccessTime;
}
Step 4: obtaining global memory's cache object (globalCacheObj) of hit, update globalCacheObj's Last access time (lastAccessTime) attribute, is updated to current time.
Step 5: the result data (globalCacheObj.data) stored in the cache object of hit is directly returned to Client terminates.
Step 6: the data of client request are retrieved from spatial database.
Step 7: result data is returned into client.
Step 8: retrieving corresponding temporal cache object from temporal cache using client request address as keyword, such as The hit of fruit temporal cache, goes to step 9;If temporal cache miss, goes to step 15.
Temporal cache object is stored using the form of key-value pair, and the http address requested access to is worth and faces for one as key When cache object class (TempCacheItem), it includes the access times of request (RAC) and request last access time (lastAccessTime).Temporal cache object class is defined as follows:
Public class TempCacheItem
{
Public int RAC;
Public DateTime lastAccessTime;
}
Step 9: obtaining the temporal cache object (tempCacheObj) of hit, obtain the access times of temporal cache object (tempCacheObj.RAC).If tempCacheObj.RAC > ACT goes to step 10;It is on the contrary then go to step 14.
Step 10: the result data of current request obtained in step 6 is increased in global memory's caching.
Step 11: the temporal cache object (tempCacheObj) of current request is deleted,
Step 12: the caching number (GCC) obtained in global memory's caching goes to step 13 if GCC > GCT, if GCC < GCT terminates.
Step 13: according to global memory cache in each cache object last access time attribute (lastAccessTime), a cache object not visited at most in global memory's caching is deleted, is terminated.
Step 14: by the access times (tempCacheObj.RAC) of temporal cache object plus 1, and updating temporal cache pair The last access time (tempCacheObj.lastAccessTime) of elephant terminates.
Step 15: a temporal cache object is created for current request, by the access of the temporal cache object of current request Number (RAC) is initially 1, and last access time (lastAccessTime) is initially current time, and is increased to interim In caching.
Step 16: the cache object number (TCC) obtained in temporal cache goes to step 17 if TCC > TCT;If TCC < TCT terminates.
Step 17: according to the last access time attribute (lastAccessTime) of cache object each in temporal cache, A cache object not visited at most in temporal cache is deleted, is terminated.
The most apparent difference of the present invention is to increase temporal cache module, concurrently visit when server receives large user's amount When asking request, directly the result data of new request is not increased in global memory's caching, and only by the access times of request With the storage of last access time into temporal cache, just the result data of request is delayed when access times are more than preset threshold value It is stored in global memory's caching.The method can be avoided temporary visit number less data and be stored in global memory's caching In, the frequency of replacement of global memory's caching is reduced, global memory's buffer efficiency and hit rate are improved, improves cyberspace information clothes The concurrent processing performance of business, especially when server memory resource is less, the advantage of this method is more obvious.
Embodiment one:
Illustrate thought of the invention in order to clearer, below to the high property of cyberspace information service for taking access temperature into account Energy memory cache method is further detailed, with the OGC WMS service in cyberspace information service For GetCapabilities request, spatial data request number of times cache threshold is set as 10, and global memory's cache object is maximum Number is set as 10000, and temporal cache object maximum number is set as 100.Specific step is as follows:
Step 1: the spatial data request number of times cache threshold (ACT=10) of server end, global memory's cache object are set Maximum number (GCT=10000), temporal cache object maximum number (TCT=100).
Step 2: the GetCapabilities request for the WMS service that received server-side client is sent obtains The http address that GetCapabilities is requested access to, request address format are as follows:
http://domain/wms?REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS
Step 3: retrieval cache object is removed from global memory's caching using the address obtained in step 2 as keyword, such as The hit of fruit global buffer, goes to step 4;If global memory's caching goes to step 6 in losing one's life.
Step 4: obtaining global memory's cache object (globalCacheObj) of hit, update globalCacheObj's Last access time (lastAccessTime) attribute, is updated to current time.
Step 5: the result data (globalCacheObj.data) stored in the cache object of hit is directly returned to Client terminates.
Step 6: retrieving the data of client request from spatial database, generate symbol according to the interface specification of WMS service Close the result data that GetCapabilities service interface requires.
Step 7: result data is returned into client.
Step 8: retrieving corresponding temporal cache object from temporal cache using client request address as keyword, such as The hit of fruit temporal cache, goes to step 9;If temporal cache miss, goes to step 15.
Step 9: obtaining the temporal cache object (tempCacheObj) of hit, obtain the access times of temporal cache object (tempCacheObj.RAC).If tempCacheObj.RAC > 10 go to step 10;It is on the contrary then go to step 14.
Step 10: use the client request address that obtains in step 2 as key, create one it is new The instance objects (globalItem) of GlobalCacheItem class, it is current time that its lastAccessTime attribute, which is arranged, and It is set as the result data that data attribute is current request obtained in step 6, then by the global buffer object of the request GlobalItem increases in global memory's caching.
Step 11: the temporal cache object (tempCacheObj) of current request is deleted,
Step 12: the caching number (GCC) obtained in global memory's caching goes to step 13 if GCC > 10000, if GCC < 10000 terminate.
Step 13: according to global memory cache in each cache object last access time attribute (lastAccessTime), a cache object not visited at most in global memory's caching is deleted, is terminated.
Step 14: by the access times (tempCacheObj.RAC) of temporal cache object plus 1, and updating temporal cache pair The last access time (tempCacheObj.lastAccessTime) of elephant is current time, is terminated.
Step 15: creating the instance objects (tempItem) of a TempCacheItem class for current request, accessed Number (RAC) is initially 1, and last access time (lastAccessTime) is initially current time, uses what is obtained in step 2 Client request address increases to the temporal cache object tempItem of the request in temporal cache as key.
Step 16: the cache object number (TCC) obtained in temporal cache goes to step 17 if TCC > 100;If TCC < 100, terminate.
Step 17: according to the last access time attribute (lastAccessTime) of cache object each in temporal cache, A cache object not visited at most in temporal cache is deleted, is terminated.
The cyberspace information service high-performance memory cache method designed by the invention for taking access temperature into account, is taking When the concurrent access request for device end reception large user's amount of being engaged in, the request data that can be avoided temporary visit is added to the overall situation too much In memory cache, the displacement number of global memory's caching is efficiently reduced, helps to improve the efficiency and life of global memory's caching Middle rate promotes the concurrent processing performance of cyberspace information service when large user's amount is intensive concurrently to be accessed.
It should be understood that for those of ordinary skills, it can be modified or changed according to the above description, And all these modifications and variations should all belong to the protection domain of appended claims of the present invention.

Claims (2)

1. a kind of cyberspace information service high-performance memory cache method for taking access temperature into account, which is characterized in that it includes Following steps:
The spatial data request number of times cache threshold ACT of server end, global memory's cache object maximum number is arranged in step 1) GCT, temporal cache object maximum number TCT;Temporal cache and global buffer all use the form of key-value pair in the step 1) Storage, wherein key is the address of request, and value is respectively temporal cache object and global buffer object;
In the value of each temporal cache object including the corresponding request address of its key last access time and to the address Access times;In the value of each global buffer object including the corresponding request address of its key last access time and should Request corresponding result data;
The spatial data request that step 2 received server-side client is sent, obtains the access address of request;
Step 3) retrieves cache object in global memory's caching using address as keyword, if 4) retrieval hit, goes to step If gone to step 6) in retrieval recklessly;
The last access time attribute that step 4) updates global memory's cache object of hit is current time;
The result data stored in the cache object of hit is directly returned to client by step 5), is terminated;
Step 6) retrieves the data of client request from spatial database;
Result data is returned to client by step 7);
Step 8) retrieves corresponding temporal cache object using client request address as keyword from temporal cache, if faced When cache hit object, go to step 9);If 15) temporal cache miss object, goes to step;
The access times RAC of step 9) acquisition temporal cache object;If 10) RAC > ACT is gone to step;It is on the contrary then go to step 14);
The result data that step 10) obtains current request increases in global memory's caching;
The temporal cache object of step 11) deletion current request;
The caching number GCC that step 12) obtains in global memory's caching goes to step 13 if GCC>GCT, if GCC<GCT, Terminate;
Step 13) deletes a global buffer object not visited at most in global memory's caching, terminates;
The access times RAC of temporal cache object is added 1 by step 14), and updates the last access time of temporal cache object, knot Beam;
Step 15) increases to the object of current request in temporal cache as temporal cache object, and by the temporal cache pair The access times of elephant are initially 1;
The cache object number TCC that step 16 obtains in temporal cache goes to step 17 if TCC > TCT;If TCC < TCT, Terminate;
Step 17 deletes a temporal cache object not visited at most in temporal cache, terminates.
2. the cyberspace information service high-performance memory cache method according to claim 1 for taking access temperature into account, It is characterized in that, in the step 9), only when the access times of request address are more than threshold value just by the corresponding result of request address Data buffer storage is into global buffer.
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 CN105915619A (en) 2016-08-31
CN105915619B true 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)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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 平安科技(深圳)有限公司 Caching data processing method, device, computer equipment and storage medium
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
CN112269947A (en) * 2020-09-23 2021-01-26 咪咕文化科技有限公司 Spatial text data caching method and device, electronic equipment and 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

Also Published As

Publication number Publication date
CN105915619A (en) 2016-08-31

Similar Documents

Publication Publication Date Title
CN105915619B (en) Take the cyberspace information service high-performance memory cache method of access temperature into account
CN105635196B (en) A kind of method, system and application server obtaining file data
US11561930B2 (en) Independent evictions from datastore accelerator fleet nodes
CN100437590C (en) Method for prefetching object
KR101672901B1 (en) Cache Management System for Enhancing the Accessibility of Small Files in Distributed File System
CN104679898A (en) Big data access method
CN104778270A (en) Storage method for multiple files
CN101887398B (en) Method and system for dynamically enhancing input/output (I/O) throughput of server
CN104133882A (en) HDFS (Hadoop Distributed File System)-based old file processing method
CN105653684B (en) Pre-reading method and device of distributed file system
CN106599239A (en) Webpage content data acquisition method and server
CN104850572A (en) HBase non-primary key index building and inquiring method and system
CN109656956B (en) Method and device for realizing centralized caching of service system data
CN103366016A (en) Electronic file concentrated storing and optimizing method based on HDFS
CN106155934B (en) Caching method based on repeated data under a kind of cloud environment
CN107368608A (en) The HDFS small documents buffer memory management methods of algorithm are replaced based on ARC
CN106599152A (en) Data caching method and system
CN107888687B (en) Proxy client storage acceleration method and system based on distributed storage system
CN104461929B (en) Distributed data cache method based on blocker
CN110032543A (en) A kind of management method of storage file system
Meizhen et al. The design and implementation of LRU-based web cache
CN102523301A (en) Method for caching data on client in cloud storage
CN105701233B (en) A method of optimization server buffer management
CN104158863A (en) Cloud storage mechanism based on transaction-level whole-course high-speed buffer
CN109947718A (en) A kind of date storage method, storage platform and storage device

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
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.

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

Granted publication date: 20190705