A kind of site moving method and device
Technical field
The present invention relates to Real-Time Databases System Technique field, more particularly to a kind of site moving method and device.
Background technology
Real-time data base refers to the data in the signified real-time data base of current power informatization industry, the real-time data base
Organization unit is referred to as in measuring point, each real-time data base that thousands of measuring points can be set up, and can be carried by measuring point for user
For different types of data, such as:When the data recorded in the measuring point be CPU memory usages when, user by accessing the measuring point,
The information about CPU memory usages can be inquired about.
But, the measuring point in each real-time data base is fixed presence in the prior art, it is impossible to realized to system
In the migration (moving to another real-time data base from a real-time data base) of measuring point in each real-time data base, when in system
When the frequency of use of measuring point is uneven in each real-time data base, it will usually cause the number between each real-time data base in the system
It is larger (i.e. according to visit capacity difference:The relatively low real-time data base of frequency of use is idle, data access amount is smaller, and frequency of use compared with
High real-time data base data access amount is larger, produce data access delay), so can not provide the user preferably service,
Reduce user experience.
The content of the invention
In view of this, the embodiment of the present invention provides a kind of site moving method and device, real-time with each in guarantee system
The equilibrium of data access amount between database, provide the user more quality services.
To achieve these goals, technical scheme provided in an embodiment of the present invention is as follows:
A kind of site moving method, including:
The migration instruction received is responded, it is determined that purpose corresponding with the measuring point information carried in migration instruction is counted in real time
According to storehouse;
Will site moving corresponding with the measuring point information to the purpose real-time data base;
According to the information of the purpose real-time data base, index corresponding with the measuring point is believed in more metadata File
Breath.
It is preferred that, measuring point corresponding with the measuring point information is focus.
It is preferred that, in addition to determine focus according to following steps:
The focus decision instruction received is responded, judges whether measuring point meets the focus carried in the focus decision instruction
Rule of judgment;
When the measuring point meets the focus Rule of judgment, it is focus to determine the measuring point.
It is preferred that, at least one measuring point that the measuring point inputs for user, or each measuring point in the real-time data base.
It is preferred that, when measuring point is each measuring point in the real-time data base,
This method includes:
Respond the focus decision instruction that receives, with pre-set determination frequency, gradually judge the real-time data base
The middle measuring point collection for meeting the focus Rule of judgment carried in the focus decision instruction;
When judging that number of times meets preset value, it is determined that each measuring point judged in the common factor that obtained measuring point integrates is focus.
It is preferred that, it is determined that the process of purpose real-time data base corresponding with the measuring point information carried in migration instruction is:
Respectively in acquisition system each real-time data base physical resource utilization rate;
The measuring point that the minimum real-time data base of relative physics resource utilization is defined as carrying in instructing with the migration is believed
Cease corresponding purpose real-time data base.
It is preferred that, the process by corresponding with the measuring point information site moving to the purpose real-time data base is:
Title and the measuring point name identical purpose measuring point of the measuring point are created in the purpose real-time data base;
Obtain historical data corresponding with the measuring point;
The historical data is migrated into the purpose measuring point, realization will site moving corresponding with measuring point information to institute
State the process of purpose real-time data base.
It is preferred that, it is corresponding with the measuring point in more metadata File according to the information of the purpose real-time data base
Index information, including:
Obtain the purpose real time data library name of the purpose real-time data base;
By the purpose real time data library name, replace in meta data file in index information corresponding with the measuring point
Real time data library name.
A kind of site moving device, including:Determining unit, migration units and updating block, wherein,
The determining unit, for responding the migration received instruction, it is determined that the measuring point carried in being instructed with the migration is believed
Cease corresponding purpose real-time data base;
The migration units are connected with the determining unit, for will site moving corresponding with the measuring point information extremely
The purpose real-time data base;
The updating block is connected with the migration units, for the information according to the purpose real-time data base, more
Index information corresponding with the measuring point in metadata File.
It is preferred that, measuring point corresponding with the measuring point information is focus.
The application provides a kind of site moving method and device, and the migration that this method is received by responding is instructed, it is determined that
Purpose real-time data base corresponding with the measuring point information carried in migration instruction, then moves measuring point corresponding with measuring point information
Move to purpose real-time data base, and according to the information of purpose real-time data base, rope corresponding with measuring point in more metadata File
Fuse is ceased, and to realize that measuring point moves to purpose real-time data base from current real-time data storehouse, the application is moved by the measuring point of offer
Shifting method, to realize that data are visited between each real-time data base in the migration to measuring point in real-time data base and then guarantee system
The equilibrium for the amount of asking, provide the user more quality services.
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 described in invention, for those of ordinary skill in the art, on the premise of not paying creative work,
Other accompanying drawings can also be obtained according to these accompanying drawings.
Fig. 1 is a kind of site moving method flow diagram that the embodiment of the present application one is provided;
Fig. 2 is that a kind of focus that the embodiment of the present application two is provided determines method flow diagram;
Fig. 3 is a kind of structural representation for site moving device that the embodiment of the present application three is provided.
Embodiment
In order that those skilled in the art more fully understand the technical scheme in the present invention, below in conjunction with of the invention real
The accompanying drawing in example is applied, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described implementation
Example only a part of embodiment of the invention, rather than whole embodiments.Based on the embodiment in the present invention, this area is common
The every other embodiment that technical staff is obtained under the premise of creative work is not made, should all belong to protection of the present invention
Scope.
Embodiment one:
Fig. 1 is a kind of site moving method flow diagram that the embodiment of the present application one is provided.
As shown in figure 1, this method includes:
The migration instruction that S101, response are received, it is determined that purpose corresponding with the measuring point information carried in migration instruction
Real-time data base.
In the site moving instruction that the embodiment of the present application is provided, the migration received is responded first and is instructed, and preferred,
Migration instruction is sent for user by modes such as buttons.
In the embodiment of the present application, after the migration instruction of user's transmission is received, migration instruction can be responded, is determined at
The corresponding purpose real-time data base of measuring point information carried in migration instruction, and preferred, the process is:
1st, respectively in acquisition system each real-time data base physical resource utilization rate.
In the embodiment of the present application, it is preferred that the physical resource utilization rate of each real-time data base in the system got
Including:CPU usage, memory usage, network usage, hard disk utilization rate etc..
In the embodiment of the present application, the particular content that the physical resource utilization rate includes is (such as:CPU usage, internal memory are used
Rate, network usage, hard disk utilization rate etc.) can according to inventor the need for oneself set, be not limited thereto.
The 2nd, the minimum real-time data base of relative physics resource utilization is defined as to the measuring point carried in being instructed with the migration
The corresponding purpose real-time data base of information.
In the embodiment of the present application, it is preferred that when the physical resource utilization rate for getting each real-time data base in system
Afterwards, it is necessary to according to the physical resource utilization rate of each real-time data base, calculate corresponding with each real-time data base relative respectively
Physical resource utilization rate, and then the minimum real-time data base of relative physics resource utilization is defined as with being taken in migration instruction
The corresponding purpose real-time data base of measuring point information of band.
And in the embodiment of the present application, it is preferred that weight information table is set, be provided with the weight information table respectively with this
The corresponding weight of each content that physical resource utilization rate includes, when the physics for getting each real-time data base in system
After resource utilization, the process of relative physics resource utilization is as follows with each real-time data base respectively for calculating:
The value of each content of the physical resource utilization rate of the real-time data base is multiplied by corresponding weight respectively,
Such as:When physical resource utilization rate includes:When CPU usage, memory usage, network usage and hard disk utilization rate, it will obtain
CPU usage in the physical resource utilization rate corresponding with the real-time data base got is multiplied by the weight information table pre-set
In weight corresponding with the CPU usage, memory usage is multiplied by the weight information table pre-set and used with the internal memory
The corresponding weight of rate, network usage is multiplied by weight corresponding with the network usage in the weight information table pre-set,
And hard disk utilization rate is multiplied by weight corresponding with the hard disk utilization rate in the weight information table pre-set.When by the real-time number
It is multiplied by respectively after corresponding weight according to the value of each content of the physical resource utilization rate in storehouse, it is necessary to by the real-time data base
The value of each content of physical resource utilization rate be multiplied by the results added of corresponding weight respectively, obtain and the real-time number
According to the corresponding relative physics resource utilization in storehouse.
In the embodiment of the present application, it is preferred that in the weight information table pre-set respectively with physical resource utilization rate
The size of the corresponding weight of each content included, according to the setting of invention Man's Demands oneself, is not limited herein.
S102, will site moving corresponding with measuring point information to purpose real-time data base.
In the embodiment of the present application, it is preferred that by site moving corresponding with measuring point information to purpose real-time data base
Process is:
1st, the measuring point name identical purpose measuring point of title and measuring point is created in purpose real-time data base.
In the embodiment of the present application, will site moving corresponding with measuring point information to purpose real-time data base when, first,
Need to create a purpose measuring point in the purpose real-time data base, and (measuring point is for title and the measuring point of the purpose measuring point
Measuring point corresponding with measuring point information) measuring point title it is identical.
2nd, historical data corresponding with measuring point is obtained.
In the embodiment of the present application, in addition to creating purpose measuring point corresponding with measuring point in purpose real-time data base,
Also need to obtain survey historical information corresponding with measuring point.
And in the embodiment of the present application, do not limit creating purpose measuring point and obtaining the execution sequence of historical data
Fixed, inventor can set the order of both according to the demand of oneself.
3rd, historical data is migrated into purpose measuring point, realization will site moving corresponding with measuring point information it is real-time to purpose
The process of database.
In the embodiment of the present application, purpose measuring point is completed and after get historical data, it is necessary to by the history number when creating
According to migrating to purpose measuring point, and in the embodiment of the present application, it is preferred that by historical data copy/paste to purpose measuring point, and then
Regard the historical data as the data in purpose measuring point so that obtained purpose measuring point is identical with measuring point, realize by with
The corresponding site moving of measuring point information to purpose real-time data base process.
Further, in the embodiment of the present application, it is preferred that complete purpose survey when being created in purpose real-time data base
Point and historical data is migrated to the purpose measuring point, the measuring point in real-time data base is deleted (i.e.:Delete real-time data base
The middle measuring point migrated into purpose real-time data base).
Index information corresponding with measuring point in S103, the information according to purpose real-time data base, more metadata File.
In the embodiment of the present application, be previously provided with system in meta data file, and the meta data file be stored with
The corresponding index information of measuring point in each real-time data base in the system, can be with when user needs to access some measuring point
By the real time data library name in index information corresponding with the measuring point in the meta data file, indicate the reality that the measuring point is located at
When database.
Therefore, in the embodiment of the present application, it is necessary to real-time according to purpose after by site moving to purpose real-time data base
Index information corresponding with measuring point in the information of database, more metadata File, and preferred, the process is as follows:
1st, the purpose real time data library name of purpose real-time data base is obtained.
2nd, the purpose real time data library name that gets this, replace index corresponding with measuring point in the meta data file and believe
Real time data library name in breath.
Further, in a kind of site moving method that the embodiment of the present application is provided, it is preferred that corresponding with measuring point information
Measuring point be focus.
In the embodiment of the present application, when measuring point corresponding with the measuring point information that carries in migration instruction is focus, then generation
The table measuring point that is migrated is focus, and by the migration to focus in real-time data base, not only can each in guarantee system
The equilibrium of data access amount between real-time data base, provide the user more quality services, and can preferably solve because
There are multiple focuses in some real-time data base, caused by hot spot data access delay is high in the real-time data base, user's satisfaction
The problem of degree reduction.
Further, in the site moving method that the embodiment of the present application is provided, in addition to:When successful execution completes step
After S103, site moving successful information is pointed out.
Further, in the site moving method that the embodiment of the present application is provided, in addition to:Distinguished according to meta data file
Pair database information table corresponding with real-time data base and purpose real-time data base is updated.
In the embodiment of the present application, a meta data file corresponding with each real-time data base is not only provided with system,
And database information table corresponding with each real-time data base respectively is additionally provided with the system.
In the embodiment of the present application, after step S103 runs succeeded, i.e., according to the information of purpose real-time data base, success
Update and complete in meta data file after index information corresponding with the measuring point, in addition it is also necessary to the metadata text completed using the renewal
Part, update with real-time data base (real-time data base that the real-time data base is moved out for measuring point) corresponding database information table, with
And with purpose real-time data base (the purpose real-time data base is the real-time data base moved into of measuring point) corresponding database information table.
Wherein, update and real-time data base (real-time data base is the real-time data base that measuring point is moved out) corresponding database
Information table and with purpose real-time data base (the purpose real-time data base is the real-time data base moved into of measuring point) corresponding data
The process of storehouse information table is mainly:
The corresponding information of the measuring point moved out, Yi Ji in deletion database information table corresponding with real-time data base
The corresponding information of the measuring point is added in database information table corresponding with purpose real-time data base.
In the embodiment of the present application, it is corresponding by pair corresponding with measuring point real-time data base and purpose real-time data base
Database information table is updated, convenient when user conducts interviews to measuring point, directly in the last visit measuring point, with the survey
The measuring point is inquired about in the corresponding database information table of the corresponding real-time data base of point, and ought only be looked into the database information table
When asking less than the measuring point information, just go meta data file to be inquired about, it is to avoid every time during inquiry measuring point, directly remove metadata text
The process of part inquiry, and because measuring point information in meta data file correspondence system in all real-time data bases, therefore, directly from
Database information table corresponding with real-time data base carries out measuring point inquiry, and operation time is reduced to a certain extent, is improved
Efficiency.
The application provides a kind of site moving method and device, and the migration that this method is received by responding is instructed, it is determined that
Purpose real-time data base corresponding with the measuring point information carried in migration instruction, then moves measuring point corresponding with measuring point information
Move to purpose real-time data base, and according to the information of purpose real-time data base, rope corresponding with measuring point in more metadata File
Fuse is ceased, and to realize that measuring point moves to purpose real-time data base from current real-time data storehouse, the application is moved by the measuring point of offer
Shifting method, to realize that data are visited between each real-time data base in the migration to measuring point in real-time data base and then guarantee system
The equilibrium for the amount of asking, provide the user more quality services.
Embodiment two:
Fig. 2 is that a kind of focus that the embodiment of the present application two is provided determines method flow diagram.
As shown in Fig. 2 this method includes:
S201, reception focus decision instruction.
In the focus determination methods that the embodiment of the present application is provided, the focus decision instruction of user's input is received first, and
It is preferred that, carry focus Rule of judgment in the focus decision instruction.
Whether S202, measuring point meet the focus Rule of judgment carried in focus decision instruction.
In the embodiment of the present application, after focus decision instruction is received, the focus decision instruction received can be responded,
Judge whether measuring point meets the focus Rule of judgment carried in the focus decision instruction.
S203, when measuring point meets focus Rule of judgment, determine measuring point be focus.
In the embodiment of the present application, when measuring point meets the focus Rule of judgment carried in focus decision instruction, it is determined that
The measuring point is focus.
In the embodiment of the present application, when measuring point is unsatisfactory for the focus Rule of judgment carried in focus decision instruction, preferably
, terminate flow.And in the embodiment of the present application, the focus judgement that measuring point is unsatisfactory for carrying in focus decision instruction can also be worked as
During condition, send prompt message and terminate flow.
In the embodiment of the present application, it is preferred that when it is determined that whether measuring point is focus, the measuring point being judged is that user is defeated
Each measuring point at least one measuring point, or implementation database for entering.
When the measuring point that this is judged is at least one measuring point that user inputs, it is preferred that judge that the user inputs respectively
Each measuring point whether be focus, and the deterministic process is as shown in above-mentioned step S201-S203.
When the measuring point being judged is each measuring point in real-time data base, it is preferred that in the judgement real-time data base
Each measuring point whether be focus process it is as follows:
1st, respond the focus decision instruction that receives, with pre-set determination frequency, gradually judge in real-time data base
Meet the measuring point collection of the focus Rule of judgment carried in focus decision instruction.
In the embodiment of the present application, determination frequency is previously provided with, when whether judging each measuring point in real-time data base
During for focus, the focus decision instruction received is responded first, and then the determination frequency pre-set according to this gradually judges this
The measuring point collection of the focus Rule of judgment carried in focus decision instruction is met in real-time data base.In the embodiment of the present application, should
Focus Rule of judgment can be set according to the demand oneself of user, not limited herein.
And in the embodiment of the present application, it is preferred that in the focus decision instruction that the determination frequency can also input for user
Carry, in the embodiment of the present application, the setting form of the determination frequency can be set according to invention Man's Demands oneself, herein
Do not making introductions all round.
2nd, when judging that number of times meets preset value, it is determined that the measuring point in the common factor of each measuring point collection for judging to obtain is heat
Point.
In the embodiment of the present application, preset value is provided with, when judging that number of times is equal to the preset value, it is determined that judging every time
Common factor between the measuring point collection arrived, and measuring point in the common factor is focus.
Further, in the focus that the embodiment of the present application is provided determines method, the judgement time is also previously provided with, works as list
When the judgement time of secondary judgement exceedes the judgement time that this pre-sets, then illustrate that the focus Rule of judgment is undesirable, lead
Cause that the measuring point collection of response can not be judged as early as possible, at this moment, it is preferred that bar can be judged to the focus carried in focus decision instruction
Part is shown and changed.
The embodiment of the present application provides a kind of focus and determines method, and the focus provided by the embodiment of the present application determines method
So that the site moving method that the application is provided is more perfect, clear.
Embodiment three:
Fig. 3 is a kind of structural representation for site moving device that the embodiment of the present application three is provided.
As shown in figure 3, the device includes:Determining unit 1, migration units 2 and updating block 3, wherein,
Determining unit 1, for responding the migration received instruction, it is determined that the measuring point information pair carried in being instructed with the migration
The purpose real-time data base answered.
Migration units 2 are connected with determining unit 1, for site moving corresponding with measuring point information to be counted in real time to purpose
According to storehouse.
Updating block 3 is connected with migration units 2, for the information according to purpose real-time data base, more new metadata text
Index information corresponding with measuring point in part.
Further, in a kind of site moving device that the embodiment of the present application is provided, measuring point corresponding with measuring point information
For focus.
The application provides a kind of site moving method and device, and the device includes:Determining unit, migration units and renewal
Unit, the migration received is responded by determining unit and is instructed, it is determined that the measuring point information pair carried in being instructed with the migration first
The purpose real-time data base answered, then by migration units will site moving corresponding with measuring point information to purpose real-time data base,
Finally by information of the updating block according to purpose real-time data base, index corresponding with measuring point is believed in more metadata File
Breath, to realize that measuring point moves to purpose real-time data base, the site moving side that the application passes through offer from current real-time data storehouse
Method, to realize in the migration to measuring point in real-time data base and then guarantee system data access amount between each real-time data base
Equilibrium, provide the user more quality services.
The embodiment of each in the present invention is described by the way of progressive, and what each embodiment was stressed is and other realities
Apply the difference of example, between each embodiment identical similar portion mutually referring to.For device disclosed in embodiment
Speech, because it is corresponded to the method disclosed in Example, so description is fairly simple, related part is referring to method part illustration
.
It the above is only the preferred embodiment of the present invention, make skilled artisans appreciate that or realizing of the invention.It is right
A variety of modifications of these embodiments will be apparent to one skilled in the art, general original as defined herein
Reason can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, the present invention will not
Be intended to be limited to the embodiments shown herein, and be to fit to it is consistent with principles disclosed herein and features of novelty most
Wide scope.