Summary of the invention
The technical problem to be solved in the present invention is, for the above-mentioned defect of prior art, there is provided a kind of and based on the selection of user and configuration, data download method and the PC download client of required call bill data can be downloaded from database and server by a download tool.
The technical solution adopted for the present invention to solve the technical problems is: propose a kind of data download method, comprise the steps:
S1, PC download client receives user to the selection instruction of data downloading mode;
S2, the data downloading mode selected according to user generate corresponding download configuration interface to receive the download configuration parameter of user's input;
S3, the downloading mode execution data download selected according to the download configuration parameter employing of user's input.
In an embodiment, described data downloading mode comprises FTP downloading mode and ODBC downloading mode.
In an embodiment, described download configuration parameter comprises: data origin information, data attribute information, data storing path information, download schedule information.
In an embodiment, when selected FTP downloading mode, described step S3 comprises further:
S31, according to user input download configuration parameter send connection request to ftp server, wherein, described connection request at least carries data origin information;
The connection response information of S32, reception ftp server, to judge that whether connection is successful, if unsuccessful, then resends connection request to ftp server according to the relevant setting in the download configuration parameter of user's input;
S33, when with ftp server successful connection, from ftp server download needed for data;
S34, the data file downloaded according to the data storing path storage of user's input, and downloading the information recording the data file of download in history file;
S35, to disconnect and the connection of ftp server.
In an embodiment, the data needed for downloading from ftp server in described step S33 comprise further:
The data file of the history file record of the catalogue of ftp server and PC download client is compared, search in the catalogue of ftp server and store and the unwritten data file of history file of PC download client, and download the data file found.
In an embodiment, when selected ODBC downloading mode, described step S3 comprises further:
S31 ', the download configuration parameter transmission connection request extremely corresponding database inputted according to user, wherein, described connection request at least carries data origin information;
The connection response information of S32 ', reception database, to judge that whether connection is successful, if unsuccessful, then resends connection request to database according to the relevant setting in the download configuration parameter of user's input;
S33 ', with DataBase combining success time, from database download needed for data;
S34 ', the data file downloaded according to the data storing path storage of user's input;
S35 ', to disconnect and the connection of database.
The present invention also proposes a kind of PC download client for solving its technical problem, comprising:
Command reception module, for receiving the selection instruction of user to data downloading mode;
Configuration interface generation module, the data downloading mode for selecting according to user generates corresponding download configuration interface to receive the download configuration parameter of user's input;
Download module, the download configuration parameter for inputting according to user adopts selected downloading mode to perform data and downloads.
In an embodiment, described data downloading mode comprises FTP downloading mode and ODBC downloading mode.
In an embodiment, described download configuration parameter comprises: data origin information, data attribute information, data storing path information, download schedule information.
In an embodiment, described download module comprises FTP download module and ODBC download module further, described FTP download module selectes FTP downloading mode from the data needed for ftp server download based on user, and described ODBC download module selectes ODBC downloading mode from the data needed for corresponding database download based on user.
The data download method realized by PC download client that the present invention proposes, different data downloading modes can be adopted according to the selection of user, and different download scenarios can be performed according to the download configuration parameter of user's input, the data required for thus can being downloaded from database and server very easily by a download tool.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
The present invention proposes a kind of data download method realized by PC download client, described data download method comprises reception user to the selection instruction of data downloading mode, corresponding download configuration interface is generated to receive the download configuration parameter of user's input according to the data downloading mode that user selectes, then adopt selected downloading mode to perform data according to the download configuration parameter of user's input to download, thus can easily according to the needs of user from database and server downloading data.
Fig. 1 shows the flow chart of the data download method 100 of one embodiment of the invention.As shown in Figure 1, this data download method 100 comprises:
In step 110, PC download client receives user to the selection instruction of data downloading mode.This data downloading mode can comprise FTP downloading mode and ODBC(OpenDatabaseConnectivity, Open Database Connection) downloading mode.
Then, in step 120, corresponding download configuration interface is generated to receive the download configuration parameter of user's input according to the data downloading mode that user selectes.Specifically, PC download client receive user to the selection instruction of data downloading mode after, generate to should the download configuration interface display of data downloading mode to user, receive the download configuration parameter of user in the input of the download configuration interface of display.This download configuration parameter can comprise data origin information, data attribute information, data storing path information, download schedule information etc.
Such as, if adopt FTP downloading mode, then PC download client generates corresponding FTP download configuration interface, shown in Figure 5.User can by this FTP download configuration interface input data origin information, comprise server address, the user name of server end and password, (this plays the effect of filtering and downloading for character that port numbers, filename comprise, as user only need download txt file, then fill in " .txt " at this, just can realize the demand only downloading txt file).Further, for the ease of follow-up, classification analysis is carried out to data, FTP download configuration interface can also comprise the data acquisition of download network technology (as GSM, TD-SCDMA, WSCDMA etc.), download data from which network vendors (as Huawei, in emerging, Nokia etc.), the option of the data attribute such as data type.FTP download configuration interface can also comprise the option etc. of the option of local storing path, the filename of downloading data.In addition, FTP download configuration interface also comprises the download schedule such as task names, download period information option.
If adopt ODBC downloading mode, then PC download client generates corresponding ODBC download configuration interface, shown in Figure 6.User can by this FTP download configuration interface input data origin information, comprise DSN, data source types, database-name, the user name of database side and password, tables of data configuration (click this, user specifically can select which field downloaded which file, specifically can select to download certain file).Further, for the ease of follow-up, classification analysis is carried out to data, ODBC download configuration interface can also comprise the data acquisition of download network technology (as GSM, TD-SCDMA, WSCDMA etc.), download data from which network vendors (as Huawei, in emerging, Nokia etc.), the data attribute information such as data type, task names; The file name information etc. of local storing path information, downloading data can also be comprised.In addition, the download schedule information such as the time started that user can also download in the selection of ODBC download configuration interface, end time, the interval time (the task scheduling interval at corresponding download configuration interface) of at every turn downloading, 7*24 hour uninterrupted download are (due to the data that database meeting regular update stores, therefore select this to be conducive to saving labour turnover, improve file download efficiency).
Then, in step 130, PC download client adopts selected downloading mode to perform data according to the download configuration parameter that user inputs and downloads.
Fig. 2 shows in step 130 idiographic flow adopting FTP downloading mode to perform data download.As shown in Figure 2, according to FTP downloading mode, step 130 comprises further:
In step 131, PC download client sends connection request to ftp server according to the download configuration parameter that user inputs, and wherein, described connection request at least carries data origin information.
In later step 132, PC download client receives the connection response information of ftp server.
In later step 133, judge whether and ftp server successful connection according to this connection response information.If successful connection, then perform step S134, otherwise, return step 131, resend connection request to ftp server according to the download configuration of user.Such as, user can pre-set the time of delay, decay time etc. that resend connection request, and when arriving time of delay, resends connection request to ftp server; When the number of times of the connection request sent has reached decay time, stop sending connection request.
In step 134, when PC download client and ftp server successful connection, the data needed for downloading from ftp server.Wherein, specifically comprise from the step of ftp server downloading data: the data file of the history file record of the catalogue of ftp server and PC download client is compared, search in the catalogue of ftp server and store and the unwritten data file of history file of PC download client, and download the data file found, data file is here the file for storing data.In this step, when the history file of PC download client records multiple data file, the catalogue of circulation searching ftp server is needed whether to there is the data file of needs download.
In later step 135, store according to the data storing path that user inputs at download configuration interface the data file downloaded, and downloading the information recording the data file of download in history file.
In later step 136, disconnect the connection with ftp server.
The option such as time, download period downloaded data at FTP download configuration interface for user has done situation about arranging, PC download client can wait for that next time slice circulates after completing a secondary data download, and repeats above-mentioned steps 131-136 when next time slice arrives.
Fig. 3 shows in step 130 idiographic flow adopting ODBC downloading mode to perform data download.As shown in Figure 3, according to ODBC downloading mode, step 130 comprises further:
Step 131 ' in, PC download client sends connection request to corresponding database according to the download configuration parameter that user inputs, and wherein, described connection request at least carries data origin information.
In later step 132 ', PC download client receives the connection response information of database.
In later step 133 ', judge whether and DataBase combining success according to this connection response information.If successful connection, then perform step S134 ', otherwise, return step 131 ', resend connection request to database according to the download configuration of user.Such as, user can pre-set the time of delay, decay time etc. that resend connection request, and when arriving time of delay, resends connection request to database; When the number of times of the connection request sent has reached decay time, stop sending connection request.
Step 134 ' in, when PC download client and DataBase combining success, the data needed for downloading from database.Wherein, specifically comprise from the step of database downloading data:
The data (such as specifying by " tables of data configuration " option of Fig. 6 the data downloaded) that A1, download PC download client are specified.
A2, judge whether downloading process occurs abnormal (as network disconnects).In this step, if downloading process exception does not occur, then perform step 135 '.
A3, when downloading process occurs abnormal, continue to judge this exception be whether DataBase combining abnormal (as database be in maintenance state time, the likely connection of initiatively disconnection and PC download client).When the exception that downloading process occurs is not DataBase combining exception, the fileinfo of record failed download.If DataBase combining is abnormal, then resend connection request to database according to the download configuration of user.
In later step 135 ', store according to the data storing path that user inputs at download configuration interface the data file downloaded.
In later step 136 ', disconnect the connection with database.
The option such as time, download period downloaded data at ODBC download configuration interface for user has done situation about arranging, PC download client can wait for that next time slice circulates after completing a secondary data download, and repeats above-mentioned steps 131 '-136 when next time slice arrives '.
The present invention is by above data download method, different data downloading modes can be adopted according to the selection of user, and different download scenarios can be performed according to the download configuration parameter of user's input, the data required for thus can being downloaded from database and server easily by a download tool.
Fig. 4 shows the logic diagram of the PC download client 200 of one embodiment of the invention.As shown in Figure 4, this PC download client 200 comprises command reception module 210, configuration interface generation module 220 and download module 230.Command reception module 210 is for receiving the selection instruction of user to data downloading mode, and this data downloading mode can comprise FTP downloading mode and ODBC downloading mode.Configuration interface generation module 220 generates corresponding download configuration interface display to user for the data downloading mode selected according to user, to receive the download configuration parameter that user inputs at this download configuration interface.This download configuration parameter can comprise data origin information, data attribute information, data storing path information, download schedule information etc.Such as, if user selectes FTP downloading mode, configuration interface generation module 220 generates corresponding FTP download configuration interface, as shown in Figure 5; If user selectes ODBC downloading mode, configuration interface generation module 220 generates corresponding ODBC download configuration interface, as shown in Figure 6.Download module 230 adopts selected downloading mode to perform data for the download configuration parameter inputted according to user and downloads.
Download module 230 comprises FTP download module 231 and ODBC download module 232 further, FTP download module 231 selectes FTP downloading mode from the data needed for ftp server download based on user, and ODBC download module 232 selectes ODBC downloading mode from the data needed for corresponding database download based on user.About the specific implementation of FTP download module 231 and ODBC download module 232 downloading data, the detailed description that can provide see composition graphs 2 and Fig. 3 above.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.