Data testing method, transmission method, device, client and storage medium
By segmenting the transmitted data and transmitting it according to the server's desired window size, the problem of data transmission errors caused by inconsistent window sizes is solved, thus improving the accuracy of data transmission.
Patent Information
- Application Number
- CN202311840714.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2043-12-28
AI Technical Summary
Errors may occur during data transmission due to the inconsistent window sizes between the server and client.
By acquiring the transmitted data and segmenting it according to the client's preset window size and data byte length, the first segment of data is sent to the server. This allows the server to send the desired window size to the client if the desired window size is smaller than the preset window size, and then transmit each segment of data sequentially according to the desired window size.
This reduces the probability of errors during segmented data transmission and improves the accuracy of data transmission.
Smart Images

Figure CN118827574B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of data transmission, and particularly relates to a data testing method, a transmission method, a device, a client and a storage medium. BACKGROUND
[0002] The client is usually a real industrial device, and the industrial device usually has a default data sending window size. Before the client sends data to the server, the data is segmented, and then the data is sent according to the data sending window size, that is, it is assumed that the receiving server can also receive data according to the data sending window size.
[0003] However, in fact, the server may not be consistent with the window size of the client, so this may cause transmission errors between the client and the server. SUMMARY
[0004] The embodiments of the present application provide a data testing method, a transmission method, a device, a client and a storage medium, which reduce the probability of data transmission errors.
[0005] According to a first aspect of the present application, the embodiments of the present application provide a data transmission method, which is applied to data transmission testing, and the method comprises the following steps:
[0006] Obtaining transmission data;
[0007] Segmenting the transmission data according to a preset window size of the client and a byte length of the transmission data to obtain a plurality of segmented transmission data;
[0008] Transmitting the first segmented transmission data to the server, so that the server transmits an expected window size to the client in the case that the expected window size is smaller than the preset window size, the preset window size corresponding to the client, and the expected window size corresponding to the server;
[0009] According to the expected window size, sequentially transmitting each segmented transmission data to the server.
[0010] Optionally, according to the expected window size, sequentially transmitting each segmented transmission data to the server, comprising:
[0011] According to the expected window size, determining an actual window size corresponding to each segmented transmission data respectively;
[0012] According to the actual window size, sequentially transmitting each segmented transmission data to the server.
[0013] Optionally, according to the expected window size, determining an actual window size corresponding to each segmented transmission data respectively, comprising:
[0014] The actual window size is determined to be the difference between the desired window size and a fixed value. The fixed value is incremented sequentially in each loop and is ≥1.
[0015] Alternatively, the actual window size can be determined as the difference between the expected window size and a random value, where the random value is greater than 1.
[0016] Optionally, according to the desired window size, each segment of data is transmitted to the server sequentially, including:
[0017] After the first segment of data is transmitted to the server, the first reply message from the server is received.
[0018] Stop sending the second segment of data to the server;
[0019] The receiving server sends a second reply message based on the first segment of transmitted data. The second reply message is sent by the server if it has not received the second segment of transmitted data for a preset time period.
[0020] If the first data identifier in the first reply message matches the second data identifier in the second reply message, the communication status between the server and the client is determined to be normal.
[0021] Optionally, the method further includes:
[0022] Obtain the sequence identifier of the third segment of transmitted data;
[0023] If the sequence identifier is a preset identifier, it is determined that after the third segment data is transmitted to the server, all segment data will be transmitted to the server.
[0024] According to a second aspect of this application, embodiments of this application provide a data transmission testing method, the method comprising:
[0025] Obtain the actual data transmission process between the client and the server;
[0026] The test results are obtained by comparing the consistency between the actual data transmission process and the data transmission test process of any method in the first aspect.
[0027] According to a third aspect of this application, embodiments of this application provide a data transmission apparatus, the apparatus comprising:
[0028] The first acquisition module is used to acquire the transmitted data;
[0029] The segmentation module is used to segment the transmitted data according to the client's preset window size and the byte length of the transmitted data, resulting in multiple segmented transmitted data.
[0030] The first transmission module is configured to transmit the first segmented transmission data to the server, so that the server transmits the expected window size to the client when the expected window size is smaller than the preset window size, the preset window size corresponds to the client, and the expected window size corresponds to the server.
[0031] The second transmission module is configured to sequentially transmit each segmented transmission data to the server according to the expected window size.
[0032] According to a fourth aspect of the present application, a data transmission device is provided, which comprises a processor and a memory storing computer program instructions;
[0033] The processor implements the data transmission method of any one of the first aspect when executing the computer program instructions.
[0034] According to a fifth aspect of the present application, a computer storage medium is provided, and the computer readable storage medium stores computer program instructions, which are executed by the processor to implement the data transmission method of any one of the first aspect and / or the data transmission test method of the second aspect.
[0035] According to a sixth aspect of the present application, a computer program product is provided, and the instructions in the computer program product are executed by the processor of the electronic device to enable the electronic device to execute the data transmission method of any one of the first aspect and / or the data transmission test method of the second aspect.
[0036] The data test method, the transmission method, the device, the client and the storage medium provided by the embodiments of the present application obtain transmission data, segment the transmission data according to a communication protocol to obtain a plurality of segmented transmission data, and then send the first segmented transmission data in the plurality of segmented transmission data to the server, so that the server transmits the expected window size in which the server can receive the transmission data to the client when the expected window size is smaller than the preset window size, and the segmented transmission data can be sent to the server according to the expected window size of the server, so that each segmented transmission data can be normally transmitted to the server, the probability of error in the transmission of the segmented transmission data is reduced, and the accuracy of data transmission is improved. BRIEF DESCRIPTION OF DRAWINGS
[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly introduced. For those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0038] Figure 1is a flowchart of a data transmission method according to an exemplary embodiment;
[0039] Figure 2 is a flowchart of a data transmission method according to an exemplary embodiment;
[0040] Figure 3 is a flowchart of a data transmission method according to an exemplary embodiment;
[0041] Figure 4 is a flowchart of a data transmission method according to an exemplary embodiment;
[0042] Figure 5 is a block diagram of a data transmission apparatus according to an exemplary embodiment;
[0043] Figure 6 is a block diagram of a data transmission test apparatus according to an exemplary embodiment;
[0044] Figure 7 is a block diagram of a data transmission device according to an exemplary embodiment. DETAILED DESCRIPTION
[0045] The features and exemplary embodiments of the various aspects of the present application will be described in detail below with reference to the drawings. The following detailed description is merely intended to explain the present application, and is not intended to limit the present application. The present application can be implemented without some of the specific details, which are not required for understanding the present application. The following description of the embodiments is merely provided to give a better understanding of the present application by showing examples of the present application.
[0046] It should be noted that the terms such as first and second, etc., are merely used to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between such entities or operations. Also, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that processes, methods, articles or apparatuses including a series of elements not only include those elements, but also include other elements not explicitly listed, or further include elements inherent in such processes, methods, articles or apparatuses. Without more limitations, the elements defined by the statement "include" do not exclude the presence of other identical elements in the processes, methods, articles or apparatuses including the elements.
[0047] As described in the background section, the actual server does not necessarily conform to the window size of the client, so this also leads to the possibility of transmission errors between the client and the server.
[0048] To solve the problems in the prior art, the application sends first segmented transmission data in the plurality of segmented transmission data to the server, so that the server sends the expected window size of the server capable of receiving transmission data to the client in the case that the expected window size is smaller than the preset window size, so that the segmented transmission data can be sent to the server according to the expected window size of the server, so that each segmented transmission data can be normally transmitted to the server, the probability of errors in the transmission of the segmented transmission data is reduced, and the accuracy of data transmission is improved.
[0049] Based on this, the application provides a data testing method, a transmission method, equipment, a client and a storage medium. First, the data transmission method provided by the embodiment of the application is introduced.
[0050] Figure 1 A flowchart of the data transmission method provided by an embodiment of the application is shown.
[0051] As shown in Figure 1 , it can include the following steps:
[0052] S101, obtaining transmission data;
[0053] S102, segmenting the transmission data according to the preset window size of the client and the byte length of the transmission data to obtain a plurality of segmented transmission data;
[0054] S103, transmitting first segmented transmission data to the server, so that the server sends the expected window size to the client in the case that the expected window size is smaller than the preset window size, the preset window size corresponds to the client, and the expected window size corresponds to the server;
[0055] S104, transmitting each segmented transmission data to the server in turn according to the expected window size.
[0056] Based on the above embodiment, the application obtains the transmission data, segments the transmission data according to the communication protocol to obtain a plurality of segmented transmission data, and then sends the first segmented transmission data in the plurality of segmented transmission data to the server. Thus, the server sends the expected window size of the server capable of receiving the transmission data to the client in the case that the expected window size is smaller than the preset window size, so that the segmented transmission data can be sent to the server according to the expected window size of the server, and each segmented transmission data can be normally transmitted to the server, thereby reducing the probability of error in the transmission of the segmented transmission data and improving the accuracy of data transmission.
[0057] In S101, the transmission data to be tested is obtained.
[0058] As an example, in order to ensure the test effect, the byte length of the transmission data should be long enough, otherwise the number of segments will be too small, which will affect the test effect.
[0059] In S102, the data is segmented and sent according to the specified format, which can ensure the correctness and compatibility of the data. Therefore, the transmission data needs to be segmented according to the preset window size and the byte length of the transmission data, and more specifically, there is a transmission sequence between each segmented transmission data.
[0060] As an example, the "window size" generally refers to the size or format of the data packet used when the network client communicates with the network server. This size is usually measured in bytes.
[0061] In S103, each segmented transmission data is transmitted to the server one by one. After the first segmented transmission data is transmitted to the server, if the expected window size of the server is smaller than the preset window size of the client, the server cannot receive the first segmented transmission data transmitted by the client, so the server sends the expected window size of the server to the client in the form of a message.
[0062] In S104, after obtaining the expected window size of the server, the client retransmits the first segmented transmission data according to the expected window size until each segmented transmission data is transmitted to the server.
[0063] Specifically, the following method can be used to determine that each segmented transmission data is transmitted to the server.
[0064] The order identifier of the third segmented transmission data is obtained.
[0065] In a case where the sequence identifier of the third segment transmission data is the preset identifier, it is determined that all the segment transmission data are transmitted to the server after the third segment transmission data are transmitted to the server.
[0066] Each segment transmission data is provided with a corresponding sequence identifier, which is used to indicate the transmission sequence of the segment transmission data. As an example, the sequence identifier can be a MOR field in the segment transmission data. If the MOR field is 1, it indicates that there is other segment transmission data to be transmitted after the segment transmission data. If the MOR field is 0, it indicates that there is no other segment transmission data to be transmitted after the segment transmission data. Therefore, if the sequence identifier of the third segment transmission data is the preset identifier, it indicates that all the segment transmission data are transmitted to the server.
[0067] In order to test more data transmission methods, the application further provides another implementation manner of the data transmission method.
[0068] Figure 2 Another flowchart of the data transmission method provided by an embodiment of the application is shown in FIG. 6. Figure 2 As shown in FIG. 6, S104 can further include the following steps.
[0069] S201, respectively determining actual window sizes corresponding to the segment transmission data according to the expected window size.
[0070] S202, sequentially transmitting the segment transmission data to the server according to the actual window sizes.
[0071] Based on the above embodiment, the actual window sizes of the segment transmission data are determined according to the expected window size, so that the segment transmission data are respectively transmitted to the server according to the corresponding actual window sizes. Therefore, the connection between the actual transmission windows of the servers can be tested.
[0072] In S201, the actual window sizes corresponding to the segment transmission data are respectively determined based on the communication protocol, the expected window size of the server, and the arrangement sequence of the segment transmission data.
[0073] Specifically, as an example:
[0074] The actual window size is determined as the difference between the expected window size and a fixed value, the fixed value is increased by 1 in each cycle, and the fixed value is greater than or equal to 1.
[0075] For example, the actual window size of the first segment transmission data can be the expected window size-1; the actual transmission window size of the second segment transmission data can be the expected window size-2, and the actual window size of the third segment transmission data can be the expected window size-3. Wherein, 1, 2, and 3 are: an increasing sequence with a tolerance of 1 and a first term of 1.
[0076] Each segmented transmission data transmission to the server is a cycle.
[0077] Alternatively, the actual window size is determined as the difference between the expected window size and a random value, and the random value is greater than 1.
[0078] The actual window size of the first segmented transmission data can be the expected window size-2; the actual window size of the second segmented transmission data can be the expected window size-3, and the actual window size of the third segmented transmission data can be the expected window size-7; wherein 1, 3 and 7 are random values.
[0079] In addition, in the plurality of segmented transmission data, the actual window size of any segmented transmission data can be the difference between the expected window size and a fixed value, or the difference between the expected window size and a random value.
[0080] It should be noted that, in the embodiment, the second segmented transmission data refers to the segmented transmission data sent to the server after the first segmented transmission data is transmitted to the server, and the third segmented transmission data refers to the segmented transmission data sent to the server after the second segmented transmission data is transmitted to the server.
[0081] In the above S202, after the actual window size corresponding to each segmented transmission data is determined, the server transmits each segmented transmission data to the client according to the actual window size corresponding to each segmented transmission data.
[0082] In other embodiments, when the expected window size is greater than or equal to the preset window size of the client, the actual window size of any segmented transmission data in the transmission process can be the difference between the expected window size and a fixed value, or the difference between the expected window size and a random value.
[0083] In order to test more data transmission methods, the application further provides another implementation manner of the data transmission method.
[0084] Figure 3 Another flowchart of the data transmission method provided by an embodiment of the application is shown, as shown in Figure 3 The above S104 can further include the following steps:
[0085] S301, after the first segmented transmission data is transmitted to the server, a first reply message of the server is received;
[0086] S302, the transmission of the second segmented transmission data to the server is stopped;
[0087] S303, receiving a second reply message replied by the server according to the first segmented transmission data, the second reply message being sent by the server in a case that the second segmented transmission data is not received by the server within a preset time length;
[0088] S304, in a case that the first data identifier in the first reply message is consistent with the second data identifier in the second reply message, determining that the communication state between the server and the client is a normal state.
[0089] Based on the above embodiment, by respectively receiving the first reply message replied by the server after sending the first segmented transmission data; and the second reply message sent by the server after stopping sending the second segmented transmission data, the consistency of the first reply message and the second reply message is compared, so that in a case that the first reply message and the second reply message are consistent, it can be determined that the communication between the client and the server is normal, and the server can normally start the timeout retransmission mechanism in a case that the client does not respond for a long time.
[0090] In the above S301, after the client sends the first segmented transmission data to the server, the server will reply the first reply message to the client according to the first segmented transmission data, so that the client can receive the first reply message replied by the server, and the first reply message is used to tell the client that the server has received the first segmented transmission data.
[0091] In the above S302, when the client uploads each segmented transmission data to the server, the client may not receive a response due to network fluctuation, at this time the server will send a response message (i.e. timeout retransmission mechanism) to the client again. However, the probability of natural network fluctuation during testing is very low, which is difficult to control artificially, so it is difficult to cover the test scene of the timeout retransmission of the server response message. Therefore, in order to test the timeout retransmission mechanism, after sending the first segmented transmission data to the server, the second segmented transmission data needs to be stopped from being sent to the server, so as to simulate the case that there is communication abnormality between the client and the server due to network fluctuation, and the client cannot respond to the first reply message, resulting in the failure to continue sending the second segmented transmission data.
[0092] In the above S303, if the server does not receive the second segmented transmission data within a preset time length, the timeout retransmission mechanism will be triggered, so the server will send the second reply message to the client again, so that the client sends the second segmented transmission data to the server, but the second reply message is not necessarily generated due to the triggering of the timeout retransmission mechanism, but also a reply message for error reporting due to communication error.
[0093] In S304, the first data identifier in the first reply message is compared with the second data identifier in the second reply message. If they are consistent, it is indicated that the first reply message and the second reply message are consistent, and the second reply message is the same as the first reply message, which is a prompt information sent by the server to the client after receiving the first segmented transmission data, and is used to prompt the client to send the second segmented transmission data to the server. Therefore, the second reply message is sent by triggering the timeout retransmission mechanism. Otherwise, the second reply message may not be generated by triggering the timeout retransmission mechanism.
[0094] As an example, the data identifier can include an Invoke ID and a Sequence Number.
[0095] As an example, the data identifier in each reply message is stored in the database of the client.
[0096] After the data transmission method for data transmission test is completed, the data transmission method can be further tested.
[0097] The data transmission test method provided by the embodiment of the application will be introduced below.
[0098] Figure 4 A flowchart of the data transmission test method provided by an embodiment of the application is shown. As shown in the figure, the method can include the following steps: Figure 4
[0099] S401, obtaining an actual data transmission process of the client and the server;
[0100] S402, comparing the actual data transmission process with the data transmission test process of the method, to obtain a test result.
[0101] The actual data transmission between the server and the client can be obtained by using a packet capture tool. The actual data transmission is compared with the data transmission method in any one of the above methods, to obtain a test result. Specifically, whether the data transmission between the server and the client is consistent with the transmission process described in the data transmission method is detected. Figures 1-3 If they are consistent, it is indicated that the data transmission between the server and the client is normal. If they are not consistent, it is indicated that the data transmission between the server and the client is abnormal, and the packet capture file obtained by the packet capture tool needs to be provided to the developer for problem troubleshooting. Therefore, the accuracy and convenience of the data transmission detection are improved.
[0102]
[0103] It should be noted that the application scenarios described in the above embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems as new application scenarios appear. In addition, new embodiments of the present application can be combined with each other, and the new solutions formed by the combination of each embodiment are within the protection scope of the present application.
[0104] Based on the same inventive concept, the present application also provides a data transmission device 500. In combination with the above Figure 5 will be described in detail.
[0105] The first acquisition module 510 is configured to acquire transmission data.
[0106] The segmentation module 520 is configured to segment the transmission data according to a preset window size of the client and a byte length of the transmission data, to obtain a plurality of segmented transmission data.
[0107] The first transmission module 530 is configured to transmit the first segmented transmission data to the server, so that the server transmits an expected window size to the client in a case where the expected window size is smaller than the preset window size, the preset window size corresponding to the client, and the expected window size corresponding to the server.
[0108] The second transmission module 540 is configured to sequentially transmit each segmented transmission data to the server according to the expected window size.
[0109] In the data transmission device 500 provided in the embodiment, the first acquisition module 510 acquires the transmission data, the segmentation module 520 segments the transmission data according to the communication protocol to obtain a plurality of segmented transmission data, and the first transmission module 530 further transmits the first segmented transmission data in the plurality of segmented transmission data to the server. Thus, the server transmits the expected window size to the client in a case where the expected window size is smaller than the preset window size, and the second transmission module 540 can transmit the segmented transmission data to the server according to the expected window size of the server, so that each segmented transmission data can be normally transmitted to the server, the probability of error in the transmission of the segmented transmission data is reduced, and the accuracy of data transmission is improved.
[0110] Optionally, the second transmission module 540 can include:
[0111] The first determination unit is configured to determine an actual window size corresponding to each segmented transmission data according to the expected window size.
[0112] The transmission unit is configured to sequentially transmit each segmented transmission data to the server according to the actual window size.
[0113] Optionally, the first determining unit can comprise:
[0114] a first determining sub-unit, configured to determine the actual window size as a difference between the expected window size and a fixed value, the fixed value being increased by one in each loop, and the fixed value being greater than or equal to 1;
[0115] or a second determining sub-unit, configured to determine the actual window size as a difference between the expected window size and a random value, the random value being greater than 1.
[0116] Optionally, the second transmission module 540 can further comprise:
[0117] a first receiving unit, configured to receive a first reply message of the server after the first segmented transmission data is transmitted to the server;
[0118] a stopping unit, configured to stop transmitting the second segmented transmission data to the server;
[0119] a second receiving unit, configured to receive a second reply message of the server in response to the first segmented transmission data, the second reply message being transmitted by the server in a case that the second segmented transmission data is not received within a preset time length;
[0120] a second determining unit, configured to determine that the communication state between the server and the client is a normal state in a case that a first data identifier in the first reply message is consistent with a second data identifier of the second reply message.
[0121] Optionally, the data transmission apparatus 500 can further comprise:
[0122] a second obtaining module, configured to obtain a sequence identifier of the third segmented transmission data;
[0123] a first determining module, configured to determine that each segmented transmission data is transmitted to the server after the third segmented transmission data is transmitted to the server in a case that the sequence identifier is a preset identifier.
[0124] The data transmission apparatus 500 provided by the embodiment of the present application can implement each process of the method embodiment and achieve the same technical effects. To avoid repetition, details are not described herein. Figures 1 to 3
[0125] Based on the same inventive concept, the present application further provides a data transmission testing apparatus 600. Details are described below with reference to the Figure 6
[0126] a third obtaining module 610, configured to obtain an actual data transmission process of the client and the server;
[0127] a comparing module 620, configured to compare the actual data transmission process with the expected data transmission process as Figures 1-3 The consistency of the data transmission test process of any one of the methods is obtained, and a test result is obtained.
[0128] The data transmission test device 600 provided by the embodiment of the application can implement Figure 4 the various processes of the method embodiments and achieve the same technical effects. To avoid repetition, details are not described here.
[0129] Figure 7 A hardware structure schematic diagram of the data transmission device provided by the embodiment of the application is shown.
[0130] The data transmission device can include a processor 701 and a memory 702 storing computer program instructions.
[0131] Specifically, the processor 701 can include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or can be configured as one or more integrated circuits that implement the embodiment of the application.
[0132] The memory 702 can include a mass storage for data or instructions. By way of example and not limitation, the memory 702 can include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 702 can include removable or non-removable (or fixed) media. Where appropriate, the memory 702 can be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, the memory 702 is non-volatile solid-state memory.
[0133] In a particular embodiment, the memory 702 can include read-only memory (ROM), random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Thus, generally, the memory 702 includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions that, when executed (e.g., by the one or more processors 701), are operable to perform the operations described with reference to the methods according to an aspect of the application.
[0134] The processor 701 implements any one of the data transmission methods in the above embodiments by reading and executing the computer program instructions stored in the memory 702.
[0135] In one example, the data transmission device can further include a communication interface 703 and a bus 704. Wherein, as shown in the figure, the processor 701, the memory 702, the communication interface 703 are connected through the bus 704 and complete the communication between each other.
[0136] The communication interface 703 is mainly used to realize the communication between the modules, devices, units and / or equipment in the embodiments of the application.
[0137] The bus 704 includes hardware, software or both. By way of example and not limitation, the bus 704 can include an accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front-side bus (FSB), hyper transport (HT) interconnect, industry standard architecture (ISA) bus, wireless bandwidth interconnect, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnect (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standards association local (VLB) bus, or other suitable bus or combination of two or more of these. Where appropriate, the bus 704 can include one or more buses 704. Although specific buses 704 are described and shown in the embodiments of the application, the application contemplates any suitable bus 704 or interconnect.
[0138] The data transmission device can be based on the current data transmission method, so as to realize the data transmission method and device described in combination Figures 1-3 and Figure 5 The data transmission method and device described above.
[0139] In addition, the embodiments of the application further provide a computer program product, including computer program instructions, the computer program product is executed by the processor 701 can realize the steps and corresponding content of the foregoing method embodiments.
[0140] It needs to be clear that the application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between steps, after understanding the spirit of the application.
[0141] The functions shown in the above-described structural block diagrams can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, and the like. When implemented in software, the elements of the present application are program or code segments that are used to perform the required tasks. The program or code segments can be stored in a machine-readable medium, or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. The "machine-readable medium" can include any medium that can store or transfer information. Examples of the machine-readable medium include an electronic circuit, a semiconductor memory device, a ROM, a flash memory, an erasable ROM (EROM), a floppy diskette, a CD-ROM, an optical disk, a hard disk, a fiber optic medium, a radio frequency (RF) link, and the like. The code segments can be downloaded via a computer network, such as the Internet, an intranet, and the like.
[0142] It is also important to note that the examples described herein can be implemented in a variety of systems, including and / or incorporating software, firmware, hardware, fixed logic circuitry, and / or a combination of items, and that the disclosure should not be limited to one particular implementation. Furthermore, although, for simplicity of explanation, the computer-implemented aspects of the disclosure are described in the context of executing software routines, it should be appreciated that the implementation is not limited by this context and that the software aspects can also fully function in an hardware- and / or software-only environment.
[0143] Similarly, the embodiments of the present application also provide a data transmission test device, which can be based on the current data transmission test method, thereby realizing the data transmission test method and device described in combination Figure 4 and Figure 6 with the embodiments of the present application.
[0144] The above-described aspects and implementations of the present application can be implemented in hardware, software, firmware or a combination thereof. Various aspects of the application can be implemented in one or more computer programs or code segments. The program or code segments can be stored in one or more machine-readable medium, or transmitted by a carrier wave over a transmission medium or communication link. The "machine-readable medium" can include any medium that can store or transfer information. Examples of the machine-readable medium include an electronic circuit, a semiconductor memory device, a ROM, a flash memory, an erasable ROM (EROM), a floppy diskette, a CD-ROM, an optical disk, a hard disk, a fiber optic medium, a radio frequency (RF) link, and the like. The code segments can be downloaded via a computer network, such as the Internet, an intranet, and the like.
[0145] The above merely describes a specific implementation of the present application. Those skilled in the art can clearly understand the specific working processes of the system, modules and units described above for the convenience and brevity of description, and can refer to the corresponding processes in the foregoing method embodiments, which will not be described herein again. It should be understood that the protection scope of the present application is not limited to this, and any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements should be covered within the protection scope of the present application.
Claims
1. A data transmission method, characterized by, The method is used for data transmission test, the method is applied to a client, and the method comprises the following steps of: acquiring transmission data; segmenting the transmission data according to a preset window size of the client and a byte length of the transmission data to obtain a plurality of segmented transmission data; transmitting first segmented transmission data to a server, so that the server transmits an expected window size to the client in a case where the expected window size is smaller than the preset window size, the preset window size corresponding to the client, and the expected window size corresponding to the server; transmitting each of the segmented transmission data to the server in sequence according to the expected window size; the step of transmitting each of the segmented transmission data to the server in sequence according to the expected window size comprises the following steps of: determining an actual window size corresponding to each of the segmented transmission data according to the expected window size; transmitting each of the segmented transmission data to the server according to the actual window size; the step of determining the actual window size of the first segmented transmission data for transmission to the server according to the expected window size comprises the following step of: determining the actual window size as a difference between the expected window size and a random value, the random value being greater than 1.
2. The method of claim 1, wherein, the step of determining the actual window size of the first segmented transmission data for transmission to the server according to the expected window size can also be: determining the actual window size as a difference between the expected window size and a fixed value, the fixed value being increased in sequence in each cycle, and the fixed value being greater than or equal to 1.
3. The method of claim 1, wherein, the step of transmitting each of the segmented transmission data to the server in sequence according to the expected window size comprises the following steps of: after the first segmented transmission data is transmitted to the server, receiving a first reply message of the server; stopping transmission of second segmented transmission data to the server; receiving a second reply message of the server in reply to the first segmented transmission data, the second reply message being transmitted by the server in a case where the second segmented transmission data is not received within a preset time length; in a case where a first data identifier in the first reply message is consistent with a second data identifier of the second reply message, determining that a communication state of the server and the client is a normal state.
4. The method of claim 1, wherein, the method further comprises the following steps of: acquiring a sequence identifier of third segmented transmission data; in a case where the sequence identifier is a preset identifier, determining that each of the segmented transmission data is transmitted to the server after the third segmented transmission data is transmitted to the server.
5. A data transmission test method characterized by, the method comprises the following steps of: acquiring an actual data transmission process of the client and the server; comparing the actual data transmission process with a data transmission test process of the method in any one of claims 1-4 to obtain a test result.
6. A client, characterized in that, the client comprises: a first acquisition module for acquiring transmission data; a segmentation module for segmenting the transmission data according to a preset window size of the client and a byte length of the transmission data to obtain a plurality of segmented transmission data; The first transmission module is configured to transmit the first segmented transmission data to a server, so that the server transmits an expected window size to the client when the expected window size is smaller than a preset window size corresponding to the client, the expected window size corresponding to the server; The second transmission module is configured to sequentially transmit each of the segmented transmission data to the server according to the expected window size; The second transmission module comprises: A first determination unit configured to determine an actual window size corresponding to each of the segmented transmission data according to the expected window size; A transmission unit configured to sequentially transmit each of the segmented transmission data to the server according to the actual window size; The first determination unit comprises: A second determination sub-unit configured to determine that the actual window size is a difference between the expected window size and a random value, the random value being greater than 1.
7. A data transmission device, characterized by The device comprises a processor and a memory storing computer program instructions; The processor executes the computer program instructions to implement the method in any one of claims 1-4.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer program instructions, and the computer program instructions are executed by the processor to implement the method in any one of claims 1-4.
Citation Information
Patent Citations
Method and equipment for transmitting data resources
CN107071826A
Data transmission method and system of client, medium and computing equipment
CN108366112A