CN106777121A - A kind of service end caching method of browser chart - Google Patents

A kind of service end caching method of browser chart Download PDF

Info

Publication number
CN106777121A
CN106777121A CN201611167479.3A CN201611167479A CN106777121A CN 106777121 A CN106777121 A CN 106777121A CN 201611167479 A CN201611167479 A CN 201611167479A CN 106777121 A CN106777121 A CN 106777121A
Authority
CN
China
Prior art keywords
chart
caching
data
service end
browser
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.)
Pending
Application number
CN201611167479.3A
Other languages
Chinese (zh)
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.)
Jinan Inspur Hi Tech Investment and Development Co Ltd
Original Assignee
Jinan Inspur Hi Tech Investment and Development Co Ltd
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 Jinan Inspur Hi Tech Investment and Development Co Ltd filed Critical Jinan Inspur Hi Tech Investment and Development Co Ltd
Priority to CN201611167479.3A priority Critical patent/CN106777121A/en
Publication of CN106777121A publication Critical patent/CN106777121A/en
Pending legal-status Critical Current

Links

Classifications

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

Abstract

The invention discloses a kind of service end caching method of browser chart, its implementation process is:First when browser chart is loaded for the first time, data are cached in service end;When user initiates to obtain the request of chart data, directly chart data is obtained from the middle of the caching of the service end.A kind of service end caching method of browser chart of the invention is compared with prior art, service end caching is carried out by by chart data, avoid and interacted with the multiple of database, solve the problems, such as chart loading efficiency, the response time of client request is significantly reduced, the operating experience of user is greatly improved, it is practical, it is applied widely, it is easy to promote.

Description

