CN111970355A - Method for automatically downloading numbered files - Google Patents

Method for automatically downloading numbered files Download PDF

Info

Publication number
CN111970355A
CN111970355A CN202010816060.6A CN202010816060A CN111970355A CN 111970355 A CN111970355 A CN 111970355A CN 202010816060 A CN202010816060 A CN 202010816060A CN 111970355 A CN111970355 A CN 111970355A
Authority
CN
China
Prior art keywords
download
file
ftp
downloaded
directory
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.)
Withdrawn
Application number
CN202010816060.6A
Other languages
Chinese (zh)
Inventor
许威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010816060.6A priority Critical patent/CN111970355A/en
Publication of CN111970355A publication Critical patent/CN111970355A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Abstract

The invention discloses a method for automatically downloading a number file, which comprises the following steps: establishing a command directory for storing the number files on the Windows FTP; inquiring a numbering file list updated on irregular days in a Mysql database, inquiring an existing numbering file list of an FTP command directory, and comparing the two lists; judging whether a download.txt exists in a directory pythonfile where a Python script running on the FTP is located, if so, deleting the download.txt, and connecting a Linux test server after deleting or not, otherwise, connecting the Linux test server; acquiring a list of serial number files to be downloaded, wherein the list is downloaded; judging whether a zhiching directory on the FTP has a download. If the download is successful, automatically opening the browser, automatically entering a serial number file download link, and storing the download is successful; if not, downloading can not be carried out; and automatically closing the browser after all the serial number files to be downloaded are downloaded, and deleting download. The invention automatically inquires the downloading requirement of the numbered file once in half an hour, can automatically download and store the numbered file, improves the time efficiency compared with the manual operation of an engineer, and avoids the missing of downloading.

Description

