CN102404375A - Comparison method for downloading of FTP (File Transfer Protocol) data packet - Google Patents

Comparison method for downloading of FTP (File Transfer Protocol) data packet Download PDF

Info

Publication number
CN102404375A
CN102404375A CN2010102869507A CN201010286950A CN102404375A CN 102404375 A CN102404375 A CN 102404375A CN 2010102869507 A CN2010102869507 A CN 2010102869507A CN 201010286950 A CN201010286950 A CN 201010286950A CN 102404375 A CN102404375 A CN 102404375A
Authority
CN
China
Prior art keywords
file
ftp
downloaded
comparison method
data packet
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.)
Pending
Application number
CN2010102869507A
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.)
Shanghai Phone Test Public Service Platforms Co Ltd
Original Assignee
Shanghai Phone Test Public Service Platforms 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 Shanghai Phone Test Public Service Platforms Co Ltd filed Critical Shanghai Phone Test Public Service Platforms Co Ltd
Priority to CN2010102869507A priority Critical patent/CN102404375A/en
Publication of CN102404375A publication Critical patent/CN102404375A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a comparison method for downloading of FTP data packet, which comprises the following steps of: step S1, building the connection of a wireless communication module and a PC (Personal Computer), and affirming that AT command communication is normal; step S2, configuring GET function test parameters of the FTP, and configuring the file to be downloaded as file 1; step S3, executing the FTP downloading function, and storing the content acquired by a serial port as file 2 by the catch function of a WINDOWS super terminal; step S4 and traversing the file 2, transforming the characters in the file 2 to form a file 3 so that the characters in the file 3 and the file 1 are characters on the same platform; step S5, traversing the file 1 and the file 3, and outputting the test results, wherein the test results include that the files are the same and the files are different. The compassion method can be used for comparing the FTP data packet with the original file data packet after the FTP data packet is downloaded and provides a result, so that the result can be used as reference basis of the FTP function test of the wireless communication module, assists to test the accuracy of the FTP downloading function, and increases the efficiency of the function test.

Description