A kind of service end caching method of browser chart
Technical field
The present invention relates to field of computer technology, specifically a kind of service end caching method of browser chart.
Background technology
Chart refers to what is shown in screen, can intuitively show statistical information attribute(Timeliness, quantitative etc.), to knowledge Excavate and the information dramatic graphic structure that plays a crucial role of impression, be a kind of well by object attribute data is directly perceived, shape As the means of ground " visualization ".Graphic Design is under the jurisdiction of Visual Communication Design category.
In the browser of prior art, chart is one of essential content, and user is frequently necessary to inquiry, and this is browsed Device chart.The core for inquiring about chart is exactly data output and represents.User's request how is timely responded to, quickly enters line number User is fed back to just into the key point of lifting Consumer's Experience according to analysis and by Query Result.Data buffer storage is to solve this problem Most common processing mode.
Based on this, the present invention proposes a kind of service end caching method of browser chart.The method uses data buffer storage Technology realizes that data buffer storage can reduce the interaction times with database, and data storage is in the middle of internal memory, can also carry significantly Rise extraction and the computational efficiency of data.
The content of the invention
Technical assignment of the invention is directed to above weak point, there is provided it is a kind of it is practical, effectively solve the above problems Browser chart service end caching method.
A kind of service end caching method of browser chart, its implementation process is:
First when browser chart is loaded for the first time, data are cached in service end;
When user initiates to obtain the request of chart data, directly chart data is obtained from the middle of the caching of the service end.
When user initiates to obtain the request of chart data in client, service end obtains data from the middle of caching first, If there are data needed for request in caching, then directly return to client by data cached;If without institute in the middle of caching Data are needed, then will be again cached to service end after required data normal load browser icon.
In the middle of caching during the data without needed for, it is divided to following two steps to be processed:
The first step, access is called service acquisition chart data and to return to client;
Second step, by will call access service acquired in data be loaded into caching in the middle of.
The data life period of service end caching is 20 minutes.
After flip chart terminates, the chart caching of service end is reclaimed, specially:Whenever current browser function When closing or logging off, system is recycled to chart caching, cache invalidation and after reloading, to chart The data of loading are updated.
A kind of service end caching method of browser chart of the invention compared to the prior art, with following beneficial effect Really:
A kind of service end caching method of browser chart of the invention, service end caching is carried out by by chart data, it is to avoid Interacted with the multiple of database, solve the problems, such as chart loading efficiency;When first time loading chart, in service end pair The chart data of request is cached, and when user is doing page turning, derive and during printing, system need not again and data Storehouse is interacted, and chart data is directly obtained from the middle of caching, significantly reduces the response time of client request, is carried significantly The operating experience of user has been risen, it is practical, it is applied widely, it is easy to promote.
Brief description of the drawings
Accompanying drawing 1 realizes flow chart for of the invention.
Specific embodiment
Below in conjunction with the accompanying drawings and specific embodiment the invention will be further described.
As shown in Figure 1, a kind of service end caching method of browser chart, including following steps and content:
(One)When chart is initialized, service end is cached to data.I.e. in client loading chart for the first time, to chart Data carry out caching process.
(Two)Client is initiated to obtain the request of chart data, calls fetching engine to sentence before doing cache flush mode every time Disconnected to whether there is data buffer storage, service end obtains data from the middle of caching first, if there are data needed for request in caching, that Directly client is returned to by data cached;If without required data in the middle of caching, recalling access service acquisition data, Placed data into while data are returned into client in the middle of caching.
It is specific to be divided to following two steps to be processed:
The first step calls access service to carry out cache flush mode and completes data analysis, by the data feedback after treatment to client;
Second step passes through asynchronous operation(Or open sub-line journey)Calling access service carries out cache flush mode and places data into slow In the middle of depositing.
(Three)The life cycle of caching is limited, and caching is reclaimed when closing current function or logging off. Caching was reclaimed when caching takes multi-system resource automatically.
Further, the life cycle of caching is 20 minutes, and the life cycle with session is consistent.Whenever current function When closing or logging off, chart caching is recycled.When caching took multi-system resource, according to priority Carry out cache garbage collection.
(Four)The data that chart is already loaded into are updated, and data are entangled by cache invalidation and after reloading Fault is managed.
(Five)For effective chart higher, there is provided the exploitation of buffer setting.
Further, specific code of the invention is as follows:
/// <summary>
///caching relies on item Key values
/// </summary>
public string Key { get; set; }
/// <summary>
The access commission of ///asynchronous call
/// </summary>
/// <returns></returns>
public delegate QueryResult AysnGetData();
/// <summary>
The flag bit dictionary object of ///asynchronous call access
/// </summary>
private static readonly Dictionary<string, bool> AysnDictionary = new Dictionary<string, bool>();
/// <summary>
///obtain chart data
/// </summary>
/// <returns></returns>
public QueryResult GetPageData(GetBindingDataObject request)
{
Request = request;
IDataOperate operate = DataOperateFactory.CreateDataOperate(request);
bool flag = false;The exploitation flag bit of // buffer setting
RuntimeOptions runtimeOptions = ExportHelper.GetRuntimeOptions (Request.RuntimeOptionsID, Request.QueryID);
if (runtimeOptions != null && runtimeOptions.otherOptions != null)
{
// judge whether the switch of buffer setting is opened
if (runtimeOptions.otherOptions.dataCahce)
flag = true;
}
if (flag)
SetCacheDependent();// caching dependence is set
// result set is obtained from caching
QueryResult result = HttpRuntime.Cache.Get(Id + Request.QueryID) as QueryResult;
if (flag)
{
if (result == null)
{
During the access of // asynchronous call, result set is uncached, directly invokes access interface access
if (!AysnDictionary.ContainsKey(Id + Request.QueryID))
{
result = operate.GetData(AnalysisXmlParam(false));
// asynchronous call is fetched, and result set is added in the middle of caching
BeginPageDataForCache();
}
else
{
if (!AysnDictionary[Id + Request.QueryID])
result = operate.GetData(AnalysisXmlParam(false));
}
}
else
{
result = OperateDataWithCache(result);
}
}
else
{
result = operate.GetData(AnalysisXmlParam(false));
}
return result;
}
/// <summary>
///set caching relies on item
/// </summary>
private void SetCacheDependent()
{
bool flag = true;
Key = Id + UserId;// caching relies on the key values of item
// judge whether the key of caching dependence item frees variation, item is relied on if changing clear caching, and insert new Caching relies on item
if (HttpRuntime.Cache.Count > 0)
{
foreach (System.Collections.DictionaryEntry item in HttpRuntime.Cache)
{
if (item.Key.ToString().Contains(UserId) && item.Key.ToString() != Key)
{
flag = false;
HttpRuntime.Cache.Remove(item.Key.ToString());
AysnDictionary.Clear();
HttpRuntime.Cache.Insert(Key, "cacheDependent");
break;
}
}
if (flag)
{
string cacheDependent = HttpRuntime.Cache.Get(Key) as string;
if (cacheDependent == null)
{
HttpRuntime.Cache.Insert(Key, "cacheDependent");
AysnDictionary.Clear();
}
}
}
else
{
HttpRuntime.Cache.Insert(Key, "cacheDependent");
}
}
/// <summary>
///asynchronous call is fetched
/// </summary>
private void BeginPageDataForCache()
{
if (AysnDictionary.ContainsKey(Id + Request.QueryID))
AysnDictionary[Id + Request.QueryID] = false;
else
AysnDictionary.Add(Id + Request.QueryID, false);
// ReSharper disable once RedundantDelegateCreation
AysnGetData aysnGetData = new AysnGetData(GetPageDataForCache);
aysnGetData.BeginInvoke(EndPageDataForCache, aysnGetData);
}
/// <summary>
///asynchronous call is fetched, and asynchronous call terminates to add access result in the middle of caching
/// </summary>
/// <param name="result"></param>
private void EndPageDataForCache(IAsyncResult result)
{
AysnGetData aysnGetData = result.AsyncState as AysnGetData;
if (aysnGetData != null)
{
var queryResult = aysnGetData.EndInvoke(result);
var t = new TimeSpan(0, 0, 5, 0);
// ReSharper disable once RedundantExplicitArrayCreation
var dependency = new CacheDependency(null, new string[] { Key });
if (queryResult.Data.Tables.Count > 0 && queryResult.Data.Tables [0].Rows.Count > 0)
HttpRuntime.Cache.Insert(Id + Request.QueryID, queryResult, dependency, Cache.NoAbsoluteExpiration, t);
AysnDictionary.Clear();
}
}。
By specific embodiment above, the those skilled in the art can readily realize the present invention.But should Work as understanding, the present invention is not limited to above-mentioned specific embodiment.On the basis of disclosed embodiment, the technical field Technical staff can be combined different technical characteristics, so as to realize different technical schemes.
In addition to the technical characteristic described in specification, the known technology of those skilled in the art is.