Method for automatically downloading numbered files
Technical Field
The invention relates to the technical field of Windows FTP servers, in particular to a method for automatically downloading numbered files.
Background
Linux is a Unix-like operating system which is free to use and spread freely, and is a multi-user, multi-task, multi-thread and multi-CPU supporting operating system based on POSIX and UNIX. It can run major UNIX tools, applications and network protocols. It supports 32-bit and 64-bit hardware. Linux inherits the design idea of Unix with network as core, and is a multi-user network operating system with stable performance. The method is mainly used for computers based on Intel x86 series CPUs. This system is designed and implemented by thousands of programmers around the world. The aim is to create a Unix compatible product that is free to use worldwide without being restricted by the copyright of any commercial software.
Linux is known for its efficiency and flexibility, and its modular design structure makes it possible to run on expensive workstations and realize all Unix features on cheap PCs, and has multitasking and multiuser capabilities. Linux is freely available under the GNU public license authority, and is an operating system conforming to the POSIX standard. The Linux operating system software package not only comprises a complete Linux operating system, but also comprises application software such as a text editor, a high-level language compiler and the like. It also includes an X-Windows graphical user interface with multiple window managers, allowing us to operate the system using Windows, icons, and menus as we use Windows NT.
The system test is a test for the whole system, and the hardware, the software and the operator are taken as a whole to check whether the system test has a place which does not conform to the system specification. Such testing may discover errors in system analysis and design. If the safety test is to test whether the safety measures are perfect, the system can not be ensured not to be illegally invaded. For another example, the stress test is to test whether the system can still work normally under the conditions of normal data volume and overload volume (such as simultaneous access by multiple users); the system test is a series of strict and effective tests to the computer system under the actual operating environment by taking the software subjected to the integrated test as a part of the computer system and combining with other parts in the system, so as to find out potential problems of the software and ensure the normal operation of the system.
Under the Linux test system, a plurality of data numbers are generated every day, files corresponding to the numbers are arranged on a specific website, office staff need to manually download mass files from the specific website to the local Windows FTP according to the data numbers under Linux every day, and the operation is complex and the efficiency is low.
Disclosure of Invention
The present invention is directed to a method for automatically downloading a number file, so as to solve the problems set forth in the background art.
In order to achieve the purpose, the invention provides the following technical scheme: a method for automatically downloading a number file comprises the following steps:
establishing a command directory for storing the number files on the Windows FTP;
inquiring a numbering file list updated on irregular days in a Mysql database, inquiring an existing numbering file list of an FTP command directory, and comparing the two lists;
judging whether a download.txt exists in a directory pythonfile where a Python script running on the FTP is located, if so, deleting the download.txt, and connecting a Linux test server after deleting or not, otherwise, connecting the Linux test server;
acquiring a list of serial number files to be downloaded, wherein the list is downloaded;
judging whether a zhiching directory on the FTP has a download. If the download is successful, automatically opening the browser, automatically entering a serial number file download link, and storing the download is successful; if not, downloading can not be carried out;
and automatically closing the browser after all the serial number files to be downloaded are downloaded, and deleting download.
Preferably, the method for automatically downloading the numbered files provided by the application, wherein a list of numbered files to be downloaded is generated when the files need to be downloaded, and the list is put into a zhiching directory on the FTP; and when the file does not need to be downloaded, the download.
Preferably, the method for automatically downloading the numbered files provided by the application enters a time module to wait for half an hour and obtain a download. list cycle when the download. txt does not exist, and can cycle for 7 days at most if no file downloading requirement exists.
Preferably, the method for automatically downloading the numbered file provided by the present application, wherein when the download.txt exists, the os module is used to move the download.list to the pythofile directory, and the download.list is renamed to the download.txt.
Preferably, the method for automatically downloading the numbered files provided by the application includes logging in to a downloading website by simulating account passwords with a pywin32 module, reading the numbers of the files to be downloaded line by line according to download.
An apparatus for automatically downloading serial number files comprises
The directory module is used for establishing a command directory for storing the number files on the Windows FTP;
the comparison module is used for inquiring a numbering file list updated on an irregular basis in the Mysql database, inquiring an existing numbering file list of the FTP command directory and comparing the two lists;
the first judgment module is used for judging whether the directory pythonfile where the Python script running on the FTP is located has download.
The acquiring module is used for acquiring a serial number file list download.
The second judgment module is used for judging whether a zhiching directory on the FTP has a download. If the download is successful, automatically opening the browser, automatically entering a serial number file download link, and storing the download is successful; if not, downloading can not be carried out;
and the deleting module is used for automatically closing the browser and deleting the download after all the serial number files to be downloaded are downloaded.
Compared with the prior art, the invention has the beneficial effects that: the invention establishes a public directory for storing the number files on the Windows FTP; establishing a script on a Linux test server, inquiring the data number updated irregularly during the day, inquiring the downloaded data number on the FTP, comparing the two inquiry results to generate a list of the data numbers to be downloaded, and then returning the list to the FTP; in the FTP server, a Python environment is established, a Python script is written, and the main functions are as follows: triggering a script on a Linux test server every half hour to obtain a serial number list of data to be downloaded, then automatically opening a browser to log in a specific website, automatically downloading files with corresponding serial numbers according to the list, naming the files by using the serial numbers and storing the files in an FTP public directory; the invention automatically inquires the downloading requirement of the numbered file once in half an hour, can automatically download and store the numbered file, improves the time efficiency compared with the manual operation of an engineer, and avoids the missing of downloading.
Drawings
FIG. 1 is a flow chart of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a first embodiment:
the invention provides the following technical scheme: a method for automatically downloading a number file comprises the following steps:
establishing a command directory for storing the number files on the Windows FTP;
inquiring a numbering file list updated on irregular days in a Mysql database, inquiring an existing numbering file list of an FTP command directory, and comparing the two lists;
on the FTP server, a Python environment is established, and Python scripts are written.
The invention establishes a public directory for storing the number files on the Windows FTP; establishing a script on a Linux test server, inquiring the data number updated irregularly during the day, inquiring the downloaded data number on the FTP, comparing the two inquiry results to generate a list of the data numbers to be downloaded, and then returning the list to the FTP; in the FTP server, a Python environment is established, a Python script is written, and the main functions are as follows: and triggering a script on the Linux test server every half hour to obtain a serial number list of the data to be downloaded, then automatically opening a browser to log in a specific website, automatically downloading files with corresponding serial numbers according to the list, naming the files by using the serial numbers and storing the files in an FTP public directory.
Example two:
a method for automatically downloading a number file comprises the following steps:
establishing a command directory for storing the number files on the Windows FTP;
inquiring a numbering file list updated on irregular days in a Mysql database, inquiring an existing numbering file list of an FTP command directory, and comparing the two lists;
on the FTP server, a Python environment is established, and Python scripts are written.
In the embodiment, a numbering file list updated on an irregular day in a Mysql database is inquired, an existing numbering file list of an FTP command directory is inquired, the two lists are compared, a numbering file list to be downloaded is generated and downloaded when a file needs to be downloaded, and the list is put into a phishing directory on the FTP; and when the file does not need to be downloaded, the download.
The invention establishes a public directory for storing the number files on the Windows FTP; establishing a script on a Linux test server, inquiring the data number updated irregularly during the day, inquiring the downloaded data number on the FTP, comparing the two inquiry results to generate a list of the data numbers to be downloaded, and then returning the list to the FTP; the invention establishes Python environment and writes Python script in FTP server, automatically inquires the number file downloading requirement once in half an hour, can automatically download and store the number file, improves the time efficiency compared with the manual operation of engineers, and avoids the omission of downloading.
Example three:
a method for automatically downloading a number file comprises the following steps:
establishing a command directory for storing the number files on the Windows FTP;
inquiring a numbering file list updated on irregular days in a Mysql database, inquiring an existing numbering file list of an FTP command directory, and comparing the two lists;
on the FTP server, a Python environment is established, and Python scripts are written.
In the invention, a numbering file list which is updated irregularly during the day is inquired in a Mysql database, the existing numbering file list of an FTP command directory is inquired, the two lists are compared, when a file needs to be downloaded, a numbering file list to be downloaded is generated, and the list is put into a phishing directory on the FTP; and when the file does not need to be downloaded, the download.
The invention also comprises the following steps
The method comprises the steps that a script starts to judge whether download.txt exists under a directory pythonfile where a Python script is located, if yes, the download.txt needs to be deleted, and if not, the download.txt enters a main program loop;
the main cycle program is remotely connected with the Linux server by a paramiko module, and the script written in the step b is executed to obtain a serial number file list to be downloaded, download.
Judging whether a zhiching directory on the FTP has a download. list by using an os module, if not, entering a time module to wait for half an hour and obtain a download. list cycle, and if no file downloading requirement exists, circulating for 7 days at most; when the log exists, the os module moves the download.list to a pythofile directory, and the download.list is renamed to download.txt;
automatically opening a Google browser by using a selenium module after the download.txt is in a pythonfile directory, automatically entering a numbered file download link, simulating an account password to log in a download website by using a pywin32 module, reading the number of a file to be downloaded line by line according to the download.txt, automatically searching and downloading the file in the website, and then moving the downloaded numbered file to an FTP command directory by using an os module;
and automatically closing the Google browser after all the serial number files to be downloaded are downloaded, deleting download.
In the invention, the script judges whether a download.txt exists under a directory pythonfile where the Python script is located at the beginning, if yes, the deletion is needed, and if not, the entering of a main program cycle is carried out; the main cycle program is remotely connected with the Linux server by a paramiko module, and the script written in the step b is executed to obtain a serial number file list to be downloaded, download. Judging whether a zhiching directory on the FTP has a download. list by using an os module, if not, entering a time module to wait for half an hour and obtain a download. list cycle, and if no file downloading requirement exists, circulating for 7 days at most; when the log exists, the os module moves the download.list to a pythofile directory, and the download.list is renamed to download.txt; automatically opening a Google browser by using a selenium module after the download.txt is in a pythonfile directory, automatically entering a numbered file download link, simulating an account password to log in a download website by using a pywin32 module, reading the number of a file to be downloaded line by line according to the download.txt, automatically searching and downloading the file in the website, and then moving the downloaded numbered file to an FTP command directory by using an os module; automatically closing the Google browser after all the serial number files to be downloaded are downloaded, deleting download. This step can improve the download efficiency.
In addition, the invention also discloses a device for automatically downloading the number file, which comprises
The directory module is used for establishing a command directory for storing the number files on the Windows FTP;
the comparison module is used for inquiring a numbering file list updated on an irregular basis in the Mysql database, inquiring an existing numbering file list of the FTP command directory and comparing the two lists;
the first judgment module is used for judging whether the directory pythonfile where the Python script running on the FTP is located has download.
The acquiring module is used for acquiring a serial number file list download.
The second judgment module is used for judging whether a zhiching directory on the FTP has a download. If the download is successful, automatically opening the browser, automatically entering a serial number file download link, and storing the download is successful; if not, downloading can not be carried out;
and the deleting module is used for automatically closing the browser and deleting the download after all the serial number files to be downloaded are downloaded.
In summary, the invention establishes a public directory for storing the number files on the Windows FTP; establishing a script on a Linux test server, inquiring the data number updated irregularly during the day, inquiring the downloaded data number on the FTP, comparing the two inquiry results to generate a list of the data numbers to be downloaded, and then returning the list to the FTP; in the FTP server, a Python environment is established, a Python script is written, and the main functions are as follows: triggering a script on a Linux test server every half hour to obtain a serial number list of data to be downloaded, then automatically opening a browser to log in a specific website, automatically downloading files with corresponding serial numbers according to the list, naming the files by using the serial numbers and storing the files in an FTP public directory; the invention automatically inquires the downloading requirement of the numbered file once in half an hour, can automatically download and store the numbered file, improves the time efficiency compared with the manual operation of an engineer, and avoids the missing of downloading.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.

