A kind of method and apparatus of network management intermediate library data acquisition
Technical field
The present invention relates to communication technical field, especially a kind of method and apparatus of network management intermediate library data acquisition.
Background technology
Along with the huge of mobile industry user and traffic carrying capacity increases, in order to analyze, improve and optimize the data-handling capacity of existing network, need regularly, regular from the business datum of magnanimity, obtain useful data message amount;
In present data acquisition system, generally all be to gather after the granularity, write down this acquisition time, gather the data of next granularity time next time again, if delay has appearred in the data source in source, can make that then the data of gathering are imperfect, thereby the data that cause reporting there is disappearance; In addition, if Upper NM Station is when obtaining data, the database in source chain rupture occurred or network breaks down, and then this situation that can cause data to be failed to report occurs.
As shown in Figure 1, the method for present network management intermediate library and Upper NM Station data acquisition:
Step 101, at every turn from data source during image data, whether the judgment data source has collectable data, as does not have, and this time gathers and finishes; Then change step 102 over to if any data;
Step 102, the data of gathering this acquisition time are saved in network management intermediate library, and write down the time of this data acquisition;
Step 103, the every certain interval of time of Upper NM Station is gathered a secondary data from network management intermediate library, and reports the data that collect.
The shortcoming that said method exists is that the data of (1) collection are imperfect: because the time-delay of each links such as ticket, FTP and warehouse-in causes the data loading time-delay, the data that webmaster once collects may be imperfect; (2) owing to network blockage, the server unpredictable reasons such as machine of delaying, webmaster may occur and not collect the situation that data just report.
Summary of the invention
The invention provides a kind of method and apparatus of network management intermediate library data acquisition, overcome the problem of the imperfect and disappearance of network management intermediate library data acquisition in the prior art.
A kind of method of network management intermediate library data acquisition comprises:
During at every turn from the data source image data, judge the state of current remote link, wherein, the state of described remote link comprises startup attitude, normal state or chain rupture state;
State according to described remote link obtains storage to network management intermediate library from data source, wherein,
If the state of described remote link is for starting attitude, then according to time of current data collection point, with the historical data of collection point identical in the historical data with this time as the storage of current collection point to network management intermediate library;
If the state of described remote link is a normal state, then from the data source acquired data storage to network management intermediate library;
If the state of described remote link is the chain rupture state, then according to time of current data collection point, with the historical data of collection point identical in the historical data with this time as the storage of current collection point to network management intermediate library.
If the state of described remote link is a normal state, comprise then from the data source acquired data storage to network management intermediate library:
If the state of described remote link is a normal state, whether collectable data are arranged in the judgment data source, if do not have, process ends then, if collectable data are arranged, then acquired data storage is in network management intermediate library.
If described have collectable data, then acquired data storage comprises in network management intermediate library:
If collectable data are arranged, then by default equipping rules, the data of obtaining the data of this acquisition time and being offset N the acquisition granularity time forward, and with the storage that gets access in network management intermediate library, wherein N is an integer.
The state of the current remote link of described judgement comprises:
Judge the connection situation of current remote link, if chain rupture determines that then current remote link state is the chain rupture state;
If the connection situation of current remote link is not chain rupture, whether the remote link state is the chain rupture state when then judging the last time data acquisition, if the remote link state is non-chain rupture state during the last time data acquisition, determines that then current remote link state is a normal state;
If the remote link state is the chain rupture state during last time data acquisition, whether the remote link state is to start attitude when then judging the last time data acquisition, if the remote link state is not to start attitude during the last time data acquisition, the state of then judging current remote link is for starting attitude; If the state of remote link is to start attitude during the last time data acquisition, the state of then judging current remote link is a normal state.
This method further comprises:
If the state of remote link is to start attitude during the last time data acquisition; judge then whether reach startup protection preset value, if do not reach, the current state of then determining remote link is for starting attitude if starting to present duration; if reach preset value, determine that then the state of remote link is a normal state.
A kind of device of network management intermediate library data acquisition comprises:
The link identifying unit when being used at every turn from the data source image data, is judged the state of current remote link;
Data acquisition module is used for obtaining storage to network management intermediate library according to the state of described remote link from data source, and wherein, if the state of described remote link starts attitude, then the time with the current data collection point is sent to the historical data replication module;
The historical data acquisition module is used for the time according to the current data collection point, with the historical data of collection point identical in the historical data with this time as the storage of current collection point to network management intermediate library.
The state of described current remote link also comprises normal state or chain rupture state, is normal state if then described data acquisition module also is used for the state of described remote link, then from the data source acquired data storage to network management intermediate library; If the state of described remote link is the chain rupture state, then the time with the current data collection point is sent to the historical data replication module.
Described this data acquisition module also is used for by default equipping rules, the data of obtaining the data of this acquisition time and being offset N the acquisition granularity time forward, and with the storage that gets access in network management intermediate library, wherein N is an integer.
Described link identifying unit comprises first identifying unit, second identifying unit and the 3rd identifying unit:
First identifying unit is used to judge the connection situation of current remote link, if chain rupture determines that then current remote link state is the chain rupture state; If the connection situation of current remote link is not chain rupture, then carry out second identifying unit;
Second identifying unit, remote link state chain rupture state whether when being used to the section of declaring data acquisition last time if the remote link state is non-chain rupture state during the last time data acquisition, determines that then current remote link state is a normal state; If the remote link state is the chain rupture state during last time data acquisition, then carry out the 3rd identifying unit;
The 3rd identifying unit, whether the remote link state is to start attitude when being used to judge the last time data acquisition, if not starting attitude, the state of then judging current remote link is for starting attitude; If the startup attitude, the state of then judging current remote link is a normal state.
If the state of remote link was to start attitude when described the 3rd identifying unit also was used for the last time data acquisition; judge then whether start to present duration reaches startup protection preset value; if do not reach; the current state of then determining remote link is for starting attitude; if reach preset value, determine that then the state of remote link is a normal state.
The method and apparatus that the embodiment of the invention provided, before image data is put into network management intermediate library, at first judge the state of remote link, according to the different conditions of remote link from the data source image data, thereby the webmaster of having avoided unpredictable reason such as the machine of delaying owing to network blockage, server to cause does not collect data and just reports, thereby causes data disappearance or imperfect.
Description of drawings
Fig. 1 is the flow chart of network management intermediate library and Upper NM Station collecting method in the prior art;
Fig. 2 is the flow chart of the method for a kind of network management intermediate library data acquisition of the embodiment of the invention;
Fig. 3 is a state flow chart of judging remote link in the embodiment of the invention;
Fig. 4 also provides a kind of structure chart of device of network management intermediate library data acquisition for the embodiment of the invention;
Fig. 5 is the mechanism map of link identifying unit in the embodiment of the invention.
Embodiment
A kind of method of network management intermediate library data acquisition in the embodiment of the invention comprises: during at every turn from the data source image data, judge the state of current remote link, the state of wherein said remote link comprises normal state, chain rupture state and starts attitude; State according to described remote link obtains storage to network management intermediate library from data source, wherein, if the state of described remote link is a normal state, then from the data source acquired data storage to network management intermediate library; If the state of described remote link is the chain rupture state or starts attitude, then according to time of current data collection point, with the historical data of collection point identical in the historical data with this time as the storage of current collection point to network management intermediate library.
In the following description book, for purposes of illustration rather than in order to limit, specific details has been described, inject certain embodiments, technology, hardware circuit, device etc., so that can comprehensively understand to the present invention.But these embodiment and structure only are exemplary, the expert of present technique as can be seen, available other embodiment that do not break away from these specific detail realize the present invention.In other cases, omitted detailed description, hindered explanation of the present invention because of unnecessary detailed joint avoiding known network management intermediate library collecting method, device and technology.
Below in conjunction with Figure of description the specific embodiment of the present invention is elaborated.
As shown in Figure 2, the method for a kind of network management intermediate library data acquisition of the embodiment of the invention specifically comprises:
Step 201, from data source, during image data, judge the state of remote link, and the state information of preserving described remote link, wherein, the state of described remote link comprises normal state, chain rupture state and starts attitude;
In concrete realization environment, the embodiment of the invention can be by the extended stored procedure (sptes_tlinkedserver) of Microsoft's database (SQLSERVER2005), judge the connection situation of remote link, thereby judge the state of remote link, concrete implementation is: the remote linkage server address is as going into ginseng, returning null value is successfully, and nonzero value is failure (chain rupture).
Step 202, from data source, obtain storage to network management intermediate library according to the state of described remote link, if the state of described remote link is a normal state, then from the data source acquired data storage to network management intermediate library.
Wherein, if the state of described remote link is a normal state, whether collectable data are arranged in the judgment data source, if not then finish this flow process, if collectable data are arranged, then acquired data storage is in network management intermediate library.
Step 203, if the state of described remote link be the chain rupture state or start attitude, then according to time of current data collection point, with the historical data of collection point identical in the historical data with this time as the storage of current collection point to network management intermediate library.
In embodiments of the present invention, to network management intermediate library, the implementation that specifically is can be described historical data with collection point identical with this time in the historical data as the storage of current collection point:
Because the data of the data in the data source and this time of the previous day are roughly the same, so the state of current remote link is the chain rupture state, start attitude or data source when not having collectable data in this collection point, then reproducible the previous day synchronization data as the storage of current collection point in network management intermediate library.
In embodiments of the present invention, for the integrality that guarantees data when the image data, outside obtaining the data of current point in time, also gather the data that are offset N the acquisition granularity time forward, wherein N is an integer.
As shown in Figure 3, the specific implementation of the state of described in embodiments of the present invention judgement remote link comprises:
Step 301 is judged the connection situation of current remote link, if chain rupture determines that then current remote link state is the chain rupture state; If the connection situation of current remote link is not chain rupture, then change step 302 over to;
Step 302, whether the remote link state is the chain rupture state when judging the last time data acquisition, if the remote link state is non-chain rupture state during the last time data acquisition, determines that then current remote link state is a normal state; If the remote link state is the chain rupture state during last time data acquisition, then change step 303 over to;
Step 303, whether the remote link state is to start attitude when judging the last time data acquisition, if the remote link state is not to start attitude during the last time data acquisition, the state of then judging current remote link is for starting attitude; If the state of remote link is to start attitude during the last time data acquisition, the state of then judging current remote link is a normal state.
In addition for fear of the losing of data, if in the embodiment of the invention during last time data acquisition state of remote link be to start attitude, then further comprise step 304;
Step 304 judges whether reach startup protection preset value, if do not reach, the current state of then determining remote link is for starting attitude if starting to present duration, if reach preset value, then the state of definite remote link is a normal state.
As shown in Figure 4, according to said method, the embodiment of the invention also provides a kind of device of network management intermediate library data acquisition, comprising:
Link identifying unit 401 when being used at every turn from the data source image data, is judged the state of current remote link, and the state of wherein said remote link comprises normal state, chain rupture state and starts attitude;
Data acquisition module 402 is used for obtaining storage to network management intermediate library according to the state of described remote link from data source, wherein, if the state of described remote link is a normal state, then from the data source acquired data storage to network management intermediate library; If the state of described remote link is the chain rupture state or starts attitude that then the time with the current data collection point is sent to the historical data replication module;
This data acquisition module 402 also is used for by default equipping rules, the data of obtaining the data of this acquisition time and being offset N the acquisition granularity time forward, and with the storage that gets access in network management intermediate library, wherein N is an integer.
Historical data acquisition module 403 is used for the time according to the current data collection point, with the historical data of collection point identical in the historical data with this time as the storage of current collection point to network management intermediate library.
As shown in Figure 5, described link identifying unit 401 comprises, first identifying unit 501, second identifying unit 502 and the 3rd identifying unit 503:
First identifying unit 501 is used to judge the connection situation of current remote link, if chain rupture determines that then current remote link state is the chain rupture state; If the connection situation of current remote link is not chain rupture, then carry out second identifying unit 502;
Second identifying unit 502, remote link state chain rupture state whether when being used to the section of declaring data acquisition last time if the remote link state is non-chain rupture state during the last time data acquisition, determines that then current remote link state is a normal state; If the remote link state is the chain rupture state during last time data acquisition, then carry out the 3rd identifying unit 503;
The 3rd identifying unit 503, whether the remote link state is to start attitude when being used to judge the last time data acquisition, if not starting attitude, the state of then judging current remote link is for starting attitude; If the startup attitude, the state of then judging current remote link is a normal state.
If the state of remote link was to start attitude when the 3rd identifying unit 503 also was used for the last time data acquisition in addition; judge then whether start to present duration reaches startup protection preset value; if do not reach; the current state of then determining remote link is for starting attitude; if reach preset value, determine that then the state of remote link is a normal state.
The method and apparatus that the embodiment of the invention provided, before image data is put into network management intermediate library, at first judge the state of remote link, from the data source image data, the webmaster that causes from the unpredictable reasons such as machine of having avoided delaying owing to network blockage, server does not collect the situation that data just report according to the different conditions of remote link.If the current state of remote link is a normal state in addition, then adopt normal data acquisition flow, hit also and can gather N the granularity data of having gathered again at every turn at this by configuration, ensure the integrality of image data like this.
Method of the present invention is not limited to the embodiment described in the embodiment, and those skilled in the art's technical scheme according to the present invention draws other execution mode, belongs to technological innovation scope of the present invention equally.Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.