CN105989054A - Method and device for managing client-side data - Google Patents

Method and device for managing client-side data Download PDF

Info

Publication number
CN105989054A
CN105989054A CN201510063689.7A CN201510063689A CN105989054A CN 105989054 A CN105989054 A CN 105989054A CN 201510063689 A CN201510063689 A CN 201510063689A CN 105989054 A CN105989054 A CN 105989054A
Authority
CN
China
Prior art keywords
client
key
request
data
browser page
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
CN201510063689.7A
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.)
Beijing Shenzhou Taiyue Software Co Ltd
Original Assignee
Beijing Shenzhou Taiyue Software 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 Beijing Shenzhou Taiyue Software Co Ltd filed Critical Beijing Shenzhou Taiyue Software Co Ltd
Priority to CN201510063689.7A priority Critical patent/CN105989054A/en
Publication of CN105989054A publication Critical patent/CN105989054A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a method and device for managing client-side data. The method comprises the following steps: establishing an empty Map set object in an internal memory of a client through a JavaScript scripting language; establishing an empty attribute object in the Map set object; storing a data object needing to be stored in a client-side browser page according to a one-to-one mapping manner of a key object and a value object, wherein the key object of the data object is unique and the key object of the data object is stored into the attribute object; and managing the stored data object according to a received operation request sent by the client-side browser page. According to the method and device disclosed by the invention, the Map set object is realized through the JavaScript scripting language and a client-side data object is stored and managed, so that the number of times of requiring a server by a client browser is reduced, the inquiring consumption of the client browser is reduced and a webpage rendering speed of the client browser is improved.

Description