Claims (6)

1. A method for automatically downloading a number file is characterized by comprising the following steps:
establishing a command directory for storing the number files on the Windows FTP;
inquiring a numbering file list updated on irregular days in a Mysql database, inquiring an existing numbering file list of an FTP command directory, and comparing the two lists;
judging whether a download.txt exists in a directory pythonfile where a Python script running on the FTP is located, if so, deleting the download.txt, and connecting a Linux test server after deleting or not, otherwise, connecting the Linux test server;
acquiring a list of serial number files to be downloaded, wherein the list is downloaded;
judging whether a zhiching directory on the FTP has a download. If the download is successful, automatically opening the browser, automatically entering a serial number file download link, and storing the download is successful; if not, downloading can not be carried out;
and automatically closing the browser after all the serial number files to be downloaded are downloaded, and deleting download.
2. The method of claim 1, wherein the method comprises the following steps: generating a file list of numbers to be downloaded, download when a file needs to be downloaded, and putting the list into a zhicheng directory on the FTP; and when the file does not need to be downloaded, the download.
3. The method of claim 1, wherein the method comprises the following steps: and when the download is not available, entering a time module, waiting for half an hour and acquiring a download cycle, and if no file download requirement exists all the time, circulating for 7 days at most.
4. The method of claim 3, wherein the method comprises the following steps: move the download. list to the pythofile directory with the os module when it exists and rename the download. list to download. txt.
5. The method of claim 1, wherein the method comprises the following steps: and simulating an account password by using a pywin32 module to log in a downloading website, reading the number of the file to be downloaded line by line according to download.
6. An automatic download serial number file device, its characterized in that: comprises that
The directory module is used for establishing a command directory for storing the number files on the Windows FTP;
the comparison module is used for inquiring a numbering file list updated on an irregular basis in the Mysql database, inquiring an existing numbering file list of the FTP command directory and comparing the two lists;
the first judgment module is used for judging whether the directory pythonfile where the Python script running on the FTP is located has download.
The acquiring module is used for acquiring a serial number file list download.
The second judgment module is used for judging whether a zhiching directory on the FTP has a download. If the download is successful, automatically opening the browser, automatically entering a serial number file download link, and storing the download is successful; if not, downloading can not be carried out;
and the deleting module is used for automatically closing the browser and deleting the download after all the serial number files to be downloaded are downloaded.
CN202010816060.6A 2020-08-14 2020-08-14 Method for automatically downloading numbered files Withdrawn CN111970355A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010816060.6A CN111970355A (en) 2020-08-14 2020-08-14 Method for automatically downloading numbered files

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010816060.6A CN111970355A (en) 2020-08-14 2020-08-14 Method for automatically downloading numbered files

