Method and apparatus for testing stability of file transfer based on traffic restoration file
By converting sample traffic files into target traffic files for different file transfer protocols and performing environmental simulation, the instability problem of file transfer stability testing in network architecture is solved, enabling more accurate testing and more efficient maintenance.
Patent Information
- Application Number
- CN202211320417.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-26
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2042-10-26
AI Technical Summary
In existing technologies, the stability test results of file transfer in network architectures are unstable, especially in some network architectures where there is a significant deviation from the actual situation.
By acquiring sample traffic files, converting them into target traffic files for different file transfer protocols, and performing environmental simulation processing, the stability of the target file transfer link is tested. The stability is evaluated by comparing the results using MD5, SHA1, or SHA256 values.
It improved the diversity and accuracy of test cases, reduced false positives and false negatives, facilitated rapid maintenance and updates of the file transfer link, and improved stability.
Smart Images

Figure CN115801905B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of testing, in particular to a file transmission stability test method and device based on traffic restoration files. BACKGROUND
[0002] In the deployment and maintenance of network architecture, the stability of file transmission needs to be considered. Files are transmitted in the form of network traffic in the transmission link, and the receiving party needs to reorganize the network traffic into files for normal use. Therefore, it is necessary to ensure that the files reorganized by the receiving party are consistent with the files before being converted into network traffic by the sending party, so as to realize effective transmission.
[0003] To this end, relevant tests can be performed to test the stability of file transmission in the corresponding transmission link, so as to arrange whether it can be put into use, update and maintain related operations.
[0004] However, in the prior art, the inventors have found that the test effect of the stability of file transmission in the transmission link in the network architecture in the prior art is unstable, and for individual specific network architecture, the test effect deviates greatly from the actual situation. SUMMARY
[0005] The present application provides a file transmission stability test method and device based on traffic restoration files, which is used to improve the diversity of test cases by processing sample traffic files, so as to more accurately test the file transmission stability of the file transmission link.
[0006] In a first aspect, the present application provides a file transmission stability test method based on traffic restoration files, the method comprising:
[0007] Obtaining a sample traffic file, wherein the traffic file format refers to the file format obtained by converting files into traffic during file transmission;
[0008] Converting the sample traffic file from the corresponding initial file transmission protocol into a target traffic file of different file transmission protocols;
[0009] Testing the file transmission stability of the target file transmission link based on the target traffic file.
[0010] In combination with the first aspect of the present application, in a first possible implementation manner of the first aspect of the present application, the traffic file format of the sample traffic file is specifically a Packet Capture (PCAP) traffic file format.
[0011] In a second possible implementation manner of the first aspect of the present application, the different file transfer protocols specifically include any combination of FTP protocol, HTTP protocol, HTTP / 2 protocol, SMTP protocol, POP3 protocol, IMAP protocol, IPV4 protocol, and IPV6 protocol.
[0012] In a third possible implementation manner of the first aspect of the present application, the conversion of the sample traffic file from the corresponding initial file transfer protocol to the target traffic file of the different file transfer protocol includes:
[0013] Converting the sample traffic file from the corresponding initial file transfer protocol to a first traffic file of the different file transfer protocol.
[0014] Performing environment simulation processing on the first traffic file to obtain a second traffic file as the target traffic file, wherein the environment simulation processing refers to simulation processing of a network environment for file processing of the input traffic file.
[0015] In a fourth possible implementation manner of the third possible implementation manner of the first aspect of the present application, the file processing in the environment simulation processing includes at least one of delay, repetition, drop, fragmentation, overlap, segmentation, out-of-order, and packet loss.
[0016] In a fifth possible implementation manner of the first aspect of the present application, based on the target traffic file, the file transfer stability of the target file transfer link is tested, including:
[0017] Restoring the target traffic file into a first target file.
[0018] Transferring the target traffic file through the target file transfer link, and listening to a second target file obtained by restoration of the target file transfer link.
[0019] According to a comparison result of the first target file and the second target file, the file transfer stability of the target file transfer link is determined.
[0020] In a sixth possible implementation manner of the fifth possible implementation manner of the first aspect of the present application, the comparison result of the first target file and the second target file is specifically a comparison result of MD5 values calculated by the two, or is specifically a comparison result of SHA1 values calculated by the two, or is specifically a comparison result of SHA256 values calculated by the two.
[0021] In a second aspect, the present application provides a file transfer stability testing device based on traffic restoration file, the device includes:
[0022] The acquisition unit is used to acquire sample traffic files, wherein the traffic file format involved refers to the file format obtained by converting a file into traffic during file transfer;
[0023] The conversion unit is used to convert sample traffic files from the corresponding initial file transfer protocol into target traffic files with different file transfer protocols;
[0024] The test unit is used to test the file transfer stability of the target file transfer link based on the target traffic file.
[0025] In conjunction with the second aspect of this application, in the first possible implementation of the second aspect of this application, the sample traffic file format is specifically the PCAP traffic file format.
[0026] In conjunction with the second aspect of this application, in the second possible implementation of the second aspect of this application, the different file transfer protocols specifically include any combination of FTP protocol, HTTP protocol, HTTP / 2 protocol, SMTP protocol, POP3 protocol, IMAP protocol, IPv4 protocol and IPv6 protocol.
[0027] In conjunction with the second aspect of this application, in a third possible implementation of the second aspect of this application, the conversion unit is specifically used for:
[0028] Transform the sample traffic file from the corresponding initial file transfer protocol into the first traffic file of a different file transfer protocol;
[0029] The first traffic file is processed by environmental simulation to obtain the second traffic file, which is then used as the target traffic file. Environmental simulation processing refers to the simulation of the network environment for processing the input traffic file.
[0030] In conjunction with the third possible implementation of the second aspect of this application, in the fourth possible implementation of the second aspect of this application, the file processing in the environment simulation process includes at least one of delay, repetition, discarding, fragmentation, overlap, segmentation, out-of-order processing, and packet loss.
[0031] In conjunction with the second aspect of this application, in the fifth possible implementation of the second aspect of this application, the test unit is specifically used for:
[0032] Restore the target traffic file to the first target file;
[0033] The target traffic file is transferred through the target file transfer link, and the second target file is obtained by monitoring the target file transfer link.
[0034] Based on the comparison results between the first target file and the second target file, the file transfer stability of the target file transfer link is determined.
[0035] In a sixth possible implementation of the second aspect of the present application, in combination with the fifth possible implementation of the second aspect of the present application, the comparison result of the first target file and the second target file is specifically a comparison result of the MD5 values calculated by the first target file and the second target file, or specifically a comparison result of the SHA1 values calculated by the first target file and the second target file, or specifically a comparison result of the SHA256 values calculated by the first target file and the second target file.
[0036] In a third aspect, the present application provides a processing device, comprising a processor and a memory, and the memory stores a computer program, and the processor executes the computer program in the memory to execute the method provided in the first aspect of the present application or any possible implementation of the first aspect of the present application.
[0037] In a fourth aspect, the present application provides a computer readable storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the method provided in the first aspect of the present application or any possible implementation of the first aspect of the present application.
[0038] From the above, the present application has the following beneficial effects:
[0039] In view of the test requirement of the file transmission stability of the target file transmission link, after obtaining the sample traffic file, the present application converts it from the corresponding initial file transmission protocol into the target traffic file of different file transmission protocols, thereby improving the diversity of the test case. When testing the file transmission stability of the target file transmission link based on the target traffic file, the file transmission stability of the file transmission link can be more accurately tested. Under this test mechanism, not only the test accuracy can be improved, but also the execution efficiency and requirement coverage can be effectively improved, the false positives and false negatives in the manual execution process can be reduced, so that the file transmission link can be accurately maintained and updated in the first time, and the stability can be improved. BRIEF DESCRIPTION OF DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0041] Figure 1 A flowchart of a file transmission stability test method based on traffic restoration files of the present application;
[0042] Figure 2 A functional diagram of a test tool of the present application;
[0043] Figure 3A scenario diagram for generating a PCAP file for the present application;
[0044] Figure 4 Another scenario diagram for generating a PCAP file for the present application;
[0045] Figure 5 A scenario diagram for TCP segmenting a packet for the present application;
[0046] Figure 6 A scenario diagram for constructing a traffic scenario for the present application;
[0047] Figure 7 A structure diagram of a test device for file transmission stability based on traffic restoration files for the present application;
[0048] Figure 8 A structure diagram of a processing device for the present application. DETAILED DESCRIPTION
[0049] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.
[0050] The terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or device that includes a series of steps or modules does not necessarily have to be limited to only those steps or modules clearly listed, but can include other steps or modules that are not clearly listed or inherent to the process, method, product, or device. The naming or numbering of the steps appearing in the present application does not mean that the steps in the method flow must be executed in the time / chronological order indicated by the naming or numbering, and the flow steps that have been named or numbered can change the execution order according to the technical purpose to be achieved, as long as the same or similar technical effects can be achieved.
[0051] The division of the modules appearing in the present application is a logical division, and in actual application, another division mode can be adopted, for example, a plurality of modules can be combined or integrated in another system, or some features can be ignored or not executed, in addition, the coupling or direct coupling or communication connection between the modules shown or discussed can be through some interfaces, and the indirect coupling or communication connection between the modules can be electrical or other similar forms, which are not limited in the present application. In addition, the modules or sub-modules described as separate components can or can not be physically separated, can or can not be physical modules, or can be distributed in a plurality of circuit modules, and part or all of the modules can be selected according to actual needs to achieve the purpose of the present application scheme.
[0052] Before introducing the test method for file transmission stability based on traffic restoration file provided by the present application, the background content involved in the present application is introduced first.
[0053] The test method, device and computer readable storage medium for file transmission stability based on traffic restoration file provided by the present application can be applied to a processing device, for processing sample traffic files to improve the diversity of test cases, so that the file transmission stability of the file transmission link can be tested more accurately.
[0054] The test method for file transmission stability based on traffic restoration file mentioned in the present application can be a test device for file transmission stability based on traffic restoration file, or a server, a physical host or a user equipment (User Equipment, UE) and other different types of processing devices integrated with the test device for file transmission stability based on traffic restoration file. Among them, the test device for file transmission stability based on traffic restoration file can be realized by hardware or software, and the UE can be a terminal device such as a smart phone, a tablet computer, a notebook computer, a desktop computer or a personal digital assistant (Personal Digital Assistant, PDA), and the processing device can be set by device cluster.
[0055] It should be understood that for the processing device herein, the device form can be adjusted according to the needs of the tester or the working environment in actual application, and in addition, it can also be adjusted according to the device involved in the file transmission link which needs to test the file transmission stability, and the specific device form can be flexibly adapted according to the actual situation.
[0056] Next, the test method for file transmission stability based on traffic restoration file provided by the present application is introduced.
[0057] First, refer to Figure 1 , Figure 1A flowchart of a test method for file transmission stability based on traffic restoration files is shown. The test method for file transmission stability based on traffic restoration files provided by the present application can specifically include the following steps S101 to S103:
[0058] In step S101, a sample traffic file is obtained. The traffic file format refers to the file format obtained by converting a file into traffic during file transmission.
[0059] It can be understood that the sample traffic file obtained here is obtained in the initial stage and is used to test the file transmission stability of the target file transmission link. In a general sense, the file transmission stability is the stability of the process of transmitting the converted traffic file from the sender to the receiver in the link.
[0060] For the sample traffic file, it can be an actual traffic file captured from the target file transmission link in real time, an actual traffic file captured from the target file transmission link in a historical time period, an actual traffic file captured from other transmission links, or a manually configured traffic file. The configuration approach is obviously flexible and does not need to be particularly limited.
[0061] For the sample traffic file, the traffic file format obtained by converting a file into traffic during file transmission is obviously the file format that can be used in the actual file transmission link. It is generally a common traffic file format, and of course, it does not exclude that a specific new traffic file format will be specially configured in some application environment.
[0062] As a practical implementation, the traffic file format of the sample traffic file can be PCAP traffic file format, which is a commonly used datagram storage file format in file transmission links. This file format can save the message content and has its fixed storage format.
[0063] In step S102, the sample traffic file is converted from the corresponding initial file transmission protocol into a target traffic file of a different file transmission protocol.
[0064] It can be understood that after studying the related test schemes in the prior art, it is found that when using a purchased network tester for testing, manual configuration is needed to simulate the file transmission protocol adapted to the tester, and the corresponding network configuration also needs to be selected. The protocol is often single and expensive, and the operation is complex. These will all lead to limited test accuracy in actual application, and it is difficult to determine the real and comprehensive situation of the file transmission stability of the target file transmission link.
[0065] Therefore, the application is directly configured in the test tool, after obtaining the sample traffic file, the traffic file conversion of different file transfer protocols is directly performed on the sample traffic file in an automatic manner, so that the diversity of the traffic file (test case) for testing is conveniently and significantly expanded, and thus the inconvenience that the existing technology needs to replace a new file transfer protocol for each round of testing when testing different file transfer protocols is eliminated.
[0066] In this way, the effect of automatically generating network transmission traffic of various protocols by inputting a sample traffic file is realized.
[0067] Among them, as another practical implementation manner, the different file transfer protocols specifically include any combination of FTP protocol, HTTP protocol, HTTP / 2 protocol, SMTP protocol, POP3 protocol, IMAP protocol, IPV4 protocol, and IPV6 protocol and the like.
[0068] In addition, in addition to improving the diversity of the sample by converting the file transfer protocol, the application can also improve the diversity of the sample in other ways in actual application.
[0069] For example, the application can also modify the form of the file itself to simulate the impact on network traffic that may be caused in the file transfer link.
[0070] As another practical implementation manner, the processing of the target traffic file can specifically include:
[0071] Converting the sample traffic file from the corresponding initial file transfer protocol to a first traffic file of different file transfer protocols;
[0072] Performing environment simulation processing on the first traffic file to obtain a second traffic file as a target traffic file, and the environment simulation processing refers to the simulation processing of the network environment of the file processing of the input traffic file.
[0073] It can be understood that the processing of processing the initial sample traffic file into the first traffic file can refer to the description in the foregoing content, which will not be repeated here.
[0074] After obtaining the first traffic file converted by the protocol, the environment simulation processing specially configured by the application can be performed to introduce the impact of different application environments on network traffic.
[0075] It can be understood that the influence of the environment on the network traffic can not only involve the special file processing of the specific environment on the network traffic, but also involve the possible or random file processing of the specific environment on the network traffic, which corresponds to the complex scenarios that can theoretically exist in practical applications.
[0076] Therefore, in the case of improving the diversity of the sample through the conversion of the file transfer protocol, the diversity of the sample can be further improved by simulating the influence of the environment on the network traffic.
[0077] Further, in the environment simulation process, as another practical implementation manner, the file processing in the environment simulation process can specifically include at least one of the processing of delay, repetition, discard, fragmentation, overlap, segmentation, out-of-order, and packet loss.
[0078] It can be found that the processing involved herein is mostly the modification of the location of the file content, such as the processing of repetition, fragmentation, overlap, and out-of-order (content is not missing or distorted), and a small part is the missing of the file content, such as the processing of discard and packet loss, and the modification of the file transfer timing, such as the processing of delay, which modifies the network traffic (traffic file) in different aspects in a complex and changeable manner. Therefore, in addition to the file transfer protocol, the environment that can theoretically be involved can be freely combined, thereby more significantly improving the diversity of the sample.
[0079] Step S103, based on the target traffic file, testing the file transfer stability of the target file transfer link.
[0080] After obtaining the target traffic file with the diversity configured in the application, specific test work can be carried out to test the difference between the actual file obtained after the target file transfer link transmits the target traffic file and the file that should theoretically be obtained, so as to evaluate or quantify the file transfer stability of the target file transfer link.
[0081] Specifically, as another practical implementation manner, the testing process herein can specifically include the following contents:
[0082] restoring the target traffic file into a first target file;
[0083] transferring the target traffic file through the target file transfer link, and listening to a second target file restored by the target file transfer link;
[0084] determining the file transfer stability of the target file transfer link according to the comparison result of the first target file and the second target file.
[0085] It is easy to understand that the first target file is a file that should be obtained in theory after the target traffic file passes through the target file transmission link. The first target file can be measured once or multiple times by using a relevant restoration algorithm, so that the finally determined file is the first target file that should be obtained in theory.
[0086] On the other hand, the second target file is obtained by listening to the target traffic file after the target traffic file is transmitted to the target file transmission link. It should be understood that the second target file can be obtained by restoring the traffic file received by the receiver in the target file transmission link, or can be obtained by restoring the traffic file received by the receiver in the target file transmission link. More simply, the second target file can be obtained by a test tool or by the receiver in the target file transmission link. The difference lies in whether the file restoration processing is performed by the receiver.
[0087] After obtaining the first target file that should be obtained in theory and the second target file that is actually obtained after transmission, the two files can be compared. The difference between the two can be quantified by the comparison result. Obviously, if there is no difference, it means that the file transmission stability of the target file transmission link is better and consistent with the theory. Otherwise, it means that there is a problem with the file transmission stability of the target file transmission link. An abnormal prompt or alarm prompt can be output to promote the arrangement of related maintenance and update to improve the file transmission stability.
[0088] Further, the file transmission stability determined by the present application can also be distinguished by the stability degree through the relevant quantification range, for example, four stability degrees of stable, relatively stable, relatively unstable and unstable, and for example, five stability degrees (quantified by scoring) of 0-30, 30-50, 50-70, 70-90 and 90-100. Obviously, the specific quantification mechanism can also be flexibly adjusted, and the quantification target is the comparison result of the two in a specific factor.
[0089] For the comparison processing of the two, that is, the specific factor for comparison mentioned in the previous paragraph, as another specific implementation manner, the specific value can be a value calculated by different characteristic value algorithms such as MD5 value, SHA1 value or SHA256 value.
[0090] Such a value, in a simple way, can be understood as a value obtained by extracting an information digest. Only a completely consistent file can calculate the same value under the algorithm. Therefore, if the MD, SHA1 value or SHA256 value of two traffic files is consistent, it can be considered that the two traffic files are the same, otherwise the two traffic files are not the same.
[0091] For the MD5 value, it can be understood as a value calculated by MD5 Message-Digest Algorithm, which is a cryptographic hash function, and can generate a 128-bit (16-byte) hash value;
[0092] For the SHA1 value, it is also a value calculated by a cryptographic hash function, which generates a 160-bit (20-byte) hash value called message digest, and the hash value is usually represented by 40 hexadecimal numbers;
[0093] For the SHA256 value, it also belongs to the SHA algorithm, which is an improved algorithm based on the cryptographic hash function involved in the SHA1 value. For any length of message, the calculated SHA256 value is a 256-bit hash value, which is equivalent to an array of 32 bytes in length, and is usually represented by a hexadecimal string of length 64.
[0094] Correspondingly, the comparison result of the first target file and the second target file mentioned in the above content can be the comparison result of the MD5 values calculated by the two, or can be the comparison result of the SHA1 values calculated by the two, or can be the comparison result of the SHA256 values calculated by the two, or can be the comparison result of the characteristic values calculated by the two under other characteristic value calculation algorithms.
[0095] In addition, it should be understood that the characteristic value calculation algorithm involved here can also use characteristic value calculation algorithms other than MD5, SHA1 and SHA256, or even self-developed characteristic value calculation algorithms, which can be configured as needed.
[0096] In order to further understand the above content, it can also be understood in combination with the content of a test tool configured in the specific application.
[0097] Referring to Figure 2 A functional schematic diagram of the test tool of the present application is shown, which shows the related functions that can be configured on the test terminal, the packet sending machine and the device side of the test tool (it should be understood that the actual functions are not limited to the scope shown in the figure) to achieve the test goal of file transmission stability of the file transmission link.
[0098] As a specific implementation of the test tool, it can include the following modules:
[0099] The PCAP conversion module can output a plurality of PCAP files containing the original file transmission protocol by inputting the original file
[0100] Network simulation module, can be through the PCAP file of the last step, according to the application example is simulated, such as fragmentation size 800, output converted PCAP file.
[0101] Traffic playback module, can be through the PCAP file of the last step, according to the application example is simulated, such as fragmentation size 800, output converted PCAP file.
[0102] Result check module, through the file calculated MD5 value, and the MD5 value of the original file is compared, output test result.
[0103] Among them, can see, for the processing of traffic file, corresponding to the above content involves the protocol conversion and environmental simulation processing, here the test tool is targeted to configure two modules to distinguish processing, so, in the processing is relatively independent, more targeted and convenient.
[0104] The specific content can continue to refer to the following content:
[0105] 1. For PCAP conversion module
[0106] Can be based on the original input file, through the PCAP conversion module output different protocol PCAP message according to test case.
[0107] Among them, can support FTP, HTTP, HTTP / 2, SMTP, POP3, IMAP, IPV4 or IPV6 and other file transfer protocol.
[0108] As an example, can generate http-get method PCAP file, the generation process can refer to the diagram content of Figure 3 、 4 Among them, Figure 3 、 4 Respectively, the scene diagram of generating PCAP file of the application.
[0109] 2. For network simulation module
[0110] Can be based on fragroute, tcprewrite and other tools, according to the PCAP message generated by PCAP conversion module, modify the PCAP message under various network environments.
[0111] As another example, can generate TCP segment and fragmentation length of 160 message, such as Figure 5 The diagram content, among them, Figure 5 For a kind of scene diagram of TCP segment message of the application.
[0112] As shown in Figure 5 , the length of the original message is changed to TCP segment of 160 data.
[0113] 3. For the traffic playback module
[0114] The traffic playback can be based on tcpreplay or trex, etc. tools, according to the PCAP samples output by the network simulation module.
[0115] Among them, the corresponding traffic can be listened to for the device under test, and the data transmission samples in the traffic are restored.
[0116] 4. For the result checking module
[0117] The file restored by the traffic playback module is checked by MD5 value, and compared with the MD5 value calculated by the original sample, to judge whether the file restoration is accurate.
[0118] And the following shows a complete example.
[0119] Precondition: there is a sample file test.zip
[0120] 1. The test terminal connects the packet sending device and the device under test (DUT) through the paramiko module of python;
[0121] 2. Generate messages based on FTP, HTTP_GET, HTTP_POST, SMTP, IMAP or POP3 protocols through the PCAP conversion module;
[0122] 3. Generate network simulation configuration files, including various combination scenarios, and generate corresponding PCAP files;
[0123] Among them, the supported configuration parameters are:
[0124] delay first|last|random
[0125] drop first|last|random<prob-%>
[0126] dup first|last|random<prob-%>
[0127] echo <string>...
[0128] ip_chaff dup|opt| <ttl>
[0129] ip frag <size>[old | new]
[0130] ip_opt lsrr | ssrr <ptr> <ip-addr>...
[0131] ip_ttl <ttl>
[0132] ip_tos <tos>
[0133] order random|reverse
[0134] print
[0135] tcp_chaff cksum|null|paws|rexmit|seq|syn| <ttl>
[0136] tcp_opt mss |wscale <size>
[0137] tcp_seg <size>[old | new]
[0138] According to the parameters, different configurations can be generated, corresponding to different environment simulation processing:
[0139] As can be configured:
[0140] delay first 10
[0141] tcp_seg 1024
[0142] That is, the traffic scenario is constructed: the first packet delay is 10ms, and the TCP segment is 1024 PCAP data flow, such as Figure 6 The contents of the diagram, wherein, Figure 6 is a scene diagram for constructing a traffic scenario of the present application.
[0143] 4. The test terminal connects the packet sender through the paramiko module, reads the PCAP list generated according to the network model, and plays back according to the queue. After playback, the test terminal connects the device under test to check the results.
[0144] Among them, the restored result according to the identified traffic can be compared with the MD5 value of the measured sample.
[0145] After executing the use case, the initial environment and log record can be restored.
[0146] 5. After executing all test cases, output the test report to complete the output of the overall test results.
[0147] In summary, for the above scheme content, for the test requirement of the file transmission stability of the target file transmission link, after obtaining the sample traffic file, the present application converts it from the corresponding initial file transmission protocol to the target traffic file of different file transmission protocols, so as to improve the diversity of test cases. When testing the file transmission stability of the target file transmission link based on the target traffic file, the file transmission stability of the file transmission link can be tested more accurately. Under this test mechanism, it is obvious that not only the test accuracy can be improved, but also the execution efficiency and requirement coverage can be effectively improved, the false positives and omissions in the manual execution process can be reduced, so that the file transmission link can be accurately maintained and updated in the first time, and the stability can be improved.
[0148] The above is the introduction of the file transmission stability test method based on traffic restoration file provided by the present application. In order to better implement the file transmission stability test method based on traffic restoration file provided by the present application, the present application also provides a file transmission stability test device based on traffic restoration file from the functional module angle.
[0149] Reference Figure 7 , Figure 7 A structural schematic diagram of the file transmission stability test device based on traffic restoration files in the application, in the application, the file transmission stability test device 700 based on traffic restoration files can specifically include the following structure:
[0150] The acquisition unit 701 is configured to acquire a sample traffic file, wherein the traffic file format refers to a file format obtained by converting a file into traffic during file transmission;
[0151] The conversion unit 702 is configured to convert the sample traffic file from a corresponding initial file transmission protocol into a target traffic file of a different file transmission protocol;
[0152] The test unit 703 is configured to test the file transmission stability of a target file transmission link based on the target traffic file.
[0153] In an exemplary implementation, the traffic file format of the sample traffic file is specifically a PCAP traffic file format.
[0154] In another exemplary implementation, the different file transmission protocols specifically include any combination of an FTP protocol, an HTTP protocol, an HTTP / 2 protocol, an SMTP protocol, a POP3 protocol, an IMAP protocol, an IPV4 protocol, and an IPV6 protocol.
[0155] In another exemplary implementation, the conversion unit 702 is specifically configured to:
[0156] convert the sample traffic file from a corresponding initial file transmission protocol into a first traffic file of a different file transmission protocol;
[0157] perform environment simulation processing on the first traffic file to obtain a second traffic file as a target traffic file, wherein the environment simulation processing refers to simulation processing of a network environment for file processing of the input traffic file.
[0158] In another exemplary implementation, the file processing in the environment simulation processing includes at least one of delay, repetition, discarding, fragmentation, overlap, segmentation, out-of-order, and packet loss.
[0159] In another exemplary implementation, the test unit 703 is specifically configured to:
[0160] restore the target traffic file into a first target file;
[0161] perform file transmission on the target traffic file through a target file transmission link, and listen to a second target file restored from the target file transmission link;
[0162] Based on the comparison results between the first target file and the second target file, the file transfer stability of the target file transfer link is determined.
[0163] In another exemplary implementation, the comparison result between the first target file and the second target file is specifically the comparison result of their calculated MD5 values, or specifically the comparison result of their calculated SHA1 values, or specifically the comparison result of their calculated SHA256 values.
[0164] This application also provides a processing device from a hardware architecture perspective, see [link / reference]. Figure 8 , Figure 8 This diagram illustrates a structural schematic of the processing device of this application. Specifically, the processing device may include a processor 801, a memory 802, and an input / output device 803. The processor 801 executes the computer program stored in the memory 802 to implement, for example... Figure 1 The corresponding steps of the file transfer stability test method based on traffic recovery in the embodiment; or, when the processor 801 executes the computer program stored in the memory 802, it implements as follows: Figure 7 Corresponding to the functions of each unit in the embodiment, the memory 802 is used to store the functions executed by the processor 801 as described above. Figure 1 The computer program required for the test method of file transfer stability based on traffic restoration in the corresponding embodiment.
[0165] For example, a computer program may be divided into one or more modules / units, one or more of which are stored in memory 802 and executed by processor 801 to complete this application. One or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in a computer device.
[0166] The processing device may include, but is not limited to, processor 801, memory 802, and input / output device 803. Those skilled in the art will understand that the illustrations are merely examples of the processing device and do not constitute a limitation on the processing device. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the processing device may also include network access devices, buses, etc., and processor 801, memory 802, input / output device 803, etc., are connected via a bus.
[0167] The processor 801 can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor and the like. The processor is the control center of the processing device, and connects various parts of the entire device through various interfaces and lines.
[0168] The memory 802 can be used to store computer programs and / or modules, and the processor 801 realizes various functions of the computer device by running or executing the computer programs and / or modules stored in the memory 802, and calling data stored in the memory 802. The memory 802 can mainly include a program storage area and a data storage area, wherein the program storage area can store operating systems, application programs required by at least one function, etc.; and the data storage area can store data created according to the use of the processing device, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state memory devices.
[0169] When the processor 801 is used to execute the computer programs stored in the memory 802, the following functions can be realized:
[0170] Obtaining a sample traffic file, wherein the traffic file format refers to a file format obtained by converting a file into traffic in a file transmission process;
[0171] Converting the sample traffic file from a corresponding initial file transmission protocol into a target traffic file of different file transmission protocols;
[0172] Testing the file transmission stability of the target file transmission link based on the target traffic file.
[0173] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described test device for file transmission stability based on traffic restoration file, processing device and corresponding units thereof can be referred to as Figure 1 The test method of the file transmission stability based on the traffic restoration file in the corresponding embodiment is not repeated here.
[0174] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions or by controlling relevant hardware by the instructions, which can be stored in a computer readable storage medium and loaded and executed by a processor.
[0175] To this end, the present application provides a computer readable storage medium, which stores a plurality of instructions capable of being loaded by a processor to execute the present application such as Figure 1 The steps of the test method of the file transmission stability based on the traffic restoration file in the corresponding embodiment can be specifically implemented with reference to the Figure 1 The test method of the file transmission stability based on the traffic restoration file in the corresponding embodiment is not repeated here.
[0176] The computer readable storage medium can include a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0177] Due to the instructions stored in the computer readable storage medium, the present application such as Figure 1 The steps of the test method of the file transmission stability based on the traffic restoration file in the corresponding embodiment, therefore, the present application such as Figure 1 The beneficial effects of the test method of the file transmission stability based on the traffic restoration file in the corresponding embodiment are described above, and are not repeated here.
[0178] The test method of the file transmission stability based on the traffic restoration file, the device, the processing equipment and the computer readable storage medium provided by the present application are introduced in detail above, and the principles and implementation modes of the present application are described by applying specific examples; the above embodiment is only used to help understand the core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed; in view of the above, the content of the specification should not be understood as the limitation of the present application.< / size> < / size> < / ttl> < / tos> < / ttl> < / ptr> < / size> < / ttl> < / string>
Claims
1. A test method for file transfer stability based on traffic reduction files, characterized by, The method comprises: acquiring a sample traffic file, wherein the traffic file format refers to a file format obtained by converting a file into traffic in a file transmission process; converting the sample traffic file from a corresponding initial file transmission protocol into target traffic files of different file transmission protocols at the same time; testing file transmission stability of a target file transmission link based on the target traffic files; the traffic file format of the sample traffic file is specifically a data table capture PCAP traffic file format; the different file transmission protocols specifically include FTP protocol, HTTP protocol, HTTP / 2 protocol, SMTP protocol, POP3 protocol, IMAP protocol, IPV4 protocol and IPV6 protocol; the conversion of the sample traffic file from the corresponding initial file transmission protocol into the target traffic files of different file transmission protocols at the same time comprises: converting the sample traffic file from the corresponding initial file transmission protocol into first traffic files of the different file transmission protocols at the same time; performing environment simulation processing on the first traffic files to obtain second traffic files as the target traffic files, wherein the environment simulation processing refers to simulation processing of a network environment for file processing of an input traffic file; the file processing in the environment simulation processing includes delay, repetition, discarding, fragmentation, overlap, segmentation, out-of-order and packet loss; the testing of the file transmission stability of the target file transmission link based on the target traffic files comprises: restoring the target traffic files into first target files; transmitting the target traffic files through the target file transmission link for file transmission and listening to second target files obtained by restoring the target file transmission link; determining the file transmission stability of the target file transmission link according to a comparison result of the first target files and the second target files.
2. The method of claim 1, wherein, The comparison result of the first target files and the second target files is specifically a comparison result of MD5 values calculated by the first target files and the second target files, or is specifically a comparison result of SHA1 values calculated by the first target files and the second target files, or is specifically a comparison result of SHA256 values calculated by the first target files and the second target files.
3. A test device for file transfer stability based on traffic reduction files, characterized by The device comprises: an acquisition unit configured to acquire a sample traffic file, wherein the traffic file format refers to a file format obtained by converting a file into traffic in a file transmission process; a conversion unit configured to convert the sample traffic file from a corresponding initial file transmission protocol into target traffic files of different file transmission protocols at the same time; a testing unit configured to test file transmission stability of a target file transmission link based on the target traffic files; the traffic file format of the sample traffic file is specifically a data table capture PCAP traffic file format; the different file transmission protocols specifically include FTP protocol, HTTP protocol, HTTP / 2 protocol, SMTP protocol, POP3 protocol, IMAP protocol, IPV4 protocol and IPV6 protocol; the conversion unit is specifically configured to: convert the sample traffic file from the corresponding initial file transmission protocol into first traffic files of the different file transmission protocols at the same time; The first traffic file is subjected to environment simulation processing to obtain a second traffic file as the target traffic file, wherein the environment simulation processing refers to simulation processing of a network environment of file processing of the input traffic file; The file processing in the environment simulation processing includes delay, repetition, discarding, fragmentation, overlap, segmentation, disorder and packet loss; The test unit is specifically configured to: restore the target traffic file into a first target file; transmit the target traffic file through the target file transmission link and listen to a second target file restored from the target file transmission link; determine the file transmission stability of the target file transmission link according to a comparison result of the first target file and the second target file.
4. A processing device, characterized by The computer readable storage medium stores a plurality of instructions, which are adapted to be loaded by the processor to execute the method of claim 1 or 2.
5. A computer readable storage medium, characterized in that, The computer readable storage medium stores a plurality of instructions, which are adapted to be loaded by the processor to execute the method of claim 1 or 2.
Citation Information
Patent Citations
Abnormal data stream simulation method and device, electronic equipment and storage medium
CN113747256A
Safety equipment testing method and device, electronic equipment and storage medium
CN114095412A
Message interface format conversion method, device and system
CN115118792A