CN104317905B - A kind of method and system of information monitoring real time data caching process - Google Patents
A kind of method and system of information monitoring real time data caching process Download PDFInfo
- Publication number
- CN104317905B CN104317905B CN201410580867.9A CN201410580867A CN104317905B CN 104317905 B CN104317905 B CN 104317905B CN 201410580867 A CN201410580867 A CN 201410580867A CN 104317905 B CN104317905 B CN 104317905B
- Authority
- CN
- China
- Prior art keywords
- node
- pointer
- new
- key assignments
- specified location
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24552—Database cache management
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention provides a kind of method of information monitoring real time data caching process, and methods described includes receiving the data that need to be cached;Data object is set up according to data cached, and the key assignments in data object is set to a numerical value key assignments, and the data object after setting is carried into chain table pointer as a new node of binary sort tree;Wherein, data object includes key assignments data value corresponding with the key assignments;Chain table pointer includes left pointer and right pointer;Detect the numerical value key assignments of new node numerical value key assignments size cases corresponding with existing node on binary sort tree, and specified location of the new node on binary sort tree is obtained according to detection case and binary sort tree is updated, receive data cached is further deposited in specified location.Implement the embodiment of the present invention, the operating pressure reduced to disk database and file can be maximized, improve the speed of renewal of the page data, improve the performance of data visualization.
Description
Technical field
The present invention relates to microcomputer data processing field, more particularly to a kind of information monitoring real time data caching process
Method and system.
Background technology
Visualization technique refer to utilize computer graphics and image processing techniques, convert the data into intuitively figure or
Image is shown, and carries out the technology of interaction process, is easy to the process observed its simulation and calculated.And data visualization can be with
The processing speed of data is greatly speeded up, making the mass data of each moment generation can be effectively utilized, and can observe
The phenomenon implied into data, to find and solving to provide strong instrument the problem of in O&M.
, can be by counting, classifying, concluding, melting because grid information system can produce substantial amounts of data during O&M
The means such as conjunction carry out data visualization processing to operation/maintenance data, therefore data visualization management is gradually mentioned important working day
Come in journey.Staff no longer needs more static datas, and it is desirable that integrate the information of a variety of applications, and moved
State, show in real time, so that quick insight is obtained, to help to formulate decision-making and reply special circumstances.
Constantly expand with the scope and depth of operation management, and fine-grained management, in face of visualization requirement also with day
All to increase, it visualizes requirement to resource also more and more higher, and data buffer storage processing method of the prior art is to disk database
Bring and greatly read pressure, the visualization of the bottleneck effect of its performance further deeply develops.
The content of the invention
Technical problem to be solved of the embodiment of the present invention is that there is provided a kind of information monitoring real time data caching process
Method and system, can maximize the operating pressure reduced to disk database and file, improve the speed of renewal of the page data,
Improve the performance of data visualization.
In order to solve the above-mentioned technical problem, the embodiments of the invention provide a kind of information monitoring real time data caching process
Method, it realizes that methods described includes on the caching server for being cached the data of collection:
The data that a, reception need to be cached;
B, received according to it is data cached set up data object, and the key assignments in the data object is set to
One numerical value key assignments, and the data object after the setting is carried into chain table pointer as a new node of binary sort tree;Its
In, the data object includes key assignments and the corresponding data value of the key assignments;The chain table pointer includes left pointer and right pointer;
C, the numerical value key assignments of the detection new node numerical value key assignments corresponding with existing node on the binary sort tree are big
Small situation, and specified location of the new node on the binary sort tree is obtained according to detection case and the y-bend is updated
Sorting tree, what is further received in the obtained specified location described in storage is data cached;
Wherein, the specific steps of the step c include:
According to default traversal method, the numerical value key assignments of the new node is calculated with being had on the binary sort tree
The difference set of the corresponding numerical value key assignments of node;
When in the difference set absolute difference have a minimum value and for 0 when, obtain the value key with the new node
Its position on the binary sort tree of the equal node of value, and using the obtained position as the new node described
Specified location on binary sort tree, what is further received in the obtained specified location described in storage is data cached.
Wherein, the specific steps of the step c also include:
When in the difference set absolute difference have a minimum value and not be 0 when, detect the minimum absolute difference value
It is positive number before taking absolute value;
It will be minimum node as pointer node with the numerical value key assignments absolute difference of the new node, and judge the finger
Whether the right pointer of pin knot point is empty;
If it is, the child node of the new node as the pointer node is added to the right finger of the pointer node
The binary sort tree is updated after on pin, the position that the specified location of the new node is pointed to for the right pointer of the pointer node is obtained
Put, what is further received in the obtained specified location described in storage is data cached;
If it is not, then when the left pointer for detecting the next child node of pointer node is space-time, the new node is made
Rear renewal is added to the left pointer of the next child node of pointer node for the child node of the next child node of pointer node
The binary sort tree, obtains the position that the specified location of the new node is pointed to for the left pointer of the next child node of pointer node
Put, what is further received in the obtained specified location described in storage is data cached;Or
When the left pointer for detecting the next child node of pointer node is not space-time, then the new node is further detected
Numerical value key assignments numerical value key assignments size feelings corresponding with existing node on the left side tree that the next child node of the pointer node is formed
Condition, and will be obtained on the left side tree of the next child node of pointer node be with the numerical value key assignments absolute difference of the new node
Minimum node is added to described as new pointer node, and using the child node of the new node as the new pointer node
The binary sort tree is updated after on the left pointer of new pointer node, and it is the new finger to obtain the specified location of the new node
The position that the left pointer of pin knot point is pointed to, what is further received in the obtained specified location described in storage is data cached.
Wherein, the specific steps of the step c also include:
When in the difference set absolute difference have a minimum value and not be 0 when, detect the minimum absolute difference value
It is negative before taking absolute value;
It will be minimum node as pointer node with the numerical value key assignments absolute difference of the new node, and judge the finger
Whether the left pointer of pin knot point is empty;
If it is, the child node of the new node as the pointer node is added to the left finger of the pointer node
The binary sort tree is updated after on pin, and obtains what the specified location of the new node was pointed to for the left pointer of the pointer node
Position, what is further received in the obtained specified location described in storage is data cached;
If it is not, then when the right pointer for detecting the next child node of pointer node is space-time, then by the new node
After being added as the child node of the next child node of pointer node to the right pointer of the next child node of pointer node more
The new binary sort tree, and it is the left pointer sensing of the next child node of pointer node to obtain the specified location of the new node
Position, further in the obtained specified location storage described in receive it is data cached;Or
When the right pointer for detecting the next child node of pointer node is not space-time, then the new section is further detected
The numerical value key assignments of point numerical value key assignments size corresponding with existing node on the right side tree that the next child node of the pointer node is formed
Situation, and the value key value difference value with the new node will be obtained on the right side tree of the next child node of pointer node for most
Small node adds the child node of the new node as the new pointer node to the new pointer as new pointer node
The binary sort tree is updated after on the right pointer of node, and it is the new pointer node to obtain the specified location of the new node
The position that right pointer is pointed to, what is further received in the obtained specified location described in storage is data cached.
Wherein, the specific steps of the step c also include:
When absolute difference has two equal minimum values in the difference set, by the numerical value key assignments with the new node
Absolute difference is that minimum and described minimum absolute difference value is the node of positive number before taking absolute value as pointer node;
When the left pointer of the pointer node is space-time, the child node of the new node as the pointer node is added
The binary sort tree is updated after on to the left pointer of the pointer node, and it is described to obtain the specified location of the new node
The position that the left pointer of pointer node is pointed to, the caching number further received in the obtained specified location described in storage
According to;
To be minimum with the numerical value key assignments absolute difference of the new node when the left pointer of the pointer node is not space-time
And the minimum absolute difference value before taking absolute value for negative node as new pointer node, using the new node as described
The child node of new pointer node updates the binary sort tree after adding to the right pointer of the pointer node, and obtains described
The position that the specified location of new node is pointed to for the new right pointer of pointer node, further in the obtained specified location
What is received described in storage is data cached.
Wherein, the default traversal method is preamble traversal, inorder traversal and postorder traversal any of which.
Wherein, the data object using after the setting carries chain table pointer as a new node of binary sort tree
The step of be specially:
Arranged as y-bend at the two ends for the data object that the left pointer, the right pointer are increased to after the setting respectively
A new node for sequence tree.
The embodiment of the present invention additionally provides a kind of system of information monitoring real time data caching process, and the system includes:
Receiving unit, for receiving the data that need to be cached;
Creating unit, for received according to it is data cached set up data object, and by the data object
Key assignments be set to a numerical value key assignments, and the data object after the setting carried into chain table pointer be used as the one of binary sort tree
Individual new node;Wherein, the data object includes key assignments and the corresponding data value of the key assignments;The chain table pointer includes left refer to
Pin and right pointer;
Positioning and buffer unit, for detecting the numerical value key assignments of the new node and existing node on the binary sort tree
Corresponding numerical value key assignments size cases, and specific bit of the new node on the binary sort tree is obtained according to detection case
Put and update the binary sort tree, what is further received in the obtained specified location described in storage is data cached;
Wherein, the positioning and buffer unit include:
Difference set computing module, for according to default traversal method, calculating the numerical value key assignments of the new node
The difference set of numerical value key assignments corresponding with existing node on the binary sort tree;
First specified location acquisition module, for when in the difference set absolute difference have a minimum value and for 0 when,
Obtain its position on the binary sort tree of the node equal with the numerical value key assignments of the new node, and obtained described
Specified location of the position as the new node on the binary sort tree, is further deposited in the obtained specified location
What is received described in putting is data cached.
Implement the embodiment of the present invention, have the advantages that:
In embodiments of the present invention, the deposit position of data is received due to being specified using binary sort tree, and uses chained list
Formula storage receives data, is not required to consider the deletion of data, can effective utilization space so that shows the page and refreshes from buffering
The cycle of data is less than the cycle for receiving data, can maximize the operating pressure reduced to disk database and file, improves
The speed of renewal of the page data, improves the performance of data visualization.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the accompanying drawing used required in technology description to be briefly described, it should be apparent that, drawings in the following description are only this
Some embodiments of invention, for those of ordinary skill in the art, without having to pay creative labor, according to
These accompanying drawings obtain other accompanying drawings and still fall within scope of the invention.
Fig. 1 is the flow chart of the method for information monitoring real time data caching process provided in an embodiment of the present invention;
Fig. 2 arranges for the y-bend of the method application scenarios of information monitoring real time data caching process provided in an embodiment of the present invention
The view of sequence tree one;
Fig. 3 is a renewal view of binary sort tree in Fig. 2;
Fig. 4 is the another renewal view of binary sort tree in Fig. 3;
Fig. 5 is the another renewal view of binary sort tree in Fig. 4;
Fig. 6 is the another renewal view of binary sort tree in Fig. 5;
Fig. 7 is the another renewal view of binary sort tree in Fig. 6;
Fig. 8 is the another renewal view of binary sort tree in Fig. 7;
Fig. 9 is the another renewal view of binary sort tree in Fig. 8;
Figure 10 is the another renewal view of binary sort tree in Fig. 9;
Figure 11 is the structural representation of the system of information monitoring real time data caching process provided in an embodiment of the present invention.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, the present invention is made into one below in conjunction with accompanying drawing
It is described in detail on step ground.
As shown in figure 1, be a kind of method of information monitoring real time data caching process provided in an embodiment of the present invention, its
Realized on the caching server that the data of collection are cached, methods described includes:
The data that step S101, reception need to be cached;
Step S102, received according to it is data cached set up data object, and by the key in the data object
Value is set to a numerical value key assignments, and it is new as one of binary sort tree that the data object after the setting is carried to chain table pointer
Node;Wherein, the data object includes key assignments and the corresponding data value of the key assignments;The chain table pointer include left pointer and
Right pointer;
Specifically, data object=corresponding data value of key assignments+key assignments;Wherein, key assignments=1, IP address (or implementor name
Claim), 2, example, 3, monitor control index;Wherein,
- IP address (or device name):Refer to the IP address in monitoring data source, such as equipment can not determine unique IP address
Or without IP address, available devices title;
- example:The title of same class object-instantiated, is all example such as database instance, disk C, D, without real
Example can be sky;
- monitor control index:Reactivity worth, availability, the data value of state and information, the capacity of such as disk is a monitoring
Index;
Data value=1, monitor control index value, 2, description information;Wherein, monitor control index value:Such as 50G.
Using each data object as a node of binary sort tree, according to its key assignments (IP address+example+prison
Control index) binary sort tree can be just set up, each node corresponds to a double-digit numerical value on binary sort tree
Key assignments and the data cached data value of correspondence storage, because data cached index size is not fixed, linked list type storage can be effective
Utilization space, reduce resource, the latter complete data object=corresponding data value of key assignments+key assignments of increase linked list type pointer
+ chain table pointer, therefore on binary sort tree, the two ends for the data object that left pointer, right pointer are increased to after setting respectively
As a new node of binary sort tree, left pointer points to its left child node, and right pointer points to its right child node, no child node
Then left and right pointer is sky.
Step S103, the numerical value key assignments of the detection new node numerical value corresponding with existing node on the binary sort tree
Key assignments size cases, and specified location of the new node on the binary sort tree is obtained according to detection case and institute is updated
Binary sort tree is stated, what is further received in the obtained specified location described in storage is data cached.
Detailed process is, because each node corresponds to a double-digit numerical value key assignments on binary sort tree, and with this
The size of double-digit numerical value key assignments is ranked up, therefore by default traversal method, can detect the numerical value key assignments of new node
Corresponding with existing node on binary sort tree numerical value key assignments size cases determine position of the new node on binary sort tree,
There is following four situation:
(1) the numerical value key assignments of new node is present in the situation on binary sort tree;
According to default traversal method, the numerical value key assignments of new node is calculated corresponding with existing node on binary sort tree
Numerical value key assignments difference set;
When in difference set absolute difference have a minimum value and for 0 when, obtain equal with the numerical value key assignments of new node
Its position on binary sort tree of node, and the specified location using the position as new node on the binary sort tree,
Receive data cached is further deposited on the position.
As an example, as shown in Fig. 2 have nine nodes on current binary sort tree, the corresponding number of nine nodes
Be worth key assignments set={ 10,20,26,28,29,30,50,60,67 }, numerical value key assignments=30 of new node, obtain difference set=
{ 20,10,4,2,1,0, -20, -30, -37 }, now, minimum value=0 and only one of which due to absolute difference, therefore new node
(30) specified location is exactly the node (30) on current binary sort tree, and the sequence of binary sort tree does not change, and enters one
Step deposits receive data cached on the node of the node (30).
(2) the numerical value key assignments of new node is not present on binary sort tree, now with existing node pair on binary sort tree
Have a minimum absolute difference value in the difference set for the numerical value key assignments answered, and minimum absolute difference value take absolute value before be positive number, should
Situation has three kinds of states:
According to default traversal method, the numerical value key assignments of new node is calculated corresponding with existing node on binary sort tree
Numerical value key assignments difference set;
When in difference set absolute difference have a minimum value and not be 0 when, detect minimum absolute difference value taking definitely
It is positive number before value;
It will be minimum node as pointer node with the numerical value key assignments absolute difference of new node, and judge pointer node
Whether right pointer is empty;
If it is, updating two after the child node of new node as pointer node is added to the right pointer of pointer node
Sorting tree is pitched, the position that the specified location of new node is pointed to for the right pointer of pointer node is obtained, further in the specified location
It is data cached that storage is received;
As an example, there are nine nodes on binary sort tree in fig. 2, the corresponding numerical value key assignments of nine nodes
Set={ 10,20,26,28,29,30,50,60,67 }, numerical value key assignments=14 of new node, obtain difference set=4, -6, -
12nd, -14, -15, -16, -36, -46, -53 }, now, due to only one of which absolute difference minimum value=4 and for positive number, therefore
Using node (10) as pointer node, and the right pointer of pointer node (10) is sky, regard new node (14) as pointer node
(10) child node updates binary sort tree, the specified location of new node (14) after adding to the right pointer of pointer node (10)
It is exactly the position that the right pointer of pointer node (10) is pointed to, as shown in figure 3, further depositing what is received on the new node (14)
It is data cached.
If it is not, then when the left pointer for detecting the next child node of pointer node is space-time, regarding new node as pointer section
The child node of the next child node of point updates binary sort tree after adding to the left pointer of the next child node of pointer node, obtains new
The specified location of node is the position that the left pointer of the next child node of pointer node is pointed to, and further deposits and connects in the specified location
What is received is data cached;
As an example, there are ten nodes on binary sort tree in figure 3, the corresponding numerical value key assignments of ten nodes
Set={ 10,14,20,26,28,29,30,50,60,67 }, numerical value key assignments=11 of new node, obtain difference set=1 ,-
3rd, -9, -15, -17, -18, -19, -39, -49, -56 }, now, due to only one of which absolute difference minimum value=1 and for just
Number, thus using node (10) as pointer node, and the left pointer of next child node (14) of pointer node (10) is sky, will be new
Node (11) updates binary sort tree, new node after being added as the child node of the node (14) to the left pointer of node (14)
(11) specified location is exactly the position that the left pointer of the node (14) is pointed to, as shown in figure 4, further on the new node (11)
It is data cached that storage is received.
When the left pointer for detecting the next child node of pointer node is not space-time, then the value key of new node is further detected
It is worth numerical value key assignments size cases corresponding with existing node on the left side tree of pointer node next child node formation, and will be in pointer
The numerical value key assignments absolute difference obtained on the left side tree of the next child node of node with new node is minimum node as new pointer
Node, and y-bend row is updated after the child node of new node as new pointer node added to the left pointer of new pointer node
Sequence tree, and the position that the specified location of new node is pointed to for the left pointer of new pointer node is obtained, further in the specified location
It is data cached that storage is received.
As an example, there are 11 nodes on binary sort tree in Fig. 4, the corresponding numerical value of 11 nodes
Key assignments set={ 10,11,14,20,26,28,29,30,50,60,67 }, numerical value key assignments=22 of new node obtain difference collection
={ 12,11,8,2, -4, -6, -7, -8, -28, -38, -45 } are closed, now, due to minimum value=2 of only one of which absolute difference
And be positive number, therefore using node (20) as pointer node, and the left pointer of next child node (30) of pointer node (20) is not
For sky, the left side tree of the node (30) is formed by node (28), node (26), obtain left side tree value key value set=26,
28 }, the corresponding child node in minimum value=4 (26) for filtering out absolute difference from difference set, regard child node (26) as newly finger
Pin knot point, y-bend is updated after finally the child node of new node (22) as node (26) is added to the left pointer of node (26)
Sorting tree, the specified location of new node (22) is exactly the position that the left pointer of node (26) is pointed to, as shown in figure 5, further at this
Receive data cached is deposited on new node (22).
(3) the numerical value key assignments of new node is not present on binary sort tree, now with existing node pair on binary sort tree
Have a minimum absolute difference value in the difference set for the numerical value key assignments answered, and minimum absolute difference value take absolute value before be negative, should
Situation also has three kinds of states:
According to default traversal method, the numerical value key assignments of new node is calculated corresponding with existing node on binary sort tree
Numerical value key assignments difference set;
When in difference set absolute difference have a minimum value and not be 0 when, detect minimum absolute difference value taking definitely
It is negative before value;
It will be minimum node as pointer node with the numerical value key assignments absolute difference of new node, and judge pointer node
Whether left pointer is empty;
If it is, updating two after the child node of new node as pointer node is added to the left pointer of pointer node
Sorting tree is pitched, and obtains the position that the specified location of new node is pointed to for the left pointer of pointer node, further in the specified location
It is data cached that upper storage is received;
As an example, there are 12 nodes on binary sort tree in Figure 5, the corresponding numerical value of 12 nodes
Key assignments set={ 10,11,14,20,22,26,28,29,30,50,60,67 }, numerical value key assignments=56 of new node obtain difference
Set={ 46,45,42,36,34,30,28,27,26,6, -4, -11 }, now, due to the minimum value of only one of which absolute difference
=4 and for negative, therefore using node (60) as pointer node, new node (56) is added as the child node of pointer node (60)
Binary sort tree is updated after on to the left pointer of pointer node (60), the specified location of new node (56) is exactly pointer node (60)
The position that left pointer is pointed to, as shown in fig. 6, further depositing receive data cached on the new node (56).
If it is not, then when the right pointer for detecting the next child node of pointer node is space-time, then regarding new node as pointer
The child node of the next child node of node updates the binary sort tree after adding to the right pointer of the next child node of pointer node,
And the position that the specified location of new node is pointed to for the left pointer of the next child node of pointer node is obtained, further in the specified location
It is data cached that upper storage is received;
As an example, there are 13 nodes on binary sort tree in figure 6, the corresponding numerical value of 13 nodes
Key assignments set={ 10,11,14,20,22,26,28,29,30,50,56,60,67 }, numerical value key assignments=59 of new node are obtained
Difference set={ 49,48,45,39,37,33,31,30,29,9,3, -1, -8 }, now, due to only one of which absolute difference
Minimum value=1 and for negative, therefore using node (60) as pointer node, and next child node (56) of pointer node (60)
Right pointer is sky, renewal after the child node of new node (59) as the node (56) is added to the right pointer of the node (56)
Binary sort tree, the specified location of new node (59) is exactly the position that the right pointer of the node (56) is pointed to, as shown in fig. 7, entering one
Step deposits receive data cached on the new node (59).
When the right pointer for detecting the next child node of pointer node is not space-time, then the numerical value of new node is further detected
Key assignments numerical value key assignments size cases corresponding with existing node on the right side tree that the next child node of pointer node is formed, and will refer to
The value key value difference value obtained on the right side tree of the next child node of pin knot point with new node is minimum node as new pointer section
Point, binary sort tree is updated after the child node of new node as new pointer node is added to the right pointer of new pointer node,
And obtain the position that the specified location of new node is pointed to for the right pointer of new pointer node, further depositing and connecing in the specified location
What is received is data cached.
As an example, there are 14 nodes on binary sort tree in the figure 7, the corresponding numerical value of 14 nodes
Key assignments set={ 10,11,14,20,22,26,28,29,30,50,56,59,60,67 }, numerical value key assignments=18 of new node are obtained
To difference set={ 8,7,4, -2, -4, -6, -10, -11, -12, -32, -38, -41, -42, -49 }, now, due to there was only one
Minimum value=2 of individual absolute difference and for negative, therefore using node (20) as pointer node, and pointer node (20) is next
The right pointer of child node (10) is not sky, and forms the right side tree of the node (10) by node (14), obtains the numerical value of right side tree
Key assignments set={ 14 }, the corresponding node in minimum value=4 (14) for filtering out absolute difference from difference set makees node (14)
For new pointer node, after finally the child node of new node (18) as node (14) is added to the right pointer of node (14) more
New binary sort tree, the specified location of new node (18) is exactly the position that the right pointer of node (14) is pointed to, as shown in figure 8, entering one
Step deposits receive data cached on the new node (14).
(4) the numerical value key assignments of new node is not present on binary sort tree, now with existing node pair on binary sort tree
There are two equal minimum absolute difference values in the difference set for the numerical value key assignments answered, the situation there are less than two kinds states;
According to default traversal method, the numerical value key assignments of new node is calculated corresponding with existing node on binary sort tree
Numerical value key assignments difference set;
When absolute difference has two equal minimum values in difference set, by the numerical value key assignments absolute difference with new node
It is the node of positive number before taking absolute value as pointer node for minimum and minimum absolute difference value;
When the left pointer of pointer node is space-time, the child node of new node as pointer node is added to pointer node
The binary sort tree is updated after on left pointer, and obtains the position that the specified location of new node is pointed to for the left pointer of pointer node
Put, receive data cached is further deposited in the specified location;
As an example, there are 15 nodes on binary sort tree in fig. 8, the corresponding numerical value of 15 nodes
Key assignments set={ 10,11,14,18,20,22,26,28,29,30,50,56,59,60,67 }, the numerical value key assignments of new node=
16, difference set={ 6,5,2, -2, -4, -6, -10, -12, -13, -14, -34, -40, -43, -44, -51 } are obtained, now, by
Equal in the minimum value for having two absolute differences is 2, and node (18) and new node (16) difference are positive number, therefore by node
(18) as pointer node, and the left pointer of node (18) is sky, and the child node of new node (16) as node (18) is added
Binary sort tree is updated after entering to the left pointer of node (18), the specified location of new node (16) is exactly the left finger of child node (18)
The position that pin is pointed to, as shown in figure 9, further depositing receive data cached on the new node (16).
To be minimum and minimum exhausted with the numerical value key assignments absolute difference of new node when the left pointer of pointer node is not space-time
To difference before taking absolute value for negative node as new pointer node, the child node of new node as new pointer node is added
Binary sort tree is updated after entering to the right pointer of pointer node, and obtains the specified location of new node and is referred to for new pointer node is right
The position that pin is pointed to, further deposits receive data cached in the specified location.
As an example, there are 16 nodes on binary sort tree in fig .9, the corresponding numerical value of 16 nodes
Key assignments set={ 10,11,14,16,18,20,22,26,28,29,30,50,56,59,60,67 }, the numerical value key assignments of new node
=40, difference set={ 30,29,26,24,22,20,18,14,12,11,10, -10, -16, -19, -20, -27 } are obtained, this
When, it is 10 to have the minimum value of two absolute differences equal, and node (50) and new node (40) difference are positive number, due to node
(50) left pointer is not sky, therefore regard new node (40) as node (30) as new pointer node as new pointer node
(30) child node updates binary sort tree, the specific bit of new node (40) after adding to the right pointer of new pointer node (30)
It is exactly position that the right pointer of new pointer node (30) is pointed to put, and as shown in Figure 10, further deposits and connects on the new node (40)
What is received is data cached.
It should be noted that default traversal method is preamble traversal, inorder traversal and postorder traversal any of which, and
Buffer service is in the more new state of data all the time once starting, and each key assignments data are used by view, it is not necessary to
Consider the deletion of data.
The embodiment of the present invention additionally provides a kind of system of information monitoring real time data caching process, and the system includes:
Receiving unit 210, for receiving the data that need to be cached;
Creating unit 220, for received according to it is data cached set up data object, and by the data object
In key assignments be set to a numerical value key assignments, and the data object after the setting carried into chain table pointer be used as binary sort tree
One new node;Wherein, the data object includes key assignments and the corresponding data value of the key assignments;The chain table pointer includes a left side
Pointer and right pointer;
Positioning and buffer unit 230, for detecting the numerical value key assignments of the new node with being had on the binary sort tree
The corresponding numerical value key assignments size cases of node, and finger of the new node on the binary sort tree is obtained according to detection case
Positioning is put and updates the binary sort tree, the caching number further received in the obtained specified location described in storage
According to.
Implement the embodiment of the present invention, have the advantages that:
In embodiments of the present invention, the deposit position of data is received due to being specified using binary sort tree, and uses chained list
Formula storage receives data, is not required to consider the deletion of data, can effective utilization space so that shows the page and refreshes from buffering
The cycle of data is less than the cycle for receiving data, can maximize the operating pressure reduced to disk database and file, improves
The speed of renewal of the page data, improves the performance of data visualization.
It is worth noting that, in said system embodiment, each included system unit simply enters according to function logic
What row was divided, but above-mentioned division is not limited to, as long as corresponding function can be realized;In addition, each functional unit
Specific name is also only to facilitate mutually distinguish, the protection domain being not intended to limit the invention.
Can be with one of ordinary skill in the art will appreciate that realizing that all or part of step in above-described embodiment method is
The hardware of correlation is instructed to complete by program, described program can be stored in a computer read/write memory medium,
Described storage medium, such as ROM/RAM, disk, CD.
Above disclosed is only a kind of preferred embodiment of the invention, can not limit the power of the present invention with this certainly
Sharp scope, therefore the equivalent variations made according to the claims in the present invention, still belong to the scope that the present invention is covered.
Claims (7)
1. a kind of method of information monitoring real time data caching process, it is characterised in that it is cached by the data of collection
Caching server on realize, methods described includes:
The data that a, reception need to be cached;
B, received according to it is data cached set up data object, and the key assignments in the data object is set to a number
It is worth key assignments, and the data object after the setting is carried into chain table pointer as a new node of binary sort tree;Wherein, institute
Stating data object includes key assignments and the corresponding data value of the key assignments;The chain table pointer includes left pointer and right pointer;
C, the numerical value key assignments of the detection new node numerical value key assignments size feelings corresponding with existing node on the binary sort tree
Condition, and obtain specified location of the new node on the binary sort tree according to detection case and update the y-bend sorting
Tree, what is further received in the obtained specified location described in storage is data cached;
Wherein, the specific steps of the step c include:
According to default traversal method, the numerical value key assignments of the new node and existing node on the binary sort tree are calculated
The difference set of corresponding numerical value key assignments;
When in the difference set absolute difference have a minimum value and for 0 when, obtain the numerical value key assignments phase with the new node
Deng its position on the binary sort tree of node, and using the obtained position as the new node in the y-bend
Specified location in sorting tree, what is further received in the obtained specified location described in storage is data cached.
2. the method as described in claim 1, it is characterised in that the specific steps of the step c also include:
When in the difference set absolute difference have a minimum value and not be 0 when, detect the minimum absolute difference value and taking
It is positive number before absolute value;
It will be minimum node as pointer node with the numerical value key assignments absolute difference of the new node, and judge the pointer section
Whether the right pointer of point is empty;
If it is, the child node of the new node as the pointer node is added to the right pointer of the pointer node
After update the binary sort tree, obtain the position that the specified location of the new node is pointed to for the right pointer of the pointer node,
What is further received in the obtained specified location described in storage is data cached;
If it is not, then when the left pointer for detecting the next child node of pointer node is space-time, regarding the new node as institute
The child node for stating the next child node of pointer node is added to the left pointer of the next child node of pointer node described in rear update
Binary sort tree, obtains the position that the specified location of the new node is pointed to for the left pointer of the next child node of pointer node,
What is further received in the obtained specified location described in storage is data cached;Or
When the left pointer for detecting the next child node of pointer node is not space-time, then the number of the new node is further detected
It is worth key assignments numerical value key assignments size cases corresponding with existing node on the left side tree that the next child node of the pointer node is formed, and
To be obtained on the left side tree of the next child node of pointer node with the numerical value key assignments absolute difference of the new node is minimum
Node as new pointer node, and the child node of the new node as the new pointer node added to described and new refers to
The binary sort tree is updated after on the left pointer of pin knot point, and it is the new pointer section to obtain the specified location of the new node
The position that the left pointer of point is pointed to, what is further received in the obtained specified location described in storage is data cached.
3. the method as described in claim 1, it is characterised in that the specific steps of the step c also include:
When in the difference set absolute difference have a minimum value and not be 0 when, detect the minimum absolute difference value and taking
It is negative before absolute value;
It will be minimum node as pointer node with the numerical value key assignments absolute difference of the new node, and judge the pointer section
Whether the left pointer of point is empty;
If it is, the child node of the new node as the pointer node is added to the left pointer of the pointer node
After update the binary sort tree, and obtain the position that the specified location of the new node is pointed to for the left pointer of the pointer node
Put, what is further received in the obtained specified location described in storage is data cached;
If it is not, then when detect the next child node of pointer node right pointer be space-time, then using the new node as
The child node of the next child node of pointer node updates institute after adding to the right pointer of the next child node of pointer node
Binary sort tree is stated, and obtains the position that the specified location of the new node is pointed to for the left pointer of the next child node of pointer node
Put, what is further received in the obtained specified location described in storage is data cached;Or
When the right pointer for detecting the next child node of pointer node is not space-time, then the new node is further detected
Numerical value key assignments numerical value key assignments size cases corresponding with existing node on the right side tree that the next child node of the pointer node is formed,
And it is minimum for being obtained on the right side tree of the next child node of pointer node with the value key value difference value of the new node
Node adds the child node of the new node as the new pointer node to the new pointer node as new pointer node
Right pointer on after update the binary sort tree, and obtain the specified location of the new node and refer to for the new pointer node is right
The position that pin is pointed to, what is further received in the obtained specified location described in storage is data cached.
4. the method as described in claim 1, it is characterised in that the specific steps of the step c also include:
, will be absolute with the numerical value key assignments of the new node when absolute difference has two equal minimum values in the difference set
Difference is that minimum and described minimum absolute difference value is the node of positive number before taking absolute value as pointer node;
When the left pointer of the pointer node is space-time, the child node of the new node as the pointer node is added to institute
The binary sort tree is updated after stating on the left pointer of pointer node, and it is the pointer to obtain the specified location of the new node
The position that the left pointer of node is pointed to, what is further received in the obtained specified location described in storage is data cached;
To be minimum and institute with the numerical value key assignments absolute difference of the new node when the left pointer of the pointer node is not space-time
Minimum absolute difference value is stated before taking absolute value for negative node as new pointer node, the new node is used as to described new refer to
The child node of pin knot point updates the binary sort tree after adding to the right pointer of the pointer node, and obtains the new section
The position that the specified location of point is pointed to for the new right pointer of pointer node, is further deposited in the obtained specified location
It is described receive it is data cached.
5. the method as described in claim 1, it is characterised in that the default traversal method is preamble traversal, inorder traversal
With postorder traversal any of which.
6. the method as described in claim 1, it is characterised in that the data object by after the setting carries chain table pointer
As binary sort tree a new node the step of be specially:
The two ends for the data object that the left pointer, the right pointer are increased to after the setting respectively are used as binary sort tree
A new node.
7. a kind of system of information monitoring real time data caching process, it is characterised in that the system includes:
Receiving unit, for receiving the data that need to be cached;
Creating unit, for received according to it is data cached set up data object, and by the key in the data object
Value is set to a numerical value key assignments, and it is new as one of binary sort tree that the data object after the setting is carried to chain table pointer
Node;Wherein, the data object includes key assignments and the corresponding data value of the key assignments;The chain table pointer include left pointer and
Right pointer;
Positioning and buffer unit, for detecting that the numerical value key assignments of the new node is corresponding with existing node on the binary sort tree
Numerical value key assignments size cases, and specified location of the new node on the binary sort tree is obtained simultaneously according to detection case
The binary sort tree is updated, what is further received in the obtained specified location described in storage is data cached;
Wherein, the positioning and buffer unit include:
Difference set computing module, for according to default traversal method, calculating numerical value key assignments and the institute of the new node
State the difference set of the corresponding numerical value key assignments of existing node on binary sort tree;
First specified location acquisition module, for when in the difference set absolute difference have a minimum value and for 0 when, obtain
Its position on the binary sort tree of the node equal with the numerical value key assignments of the new node, and by the obtained position
As specified location of the new node on the binary sort tree, further institute is deposited in the obtained specified location
State receive data cached.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410580867.9A CN104317905B (en) | 2014-10-27 | 2014-10-27 | A kind of method and system of information monitoring real time data caching process |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410580867.9A CN104317905B (en) | 2014-10-27 | 2014-10-27 | A kind of method and system of information monitoring real time data caching process |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104317905A CN104317905A (en) | 2015-01-28 |
CN104317905B true CN104317905B (en) | 2017-10-03 |
Family
ID=52373137
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410580867.9A Active CN104317905B (en) | 2014-10-27 | 2014-10-27 | A kind of method and system of information monitoring real time data caching process |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104317905B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109344303B (en) * | 2018-11-30 | 2020-12-29 | 广州虎牙信息科技有限公司 | Data structure switching method, device, equipment and storage medium |
CN113204681A (en) * | 2021-05-07 | 2021-08-03 | 北京柠檬微趣科技股份有限公司 | Data sorting method, device, equipment, storage medium and program product |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101726312A (en) * | 2008-10-15 | 2010-06-09 | 高德信息技术有限公司 | Method and device for retrieving interest points |
CN103745008A (en) * | 2014-01-28 | 2014-04-23 | 河海大学 | Sorting method for big data indexing |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7069272B2 (en) * | 2002-10-09 | 2006-06-27 | Blackrock Financial Management, Inc. | System and method for implementing dynamic set operations on data stored in a sorted array |
-
2014
- 2014-10-27 CN CN201410580867.9A patent/CN104317905B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101726312A (en) * | 2008-10-15 | 2010-06-09 | 高德信息技术有限公司 | Method and device for retrieving interest points |
CN103745008A (en) * | 2014-01-28 | 2014-04-23 | 河海大学 | Sorting method for big data indexing |
Non-Patent Citations (2)
Title |
---|
关于二叉排序树及删除异常的讨论;王元航;《安徽师范大学学报(自然科学版)》;20060630;第29卷(第3期);第2.2节 * |
基于数据结构的分析与应用;李素萍等;《北京教育学院学报(自然科学版)》;20061031;第1卷(第5期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN104317905A (en) | 2015-01-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9959015B2 (en) | Systems and methods for monitoring and analyzing performance in a computer system with node pinning for concurrent comparison of nodes | |
CN104166651B (en) | Method and apparatus based on the data search integrated to homogeneous data object | |
CN107040582A (en) | A kind of data processing method and device | |
CN107957957A (en) | The acquisition methods and device of test case | |
US20140320500A1 (en) | Proactive monitoring tree with state distribution ring | |
CN106970936A (en) | Data processing method and device, data query method and device | |
CN108345485A (en) | identification method and device for interface view | |
CN110706341A (en) | High-performance rendering method and device of city information model and storage medium | |
CN106407371A (en) | User comment data displaying method and system, server and client | |
JP2013537333A5 (en) | ||
CN104462616A (en) | Dynamic data collection method based on configuration item | |
CN108363657A (en) | Monitoring APP clients bury method, equipment and the medium of point data acquisition integrality | |
CN107748752A (en) | A kind of data processing method and device | |
CN108509544A (en) | The acquisition methods and device of mind map, equipment and readable storage medium storing program for executing | |
CN104317905B (en) | A kind of method and system of information monitoring real time data caching process | |
CN112860777A (en) | Data processing method, device and equipment | |
CN106599009A (en) | Display method and device for map data | |
CN1987775A (en) | Method and apparatus for resolving events | |
CN110020272A (en) | Caching method, device and computer storage medium | |
CN107526627A (en) | A kind of virtual resource life cycle information management method and device | |
CN104408057B (en) | A kind of method and device of data summarization | |
CN106250499A (en) | A kind of video is to method for digging and device | |
CN104239212B (en) | Query method and device of test case and establishment method and device of test case | |
CN110110000A (en) | Methods of exhibiting and device | |
CN108566429A (en) | A kind of high in the clouds sharing files method and apparatus |
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 |