A kind of method and apparatus of managing customer side data
Technical field
The present invention relates to technical field of the computer network, be specifically related to the side of a kind of managing customer side data Method and device.
Background technology
Along with the development of computer network communication technology, B/S pattern (Browser/Server, browser/ Server) use get more and more, promoted JavaScript, AJAX (Asynchronous JavaScript And XML, asynchronous JavaScript and XML) etc. the development of technology, and then define a kind of fat client End pattern.JavaScript is a kind of regime type, is widely used in the script of client, is initially On HTML (Hyper Text Markup language, the HTML) webpage of browser Use, for increasing dynamic effect to html web page.AJAX is that a kind of interaction network page that creates is applied Web development technologies.
The Fat Client pattern formed under the promotion of the technology development such as JavaScript, AJAX has following Advantage: 1, part operation can be completed in client process, thus significantly reduce the burden of server side; 2, add the interactivity of client and user, and the local of the browser display page of client can be realized Refresh in real time;3, the interactively user interface of feature richness can be presented in client.
But, this Fat Client pattern there is also some defects: such as, due to JavaScript this Kind of literal translation formula script provides only an inner set object i.e. List collection object storage data, and List Collection object, when searching data, can only make a look up by the way of dual array circulates, and takies a large amount of Internal memory and affect client browser performance, make the increased pressure of client browser, can time serious Client browser collapse can be caused, cannot respond to.
Summary of the invention
The invention provides the method and apparatus of a kind of managing customer side data to solve existing Fat Client The inner set object List using JavaScript script to provide in pattern stores and searches data etc. The problem affecting client browser performance existed during operation.
For reaching above-mentioned purpose, the technical scheme is that and be achieved in that:
According to an aspect of the invention, it is provided the method for a kind of managing customer side data, the method Including:
Empty Map collection object is created by JavaScript script in the internal memory of client, and An empty attributes object is created in Map collection object;
Client-side browser page is needed the data object of storage, according to key object with value object one by one Mapping mode is stored in Map collection object, and wherein, the key of data object is unique to liking, and by number It is stored in attributes object according to the key object of object;
The operation requests sent according to the client-side browser page received, the data object to storage It is managed.
Alternatively, need the data object of storage according to key object-value object client-side browser page During mapping mode is stored in Map collection object one by one, wherein, the key object of data object is stored to attribute pair Include as inner:
Define a variable and point to the attributes object in Map collection object;
Receive the key object comprising data object and the storage of value object of the browser page transmission of client Request;
According to storage request, key object and the value object of data object are assigned to variable, by variable by number Store in the attributes object in Map collection object according to the key object of object, by the value object of data object Store in the memory space outside the attributes object in Map collection object, and it is right with value to set up key object The mapping relations one by one of elephant.
Alternatively, the operation requests sent according to the client-side browser page received, to storage Data object is managed including:
Receive the acquisition the comprising key object request that the browser page of client sends, according to obtaining request In key object, Map collection object is searched the value object corresponding with key object return to client The browser page of end.
Alternatively, the operation requests sent according to the client-side browser page received, to storage Data object is managed also including:
Receive the removal request comprising key object that the browser page of client sends, according to removal request In key object, Map collection object is searched the value object corresponding with key object, and is finding Rear deletion key object and value object.
Alternatively, the operation requests sent according to the client-side browser page received, to storage Data object is managed also including:
Receive the request emptying Map collection object that the browser page of client sends, and according to request Map collection object is set to sky;
Or,
In the acquisition Map collection object of the browser page transmission receiving client, key object number please Ask, according to request, add up the number of key object in the attributes object of Map collection object and return to client The browser page of end;
Or,
Whether the attributes object that judges in Map collection object receiving that the browser page of client sends is Empty request, according to request, it is judged that in the attributes object of Map collection object, whether the number of key object is 0, and corresponding judged result is returned to the browser page of client;
Or,
In the acquisition Map collection object of the browser page transmission receiving client, all key objects please Ask, according to request, all key objects in attributes object are returned to the browser page of client;
Or,
In the acquisition Map collection object of the browser page transmission receiving client, all values object please Ask, according to request, the value object corresponding with all key objects in attributes object is returned to client Browser page.
According to a further aspect in the invention, the device of a kind of managing customer side data, this dress are additionally provided Put and include:
Map collection object creating unit, for passing through JavaScript script language in the internal memory of client Speech creates empty Map collection object, and creates an empty attributes object in Map collection object;
Data storage cell, for client-side browser page being needed the data object of storage, according to Key object and value object mapping mode one by one are stored in Map collection object, wherein, and the key pair of data object As if uniquely and the key object of data object is stored in attributes object;
Data Management Unit, for the operation requests sent according to the client-side browser page received, The data object of data storage cell storage is managed.
Alternatively, data storage cell specifically for:
Define a variable and point to the attributes object in Map collection object;
Receive the key object comprising data object and the storage of value object that client-side browser page sends Request;
According to storage request, key object and the value object of data object are assigned to variable, by variable by number Store in the attributes object in Map collection object according to the key object of object, by the value object of data object Store in the memory space outside the attributes object in Map collection object, and it is right with value to set up key object The mapping relations one by one of elephant.
Alternatively, Data Management Unit includes:
Single value object acquiring unit, for receive client browser page send comprise key object Parameter acquisition request, according to obtain request in key image parameter, in Map collection object search with Value object that key object is corresponding also returns to the browser page of client.
Alternatively, Data Management Unit also includes:
Data deletion unit, comprises key image parameter for receive that the browser page of client sends Removal request, according to the key image parameter in removal request, searches and key object in Map collection object Corresponding value object, and after finding, delete key object and value object.
Alternatively, Data Management Unit also includes:
Data empty unit, for receive client browser page send empty Map collection object Request, and according to request Map collection object is set to sky;
Or,
Key object number acquiring unit, for receiving the acquisition Map collection that the browser page of client sends Close the request of key object number in object, according to request, key in the attributes object of statistics Map collection object The number of object also returns to the browser page of client;
Or,
Null value judging unit, for receiving the judgement Map collection object that the browser page of client sends Whether middle attributes object is empty request, according to request, it is judged that key in the attributes object of Map collection object Whether the number of object is 0, and corresponding judged result returns to the browser page of client;
Or,
All key object acquisition unit, for receiving the acquisition Map collection that the browser page of client sends Close the request of all key objects in object, according to request, all key objects in attributes object are returned to The browser page of client;
Or,
All value object acquiring units, the acquisition Map set of the browser page transmission receiving client is right As the request of middle all values object, according to request, by corresponding with all key objects in attributes object Value object returns to the browser page of client.
Technical scheme carries for the use JavaScript script in Fat Client pattern The storage of List collection object and the consumption energy existed when searching data, the problem such as efficiency is low, pass through JavaScript script creates the Map collection object of a kind of mapping structure, to browse client-side The data object of device stores and manages, thus decreases the number of times to server request, due to Map Collection object is to map one by one with value object according to key object when storing data, can be fast by key object The corresponding value object that finds of speed avoids array circulation when List searches, thus reduces browser Memory consumption during inquiry, improves webpage rendering speed and the performance of browser.
Accompanying drawing explanation
Fig. 1 is the flow chart of a kind of client-side data management method that one embodiment of the invention provides;
Fig. 2 is the schematic diagram of a kind of Map collection object that one embodiment of the invention provides;
Fig. 3 is the Map set added to by data object shown in Fig. 2 that one embodiment of the invention provides Schematic diagram in object;
Fig. 4 is a kind of acquisition from the Map collection object shown in Fig. 2 that one embodiment of the invention provides The schematic diagram of single value object;
Fig. 5 is the block diagram of the device of a kind of managing customer side data that one embodiment of the invention provides.
Detailed description of the invention
The main inventive concept of the present invention is: by being widely used in the JavaScript foot of client-side This language creates the number of the Map collection object storage client browser needs storage of a kind of mapping structure According to object.Owing to Map collection object is when storing data object, the key (Key) of each data object Object and value (value) object are all to exist in pairs, and key is unique to liking, in retrieval data pair As time obtain corresponding value object by key object, be similar in dictionary search word.Additionally, it is logical Cross JavaScript script and all of for data object call method is encapsulated into a Map collection object In, unification is called flexibly by this entrance of Map collection object.And by the key pair of data object As can realize the storage to data object, delete, the management operation such as acquisition.Due to Map collection object With List collection object essential difference in terms of data storage determine both search efficiency, take in The dramatically different of aspect such as deposit.The List collection object carried with JavaScript is compared, and the present invention passes through JavaScript script creates Map collection object, utilizes the attributes object of Map collection object The mode of MapObject storage key object is capable of when searching data, it is to avoid unnecessary array is followed Ring, substantially increases inquiry velocity.But also key object and the mapping relations one by one of value object can be passed through Carry out the request with customer in response end browser of other data management operations, thus decrease Client browse The inquiry of device consumes and memory consumption, improves the webpage rendering speed of client browser.
Fig. 1 is the flow process of the method for a kind of managing customer side data that one embodiment of the invention provides Figure, sees Fig. 1, and the method includes:
Step S110, creates empty Map collection by JavaScript script in the internal memory of client Close object, and in described Map collection object, create an empty attributes object;
Step S120, by client-side browser page need storage data object, according to key object with Value object mapping mode one by one is stored in described Map collection object, wherein, and the key pair of described data object As if unique, the key object of described data object is stored in described attributes object;
Step S130, the operation requests sent according to the client-side browser page received, to storage Data object be managed.
Through above-mentioned steps, it is achieved that the Map set storage of data object, will client-side browser The key object needing the data object of storage sets up mapping relations one by one with value object, each data object Key object is all unique, stores key object, at Map collection in the attributes object of Map collection object Close and the memory space in addition to attributes object of object stores value object, by depositing of Map collection object Storage structure can realize the quick storage to this data object, inquire about, the data management operations such as acquisition.? When realizing, Map collection object leaves a file in after having been created by script JavaScript In the file of entitled map.js, this map.js file is loaded into clear when needs use by client browser Look in the device page.
See table 1, by 10000 continuous retrieval and inquisitions of data relaying, this Map collection of the present invention The response time closing object is as follows with the contrast of the response time of List collection object:
Table 1
Collection object type List Map
Response time The 25-30 second 1.7-2 the second
By table 1 it can be seen that List collection object screens retrieval data by the circulation of simple array. And the primary characteristic that the Map of the present invention uses object achieves retrieval rapidly and efficiently, it is greatly shortened retrieval The response time of inquiry, thus reduce the memory consumption of client browser, improve client browser Performance, response speed.
Fig. 2 is the schematic diagram of a kind of Map collection object that one embodiment of the invention provides, and Fig. 3 is this A kind of being added to by data object in the Map collection object shown in Fig. 2 of an embodiment offer is provided Schematic diagram, Fig. 4 is a kind of from the Map collection object shown in Fig. 2 of one embodiment of the invention offer Obtain the schematic diagram of single value object.Below in conjunction with the Fig. 2 to Fig. 4 this managing customer end to the present invention Being specifically described of the method for side data.
See Fig. 2, first, in client internal memory with JavaScript script create one empty Map collection object, and in this Map collection object, create empty attributes object MapObject, Define a variable data and point to attributes object MapObject in this Map collection object.At Map Specifically with MapObject storage key object inside collection object.
See Fig. 3, after Map collection object has created, according to the storage demand of client browser, (i.e. passed to what client-side browser page was used for its display by server when needing storage data object Data object) time, the mode that this data object maps one by one according to key object and value object is stored in Map In collection object.Concrete, the browser page obtaining client needs the key pair of the data object stored As Key1 and value object Value;The key object Key1 and value object Value of data object are assigned to Variable data, stores attributes object by variable data by the key object Key1 of data object In MapObject, and set up the mapping relations one by one of key object Key1 and value object Value, by data The value object Value of object stores depositing outside attributes object MapObject in Map collection object In storage space.
See Fig. 3, called the put method of Map collection object by variable data, by data object Key object Key1 adds in attributes object MapObject, internal by Object.Key=Value's Mode stores in Map collection object.Empty in the storage in addition to attributes object of Map collection object Storage value object between.In the same way, by all data objects to be stored all according to key object with The mode that value object maps one by one stores in Map collection object, when carrying out data object to be stored During storage, if the situation that the key object Key1 meeting data object repeats, then store data object A rear value object, i.e. covers previous value object with a rear value object of data object.
See Fig. 4, after data object is stored into Map collection object, can be fast to this data object Corresponding information is looked for and returned to quick checking to the browser page of client, and i.e. the difference according to browse request will The result returned after data object operation is assigned to the element of client browser page.
In the present embodiment, the acquisition the comprising key object request sent according to client-side browser page, Key object in being asked by acquisition, searches the value object corresponding with key object in Map collection object And return to the browser page of client.This reflected one by one with value object by key object and key object Penetrate relation to the lookup mode searching corresponding value object avoid List collection object search data Time array circulation take considerable time the problem with performance, be effectively increased client-side data inquiry Efficiency and speed.Concrete, by variable data, call the get method of Map collection object, the party Method includes wanting the key object that the value object that obtains is corresponding, by this key object in Map collection object Find corresponding value object, the content of this value object is returned to the browser page of client.To scheme As a example by shown in 4, client-side browser page is sent by data call by variable get method and comprises key pair As the acquisition of key1 is asked, get method finds this key object in the attributes object in Map collection object Key1 the mapping relations one by one according to key object Yu value object, find the value corresponding with key image parameter Object (id=1;Name: title) and return to the browser page of client.If client is clear The device page of looking at is wanted to obtain value object corresponding to key object key2, it is only necessary to by data call by variable get Method sends the acquisition comprising key object key2 and asks.
The present embodiment Fig. 3 illustrates in Map collection object, store a data, i.e. include a key Object and the situation of a value object, and in the present embodiment, the content of value object Value is as follows, id=1; Name: title.Fig. 4 illustrates the situation storing three data in Map collection object.Can manage Solve, for other data to be stored, it is also possible to store Map collection object according to the mode shown in Fig. 3 In, and can obtain from Map collection object according to the mode shown in Fig. 4 after having stored and want The value object arrived.
Additionally, in the present embodiment, the method for this managing customer side data of the present invention can also connect Receive the removal request comprising key object that the browser page of client sends, according to the key in removal request Object, searches the value object corresponding with key object in Map collection object, and deletes after finding Key object and value object.Establish key object due to Map collection object when storing data object and value is right The mapping relations one by one of elephant, and the key of data object is unique to liking, and is so carrying out deletion action Time can quickly find value object and corresponding single value object and key object are deleted in the lump.And also Operation indicating can be included, if such as deleting successfully, then return and successfully point out, failed then return Failure prompting.
In the present embodiment, the operation requests sent according to the client-side browser page received, to depositing The data object of storage is managed including: the Map that empties of the browser page transmission receiving client gathers The request of object, and according to request, Map collection object is set to sky;Or,
In the acquisition Map collection object of the browser page transmission receiving client, key object number please Ask, according to request, add up the number of key object in the attributes object of Map collection object and return to client The browser page of end;Or,
Whether the attributes object that judges in Map collection object receiving that the browser page of client sends is Empty request, according to request, it is judged that in the attributes object of Map collection object, whether the number of key object is 0, and corresponding judged result is returned to the browser page of client;Here judged result has two kinds Situation, if the number of key object is 0 in the attributes object of Map collection object, returns Client browse Device webpage t rue, otherwise returns false.
Or,
In the acquisition Map collection object of the browser page transmission receiving client, all key objects please Ask, according to request, all key objects in attributes object are returned to the browser page of client;Or Person,
In the acquisition Map collection object of the browser page transmission receiving client, all values object please Ask, according to request, the value object corresponding with all key objects in attributes object is returned to client Browser page.
Through above-mentioned steps, by creating Map collection object data object is right according to key object and value Mode as mapping one by one stores, and so can quickly respond when carrying out data management operations and return Return corresponding content to client browser, thus decrease inquiry consumption and the internal memory of client browser Consume, improve the webpage rendering speed of client browser.
Fig. 5 is the block diagram of the device of a kind of managing customer side data that one embodiment of the invention provides, Seeing Fig. 5, the device 500 of this managing customer side data of the present invention includes:
Map collection object creating unit 510, for passing through JavaScript script in the internal memory of client Language creates empty Map collection object, and creates an empty attributes object in Map collection object;
Data storage cell 520, for the browser page of client being needed the data object of storage, It is stored in Map collection object according to key object and value object mapping mode one by one, wherein, data object Key is unique to liking, and is stored in attributes object by the key object of data object;
Data Management Unit 530, for the operation sent according to the client-side browser page received Request, is managed the data object of data storage cell 520 storage.
In the present embodiment, data storage cell 520 specifically for:
Define a variable and point to the attributes object in Map collection object;
Receive the key object comprising data object and the storage of value object that client-side browser page sends Request;
According to storage request, key object and the value object of data object are assigned to variable, by variable by number Store in attributes object according to the key object of object, the value object of data object is stored Map set right In the memory space outside attributes object in as, and set up the mapping relations one by one of key object and value object.
In the present embodiment, Data Management Unit 530 also includes:
Single value object acquiring unit, for receive client browser page send comprise key object Acquisition request, according to obtain request in key object, in Map collection object search and key object phase Corresponding value object also returns to the browser page of client.
In the present embodiment, Data Management Unit 530 also includes:
Data deletion unit, for receiving the deletion comprising key object that the browser page of client sends Request, according to the key object in removal request, searches corresponding with key object in Map collection object Value object, and after finding, delete key object and value object.
In the present embodiment, Data Management Unit 530 also includes:
Data empty unit, for receive client browser page send empty Map collection object Request, and according to request Map collection object is set to sky;Or,
Key object number acquiring unit, for receiving the acquisition Map collection that the browser page of client sends Close the request of key object number in object, according to request, key in the attributes object of statistics Map collection object The number of object also returns to the browser page of client;Or,
Null value judging unit, for receiving the judgement Map collection object that the browser page of client sends Whether middle attributes object is empty request, according to request, it is judged that key in the attributes object of Map collection object Whether the number of object is 0, and corresponding judged result returns to the browser page of client;Or Person,
All key object acquisition unit, for receiving the acquisition Map collection that the browser page of client sends Close the request of all key objects in object, according to request, all key objects in attributes object are returned to The browser page of client;Or,
All value object acquiring units, the acquisition Map set of the browser page transmission receiving client is right As the request of middle all values object, according to request, by corresponding with all key objects in attributes object Value object returns to the browser page of client.
It should be noted that the work process of the device of this managing customer side data of the present invention be with The method of aforementioned managing customer side data is corresponding, the work that the device of managing customer side data is concrete The explanation realizing step part of the method for managing customer side data is may refer to, at this no longer as process Repeat.
The device utilizing this managing customer side data of the present invention can quickly store and lookup is wanted Data, decrease that the inquiry of client-side browser consumes, the internal memory reducing client browser disappears Consumption, and also can be carried out other according to the relation that Map collection object value object and key object map one by one Management operation, shorten response time, be greatly promoted client survey browser page rendering speed.
To sum up, the method and apparatus of this managing customer side data of the present invention passes through JavaScript foot This language creates Map collection object needs the data object of storage according to key object client browser Set up mapping relations one by one with value object, and key is unique to liking, it is achieved that be quick according to key object Retrieval is to value object, it is to avoid unnecessary array circulation, substantially increases inquiry velocity.Visitor Family end browser needs the object of storage to be placed in client internal memory, decrease to server request time Number;But also can be carried out it according to the request of client browser by key object and corresponding value object His data management operations, thus decrease the inquiry consumption of client browser, reduce Client browse The memory consumption of device, improve the webpage rendering speed of client browser.
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the protection model of the present invention Enclose.All any modification, equivalent substitution and improvement etc. made within the spirit and principles in the present invention, all Comprise within the scope of the present invention.