The comparison method that the FTP packet is downloaded
Technical field
The present invention relates to the comparison method that a kind of FTP packet is downloaded, particularly relate to a kind of comparison method of downloading to the FTP packet of wireless communication module.
Background technology
FTP is that the English of File Transfer Protocol (FTP) is called for short, and Chinese abbreviates " literary composition passes agreement " as, is used for the transmitted in both directions of the control documents on the Internet.Simultaneously, it also is an application program (Application).The user can link to each other a large amount of programs and information on the access server to oneself PC with all servers that move File Transfer Protocol all over the world through it.The main effect of FTP; Letting the user connect a remote computer (moving the ftp server program on these computers) exactly watches remote computer which file is arranged; Copy local computer to file from remote computer then, or deliver to remote computer to the file of local computer.Because FTP develops widely, increasing wireless communication module begins to support the FTP function.But wireless communication module is as the M2M product, and the form that can not preserve into a file to the data that FTP obtains can only be exported from serial ports as data.And that the downloaded files type has is varied; There is text that binary file is also arranged; Some need could be read by instruments such as UE; Some ftp server can add ESC with data downloaded, and the correctness of downloading through manual work comparison checking like this can prolong the testing time, and the efficient of manual function's test is quite low.
Summary of the invention
The technical problem that the present invention will solve is in order to overcome the defective that artificial comparison can prolong the testing time in the prior art, testing efficiency is low, the comparison method that provides a kind of automatic FTP packet to download.
The present invention solves above-mentioned technical problem through following technical proposals:
The comparison method that a kind of FTP packet is downloaded, its characteristics are that it may further comprise the steps:
S 1, set up being connected of wireless communication module and PC, confirm that AT order communication is normal;
S 2, configuration FTP GET functional test parameter, and needing downloaded files to be configured to file 1;
S 3, carry out the FTP download function, the content that serial ports is obtained is stored as file 2 through the capturing function of WINDOWS hyper terminal;
S 4, traversal file 2, the character in the file 2 is changed, form file 3, so that file 3 is the character on the identical platform with character in the file 1;
S 5, traversal file 1 and file 3, output test result, it is identical and different to be divided into file.
Preferably, step S 4In, open file 2 with binary mode, begin from first byte of file 2, in case find the existence of 0x0D 0x0D 0x0A, just convert the form of 0x0D 0x0A to, form file 3 at last.
Preferably, step S 5Also comprise the steps: before with binary form open file 1 with file 3, obtain the size of file 1 and file 3, at first if the comparison document size inequality, representes that then file size is different, shows that the data in two files are also just different.
Preferably,, then, relatively arrive the end of file always,, then write down and point out discrepancy if find byte inequality since first byte comparison of two files if file size is identical.
Positive progressive effect of the present invention is: this comparison method can be used for FTP packet download back and the original packet compares; And provide the result; Thereby reference frame as the FTP functional test of wireless communication module; The correctness of subtest FTP download function has promoted the efficient of functional test.
Description of drawings
Fig. 1 is the flow chart of preferred embodiment of the present invention.
Embodiment
Provide preferred embodiment of the present invention below in conjunction with accompanying drawing, to specify technical scheme of the present invention.
Present embodiment is explained the method for automatic comparison FTP data download bag correctness on the WINDOWS platform, to be embodied as example.Certainly, comparison method of the present invention is not limited to the realization on the WINDOWS platform, and those skilled in the art should know, and the present invention is equally applicable to other operating system platforms, such as the realization on the platforms such as Linux.Following mask body is introduced idiographic flow of the present invention, and is as shown in Figure 1.
Step 101 is connected through Serial Port Line wireless communication module with PC, set up the communication port between PC and the module, confirms that AT order communication is normal.
Step 102, the GET functional test parameter of configuration FTP is such as the path of server, user name, password or the like.Be configured to 1.dat to the needs downloaded files then, 1.dat only is that the file of also configurable other extension name of one-tenth is such as forms such as txt, gif, bin or jpg for example here.
Step 103 is carried out the FTP download function, and the content that serial ports is obtained is stored as 2.dat through the capturing function of WINDOWS hyper terminal;
Step 104; Consider because the residing platform of ftp server is different; Such as LINUX and local platform; Such as the difference of WINDOWS platform, usually the 0x0A character on LINUX can be become 0x0D 0x0A by the WINDOWS escape, needs therefore to remove that ftp server obtains data and the otherness that causes.Method is to open file with binary mode, and obtains file size, begins from first byte of file, in case find the existence of 0x0D 0x0D 0x0A, just converts the form of 0x0D 0x0A to, forms 3.dat at last.
Step 105 is opened 1.dat and 3.dat with binary form, and obtains file size.
Step 106, at first if the comparison document size inequality, representes that then file size is different, data are also just different certainly like this.
Step 107 if file size is identical, then begins comparison from first byte, relatively arrives the end of file always.If find byte inequality, then write down and point out discrepancy, write down byte location inequality.
Step 108, last, no matter be the identical or difference of file, all output test result, it is identical and different to be divided into file.
Wherein, step 104-108, those skilled in the art can adopt known programming technique, develop an executable program, when test, utilize this executable program just can realize automatically than right.The benefit of doing like this is: 1, will could read by the UE instrument originally, and need tester's time spent energy long, that expend big, and occur mistake unavoidably.The situation of 2, for some server data downloaded having been added ESC, the present invention can eliminate the otherness of platform automatically, and compares, with correctness and the lifting testing efficiency that guarantees comparison.
Though more than described embodiment of the present invention, it will be understood by those of skill in the art that these only illustrate, protection scope of the present invention is limited appended claims.Those skilled in the art can make numerous variations or modification to these execution modes under the prerequisite that does not deviate from principle of the present invention and essence, but these changes and modification all fall into protection scope of the present invention.

Claims (4)