Claims (6)

1. a kind of service end caching method of browser chart, it is characterised in that its implementation process is:
First when browser chart is loaded for the first time, data are cached in service end;
When user initiates to obtain the request of chart data, directly chart data is obtained from the middle of the caching of the service end.
2. the service end caching method of a kind of browser chart according to claim 1, it is characterised in that when user is in visitor When the request of chart data is initiated to obtain in family end, service end obtains data from the middle of caching first, if there is request in caching Required data, then directly return to client by data cached;If without required data in the middle of caching, by required data Service end is cached to again after normal load browser icon.
3. the service end caching method of a kind of browser chart according to claim 2, it is characterised in that in the middle of caching Without needed for during data, it is divided to following two steps to be processed:
The first step, access is called service acquisition chart data and to return to client;
Second step, by will call access service acquired in data be loaded into caching in the middle of.
4. according to a kind of service end caching method of any described browser charts of claim 1-3, it is characterised in that service The data life period for holding caching is 20 minutes.
5. according to a kind of service end caching method of any described browser charts of claim 1-3, it is characterised in that when clear After chart of looking at terminates, the chart caching of service end is reclaimed, specially:Whenever current browser function is closed or is exited During system, system is recycled to chart caching, cache invalidation and after reloading, and the data that chart is already loaded into are entered Row updates.
6. the service end caching method of a kind of browser chart according to claim 4, it is characterised in that work as flip chart After end, the chart caching of service end is reclaimed, specially:Whenever current browser function is closed or is logged off When, system is recycled to chart caching, cache invalidation and after reloading, and the data being already loaded into chart are carried out more Newly.
CN201611167479.3A 2016-12-16 2016-12-16 A kind of service end caching method of browser chart Pending CN106777121A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611167479.3A CN106777121A (en) 2016-12-16 2016-12-16 A kind of service end caching method of browser chart

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611167479.3A CN106777121A (en) 2016-12-16 2016-12-16 A kind of service end caching method of browser chart