Claims (10)

1. the method for managing customer side data, it is characterised in that the method includes:
Empty Map collection object is created by JavaScript script in the internal memory of client, and An empty attributes object is created in described Map collection object;
Client-side browser page is needed the data object of storage, according to key object with value object one by one Mapping mode is stored in described Map collection object, and wherein, the key of described data object is unique to liking, And the key object of described data object is stored in described attributes object;
The operation requests sent according to the client-side browser page received, the described data to storage Object is managed.
2. the method for claim 1, it is characterised in that described by client-side browser page It is right that the data object needing storage is stored in described Map set according to key object-value object mapping mode one by one In as, wherein, it is stored in described attributes object include by the key object of described data object:
Define a variable and point to the attributes object in described Map collection object;
Receive the key object comprising data object and the storage of value object of the browser page transmission of client Request;
According to described storage request, key object and the value object of described data object are assigned to described variable, Described in the key object of described data object being stored in described Map collection object by described variable In attributes object, the value object of described data object is stored the described genus in described Map collection object In memory space outside the sex object, and set up the mapping relations one by one of described key object and value object.
3. method as claimed in claim 1 or 2, it is characterised in that the client that described basis receives The operation requests that side browser page sends, is managed including to the described data object of storage:
Receive the acquisition the comprising key object request that the browser page of client sends, according to described acquisition Key object in request, searches the value object corresponding with described key object in described Map collection object And return to the browser page of described client.
4. method as claimed in claim 3, it is characterised in that the client-side that described basis receives The operation requests that browser page sends, is managed also including to the described data object of storage:
Receive the removal request comprising key object that the browser page of client sends, according to described deletion Key object in request, searches the value pair corresponding with described key object in described Map collection object As, and after finding, delete described key object and value object.
5. method as claimed in claim 4, it is characterised in that the client-side that described basis receives The operation requests that browser page sends, is managed also including to the described data object of storage:
The request emptying described Map collection object that the browser page of reception client sends, and according to Map collection object is set to sky by described request;
Or,
Key object number in the acquisition described Map collection object of the browser page transmission receiving client Request, according to described request, the number of key object returning in the attributes object of statistics Map collection object Browser page back to client;
Or,
In the judgement described Map collection object of the browser page transmission receiving client, attributes object is No is empty request, according to described request, it is judged that key object in the attributes object of described Map collection object Number whether be 0, and corresponding judged result is returned to the browser page of client;
Or,
All key objects in the acquisition described Map collection object of the browser page transmission receiving client Request, according to described request, all key objects in described attributes object are returned to the clear of client Look at the device page;
Or,
All values object in the acquisition described Map collection object of the browser page transmission receiving client Request, according to described request, by the value object corresponding with all key objects in described attributes object Return to the browser page of client.
6. the device of managing customer side data, it is characterised in that this device includes:
Map collection object creating unit, for passing through JavaScript script language in the internal memory of client Speech creates empty Map collection object, and creates an empty attribute pair in described Map collection object As;
Data storage cell, for client-side browser page being needed the data object of storage, according to Key object and value object mapping mode one by one are stored in described Map collection object, wherein, and described data pair The key of elephant is unique to liking, and is stored in described attributes object by the key object of described data object;
Data Management Unit, for the operation requests sent according to the client-side browser page received, The data object storing described data storage cell is managed.
7. device as claimed in claim 6, it is characterised in that described data storage cell specifically for:
Define a variable and point to the attributes object in described Map collection object;
Receive the key object comprising data object and the storage of value object that client-side browser page sends Request;
According to described storage request, key object and the value object of described data object are assigned to described variable, Described in the key object of described data object being stored in described Map collection object by described variable In attributes object, the value object of described data object is stored the described genus in described Map collection object In memory space outside the sex object, and set up the mapping relations one by one of described key object and value object.
Device the most as claimed in claims 6 or 7, it is characterised in that described Data Management Unit includes:
Single value object acquiring unit, for receive client browser page send comprise key object Acquisition request, according to described obtain request in key object, in described Map collection object search with Value object that described key object is corresponding also returns to the browser page of described client.
9. device as claimed in claim 8, it is characterised in that described Data Management Unit also includes:
Data deletion unit, for receiving the deletion comprising key object that the browser page of client sends Request, according to the key object in described removal request, searches and described key in described Map collection object The value object that object is corresponding, and after finding, delete described key object and value object.
10. device as claimed in claim 9, it is characterised in that described Data Management Unit also includes:
Data empty unit, and the described Map that empties sent for receiving the browser page of client gathers The request of object, and according to described request, Map collection object is set to sky;
Or,
Key object number acquiring unit, for receiving described in the acquisition that the browser page of client sends The request of key object number in Map collection object, according to described request, the genus of statistics Map collection object The number of key object return to the browser page of client in the sex object;
Or,
Null value judging unit, for receiving the judgement described Map set that the browser page of client sends In object, whether attributes object is empty request, according to described request, it is judged that described Map collection object In attributes object, whether the number of key object is 0, and corresponding judged result is returned to the clear of client Look at the device page;
Or,
All key object acquisition unit, for receiving described in the acquisition that the browser page of client sends The request of all key objects in Map collection object, according to described request, by the institute in described attributes object Key object is had to return to the browser page of client;
Or,
All value object acquiring units, receive the acquisition described Map collection that the browser page of client sends Close the request of all values object in object, according to described request, by with all keys in described attributes object The corresponding value object of object returns to the browser page of client.
CN201510063689.7A 2015-02-06 2015-02-06 Method and device for managing client-side data Pending CN105989054A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510063689.7A CN105989054A (en) 2015-02-06 2015-02-06 Method and device for managing client-side data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510063689.7A CN105989054A (en) 2015-02-06 2015-02-06 Method and device for managing client-side data