1. the comparison method downloaded of a FTP packet is characterized in that it may further comprise the steps:
S 1, set up being connected of wireless communication module and PC, confirm that AT order communication is normal;
S 2, configuration FTP GET functional test parameter, and needing downloaded files to be configured to file 1;
S 3, carry out the FTP download function, the content that serial ports is obtained is stored as file 2 through the capturing function of WINDOWS hyper terminal;
S 4, traversal file 2, the character in the file 2 is changed, form file 3, so that file 3 is the character on the identical platform with character in the file 1;
S 5, traversal file 1 and file 3, output test result, it is identical and different to be divided into file.
2. the comparison method that FTP packet as claimed in claim 1 is downloaded is characterized in that step S 4In, open file 2 with binary mode, begin from first byte of file 2, in case find the existence of 0x0D 0x0D 0x0A, just convert the form of 0x0D 0x0A to, form file 3 at last.
3. the comparison method that FTP packet as claimed in claim 2 is downloaded is characterized in that step S 5Also comprise the steps: before with binary form open file 1 with file 3, obtain the size of file 1 and file 3, at first if the comparison document size inequality, representes that then file size is different, shows that the data in two files are also just different.
4. the comparison method that FTP packet as claimed in claim 3 is downloaded is characterized in that, if file size is identical; Then since first byte comparisons of two files; Relatively arrive the end of file always,, then write down and point out discrepancy if find byte inequality.
CN2010102869507A 2010-09-17 2010-09-17 Comparison method for downloading of FTP (File Transfer Protocol) data packet Pending CN102404375A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010102869507A CN102404375A (en) 2010-09-17 2010-09-17 Comparison method for downloading of FTP (File Transfer Protocol) data packet

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010102869507A CN102404375A (en) 2010-09-17 2010-09-17 Comparison method for downloading of FTP (File Transfer Protocol) data packet

Publications (1)

Publication Number Publication Date
CN102404375A true CN102404375A (en) 2012-04-04

Family

ID=45886160

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010102869507A Pending CN102404375A (en) 2010-09-17 2010-09-17 Comparison method for downloading of FTP (File Transfer Protocol) data packet

Country Status (1)

Country Link
CN (1) CN102404375A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107239470A (en) * 2016-03-28 2017-10-10 咪咕音乐有限公司 A kind of data file detection method and device
CN108828349A (en) * 2018-05-04 2018-11-16 天地融电子(天津)有限公司 A kind of test macro
CN108828350A (en) * 2018-05-04 2018-11-16 天地融电子(天津)有限公司 A kind of test method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107239470A (en) * 2016-03-28 2017-10-10 咪咕音乐有限公司 A kind of data file detection method and device
CN108828349A (en) * 2018-05-04 2018-11-16 天地融电子(天津)有限公司 A kind of test macro
CN108828350A (en) * 2018-05-04 2018-11-16 天地融电子(天津)有限公司 A kind of test method

Similar Documents

Publication Publication Date Title
US11122151B2 (en) Multi-protocol gateway for connecting sensor devices to cloud
CN102708050B (en) Method and system for testing mobile application
AU2011205480B2 (en) Operating system auto-update procedure
CN104539458A (en) Operating environment self-adapting method and device
EP2863593B1 (en) A method, apparatus and computer program for modifying messages in a communications network
CN104468843A (en) File uploading method and device
CN105302732A (en) Automatic mobile terminal testing method and device
AU2010358328B2 (en) Processing devices and methods for transmitting and receiving data
WO2019168191A1 (en) Creation device, creation system, creation method, and creation program
CN103744699A (en) Method and device for software upgrading of intelligent electric equipment
CN102404375A (en) Comparison method for downloading of FTP (File Transfer Protocol) data packet
CN105446975A (en) File packing method and device
JP6864610B2 (en) Specific system, specific method and specific program
CN104378336A (en) Data processing method and system and server
CN105808282A (en) Method and device for updating webpage contents of application program
KR20060094851A (en) System and method for testing a data format using targeted variant input
CN105471980B (en) A kind of Cloud Server data access method based on embedded OpenWrt wireless router technology
CN105323236B (en) For checking system, the method and apparatus of online communication session via polymorphic TSM Security Agent
JP2007141072A (en) Trace information output device
CN107547591A (en) Upgrade server, set top box, set top box upgrading file delivery method and system
JP6951380B2 (en) Gateway device, communication method and program
KR101769315B1 (en) Method and apparatus for automatic converting file name based on the cloud server
EP2916514A2 (en) A method for processing URL and an associated server and a non-transitory computer readable storage medium
CN115604070A (en) Message transmission method, device, equipment and medium based on MCTP (Multi-function peripheral protocol)
CN112491828B (en) Message analysis method, device, server and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20120404