Publications (1)

Publication Number Publication Date
CN106777121A true CN106777121A (en) 2017-05-31

Family

ID=58892185

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611167479.3A Pending CN106777121A (en) 2016-12-16 2016-12-16 A kind of service end caching method of browser chart

Country Status (1)

Country Link
CN (1) CN106777121A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114785637A (en) * 2022-03-15 2022-07-22 浪潮云信息技术股份公司 Implementation method and system for caching response data by API gateway

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622266A (en) * 2012-02-14 2012-08-01 中国民航信息网络股份有限公司 Mobile application html and native interaction system and method thereof
CN103154946A (en) * 2011-03-30 2013-06-12 乐天株式会社 Information provision device, information provision method, information provision program, information display device, information display method, information display program, information retrieval system, and recording medium
CN103200338A (en) * 2013-03-25 2013-07-10 苏州洲际传书信息科技有限公司 Telephone traffic statistic method
CN105335508A (en) * 2015-10-29 2016-02-17 苏州国云数据科技有限公司 Method for visually displaying data source information by dragging on basis of browser

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103154946A (en) * 2011-03-30 2013-06-12 乐天株式会社 Information provision device, information provision method, information provision program, information display device, information display method, information display program, information retrieval system, and recording medium
CN102622266A (en) * 2012-02-14 2012-08-01 中国民航信息网络股份有限公司 Mobile application html and native interaction system and method thereof
CN103200338A (en) * 2013-03-25 2013-07-10 苏州洲际传书信息科技有限公司 Telephone traffic statistic method
CN105335508A (en) * 2015-10-29 2016-02-17 苏州国云数据科技有限公司 Method for visually displaying data source information by dragging on basis of browser

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114785637A (en) * 2022-03-15 2022-07-22 浪潮云信息技术股份公司 Implementation method and system for caching response data by API gateway

Similar Documents

Publication Publication Date Title
CN110908879B (en) Reporting method, reporting device, reporting terminal and recording medium of buried point data
CN107038222B (en) Database cache implementation method and system
CN107391664A (en) Page data processing method and system based on WEB
CN102882974A (en) Method for saving website access resource by website identification version number
CN107463378A (en) A kind of local cache implementation method, storage device and electronic equipment based on note
CN106909690A (en) Network data caching method
CN106685902A (en) User authority management method, client and server
CN107613040A (en) A kind of method and apparatus of domain name system DNS server lookup
CN106254529A (en) A kind of client-side data cache method and apparatus
CN107070991A (en) Network data buffer storage and system
EP2933731A1 (en) Method for configuring browser bookmarks, device and terminal thereof
CN108829740B (en) Data storage method and device
CN105915619B (en) Take the cyberspace information service high-performance memory cache method of access temperature into account
US8024374B2 (en) Computer object conversion using an intermediate object
CN106777121A (en) A kind of service end caching method of browser chart
CN105608197A (en) Method and system for obtaining Memcache data under high concurrency
CN109766488B (en) Data acquisition method based on Scapy
CN103324764A (en) Web implementation of multi-condition random keyword multi-field fuzzy query method
CN107391555B (en) Spark-Sql retrieval-oriented metadata real-time updating method
US20120254133A1 (en) Method for binary persistence in a system providing offers to subscribers
CN104714923A (en) Method and device for achieving equipment sharing
CN111090675B (en) Multi-entry data caching method and storage medium
Dai et al. Research on the release management technology of the mobile application for electricity dispatching
CN110955669A (en) Front-end and back-end data consistency method and system based on event and memory database
US10691615B2 (en) Client-side persistent caching framework

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20170531

RJ01 Rejection of invention patent application after publication