Publications (1)

Publication Number Publication Date
CN105989054A true CN105989054A (en) 2016-10-05

Family

ID=57037505

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510063689.7A Pending CN105989054A (en) 2015-02-06 2015-02-06 Method and device for managing client-side data

Country Status (1)

Country Link
CN (1) CN105989054A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103237060A (en) * 2013-04-08 2013-08-07 北京小米科技有限责任公司 Method, device and system for data object acquisition
CN103440289A (en) * 2013-08-16 2013-12-11 北京航空航天大学 Method for searching for webpage incompatible labels in parallel mode based on MapReduce

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103237060A (en) * 2013-04-08 2013-08-07 北京小米科技有限责任公司 Method, device and system for data object acquisition
CN103440289A (en) * 2013-08-16 2013-12-11 北京航空航天大学 Method for searching for webpage incompatible labels in parallel mode based on MapReduce

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JERRY QU: "ES6中的Set、Map和WeakMap", 《HTTPS://IMQUQU.COM/POST/SET-MAP-WEAKMAP-IN-ES6.HTML》 *
紫云飞: "[译]ECMAScript 6中的集合类型,第二部分:Map", 《HTTP://WWW.CNBLOGS.COM/ZIYUNFEI/ARCHIVE/2012/10/10/2717754.HTML》 *