Publications (1)

Publication Number Publication Date
CN111970355A true CN111970355A (en) 2020-11-20

Family

ID=73365719

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010816060.6A Withdrawn CN111970355A (en) 2020-08-14 2020-08-14 Method for automatically downloading numbered files

Country Status (1)

Country Link
CN (1) CN111970355A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113268650A (en) * 2021-05-18 2021-08-17 湖南荣冠智能科技有限公司 Automatic data downloading method and device and application equipment
CN113766006A (en) * 2021-07-29 2021-12-07 北京思特奇信息技术股份有限公司 Real-time file transmission method and system based on FTP (file transfer protocol)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113268650A (en) * 2021-05-18 2021-08-17 湖南荣冠智能科技有限公司 Automatic data downloading method and device and application equipment
CN113766006A (en) * 2021-07-29 2021-12-07 北京思特奇信息技术股份有限公司 Real-time file transmission method and system based on FTP (file transfer protocol)
CN113766006B (en) * 2021-07-29 2024-02-23 北京思特奇信息技术股份有限公司 Real-time file transmission method and system based on FTP protocol

Similar Documents

Publication Publication Date Title
US8132056B2 (en) Dynamic functional testing coverage based on failure dependency graph
Abbott Linux for embedded and real-time applications
US10528363B2 (en) Conservative class preloading for real time java execution
US6662359B1 (en) System and method for injecting hooks into Java classes to handle exception and finalization processing
US6202200B1 (en) Multi-tier debugging
US6779179B1 (en) Registry emulation
US8826240B1 (en) Application validation through object level hierarchy analysis
US8156478B2 (en) Optimized program analysis
US20050289538A1 (en) Deploying an application software on a virtual deployment target
US20050246704A1 (en) Registry emulation
US20050188262A1 (en) Simultaneous execution of test suites on different platforms
US5940593A (en) Simulating a multi-tiered computer environment on a single development system for debugging
KR20080050118A (en) Method of error detecting method for embedded sofeware
US20080098387A1 (en) Automation tool for application installations
CN109388569B (en) Method for remotely detecting environmental anomaly of client, test server and storage medium
CN111970355A (en) Method for automatically downloading numbered files
US6513153B1 (en) Automatically integrating and executing application software modules
US6424974B1 (en) Storing P-code in a database
US8904346B1 (en) Method and system for automated load testing of web applications
CN108121650B (en) Method and device for testing page user interface
Liu Platform-independent and tool-neutral test descriptions for automated software testing
Tang et al. Xdebloat: Towards automated feature-oriented app debloating
US8230413B2 (en) Detecting incorrect versions of files
US20050033953A1 (en) Systems and methods for a bootstrap mechanism for software execution
Ali et al. Automated parallel GUI testing as a service for mobile applications

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20201120