Similar Documents

Publication Publication Date Title
US20170185654A1 (en) Method and server for pushing information proactively
CN101867607A (en) Distributed data access method, device and system
CN103618787B (en) A kind of webpage represents system and method
CN112269789B (en) Method and device for storing data, and method and device for reading data
CN104346345B (en) The storage method and device of data
JP5841299B2 (en) Method for pushing information and apparatus for pushing information
CN101763357A (en) Method and system for browser to load internet resources
CN105122237A (en) Sharing application states
CN105610909A (en) Mobile browser resource loading optimization method based on cloud-side cooperation
CN107590145A (en) A kind for the treatment of method and apparatus of page static resource
CN105472045A (en) Database migration method and database migration device
CN103365893B (en) A kind of method and apparatus of the individual information for realizing search user
US20120310941A1 (en) System and method for web-based content categorization
CN101216823A (en) Website navigation system and website navigation method
US20160292291A1 (en) Methods and apparatuses for opening a webpage, invoking a client, and creating a light application
CN103109273A (en) Method and apparatus for managing data
CN104580448A (en) Information push method and device
CN1960371B (en) Method and system for accessing file of Web application program
CN108334516A (en) Information-pushing method and device
CN110119396B (en) Data management method and related product
CN106202549A (en) The method and device that a kind of picture loads
CN103533029B (en) Gantt chart data loading method and system
CN105653717B (en) A kind of method and device that information is shared
CN104615770A (en) Recommendation method and recommendation device for data of bookmark of mobile terminal
CN112905600B (en) Data query method and device, storage medium and electronic equipment

Legal Events

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

Application publication date: 20161005