A test method and device, a storage medium and a test system

CN117319273BActive Publication Date: 2026-09-25ZHEJIANG UNIVIEW TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210713813.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-22
Publication Date
2026-09-25
Estimated Expiration
2042-06-22

AI Technical Summary

Technical Problem

但是当压力要求达到一定程度时,网络带宽会成为测试瓶颈,此时需要改造网络环境才能进一步满足测试需求

Benefits of technology

[0026]与相关技术相比,本申请包括一种测试方法及装置、存储介质、系统,所述测试方法包括:被测服务器存储测试所需的压力数据;接收外设模拟服务器发送的传输控制协议报文,当所述传输控制协议报文携带预设指示信息时,所述传输控制协议报文未携带有效数据,从存储的所述测试所需的压力数据中读取压力数据,填充到所述传输控制协议报文的数据字段以生成重组的传输控制协议报文,提交所述重组的传输控制协议报文至待测试的业务流程处理程序。本实施例提供的方案,被测服务器接收到的传输控制协议报文携带预设指示信息且无有效数据,被测服务器从本地获取有效数据生成传输控制协议报文,可以以较小的网络带宽实现压力测试。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117319273B_ABST
    Figure CN117319273B_ABST
Patent Text Reader

Abstract

A test method, device and system, and a storage medium, the test method comprising: a server under test storing pressure data required for testing; receiving a transmission control protocol (TCP) message sent by a peripheral device simulation server, when the TCP message carries preset indication information, the TCP message not carrying effective data, reading pressure data from the stored pressure data required for testing according to the preset indication information, filling the data field of the TCP message to generate a recombined TCP message, and submitting the recombined TCP message to a business process processing program to be tested. The scheme provided in the embodiment can realize pressure testing with smaller network bandwidth, because the TCP message received by the server under test carries preset indication information and no effective data, and the server under test obtains effective data from the local to generate a TCP message.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This article relates to testing technologies, and in particular to a testing method and apparatus, storage medium, and testing system. Background Technology

[0002] Currently, storage servers and data forwarding servers face increasingly higher concurrency requirements, posing a challenge for testing: how to effectively stress-test the server (system) under test. When the data volume is relatively small, stress testing can be performed by stacking resources. However, when the stress requirement reaches a certain level, network bandwidth becomes the bottleneck, necessitating modifications to the network environment to further meet testing demands. Summary of the Invention

[0003] This application provides a testing method and apparatus, a storage medium, and a testing system that can save network bandwidth resources.

[0004] This application provides a testing method, including:

[0005] The server under test stores the stress data required for the test.

[0006] The system receives transmission control protocol messages sent by an external simulation server. When the transmission control protocol message carries preset indication information, the transmission control protocol message does not carry valid data. Based on the preset indication information, the system reads pressure data from the stored pressure data required for the test and fills it into the data field of the transmission control protocol message to generate a reconstructed transmission control protocol message. The system then submits the reconstructed transmission control protocol message to the business process processing program to be tested.

[0007] In one exemplary embodiment, the server under test stores the stress data required for the test, including:

[0008] The server under test obtains the raw data required for the test, and initializes the raw data to obtain the stress data required for the test. The initialization process is consistent with the processing of the raw data required for the test by the peripheral simulation server before the stress data required for the test is sent to the server under test by the peripheral simulation server through a transmission control protocol message.

[0009] The pressure data required for the test is sliced ​​and stored according to a preset length, wherein the preset length is less than or equal to the maximum data length supported by the transmission control protocol message.

[0010] In an exemplary embodiment, the stress data required for the test includes at least one of the following: video stream data actually acquired, and data obtained by stitching together a group of frames of different video stream data actually acquired, wherein the group of frames includes a keyframe and multiple reference frames.

[0011] In an exemplary embodiment, the step of the transmission control protocol message carrying preset indication information includes: the reserved field of the transmission control protocol message is non-zero; the value of the reserved field is associated with the type of pressure data;

[0012] The step of reading pressure data from the stored pressure data required for the test includes: reading pressure data from the storage address where the associated pressure data type is located, according to the value of the reserved field.

[0013] In an exemplary embodiment, the step of slicing and storing the pressure data required for the test into slices of a preset length includes: storing pressure data of the same type in the following manner: a data header and a plurality of data units stored after the data header, wherein the data unit includes a unit header and slice data; the data header includes the number of data units; and the unit header includes the slice data length.

[0014] The step of reading pressure data from the storage address where the associated pressure data type is located based on the value of the reserved field includes:

[0015] Read the data header based on the starting address Phead where the associated pressure data type is located, and obtain the number of data units N from the data header;

[0016] Determine the unit header address Pdatahead = Phead + data header length + slice data length * ((n-1)%(N+1)), where the current transmission control protocol message is the nth transmission control protocol message of the current pressure data type;

[0017] Read the unit header according to the unit header address, and obtain the data length Ldata of the current data unit from the unit header;

[0018] Determine the data address Pdata = Pdatahead + cell header length, and start reading data of length Ldata from the data address Pdata.

[0019] This disclosure provides a testing method, including: a peripheral simulation server generating a Transmission Control Protocol (TCP) message, wherein the TCP message carries preset indication information but does not carry valid data, and sending the TCP message to the server under test.

[0020] In an exemplary embodiment, the transmission control protocol message carries preset indication information including: the reserved field of the transmission control protocol message is non-zero, and the value of the reserved field of the transmission control protocol message is associated with the type of pressure data.

[0021] This disclosure provides a testing apparatus, including a memory and a processor. The memory stores a program, which, when read and executed by the processor, implements the testing method described in any of the above embodiments.

[0022] This disclosure provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the testing method described in any of the above embodiments.

[0023] This disclosure provides a testing system, including: an external simulation server and a server under test, wherein:

[0024] The peripheral simulation server is configured to generate a Transmission Control Protocol (TCP) message, which carries preset indication information but does not carry valid data, and send the TCP message to the server under test.

[0025] The server under test is configured to store the stress data required for the test; and to receive transmission control protocol messages sent by the peripheral simulation server. When the transmission control protocol message carries preset indication information, the transmission control protocol message does not carry valid data. According to the preset indication information, the stress data is read from the stored stress data required for the test and filled into the data field of the transmission control protocol message to generate a reconstructed transmission control protocol message. The reconstructed transmission control protocol message is then submitted to the business process processing program to be tested.

[0026] Compared with related technologies, this application includes a testing method and apparatus, a storage medium, and a system. The testing method includes: the server under test storing stress data required for the test; receiving a Transmission Control Protocol (TCP) message sent by an external simulation server; when the TCP message carries preset indication information, the TCP message does not carry valid data; reading stress data from the stored stress data required for the test and filling it into the data field of the TCP message to generate a reconstructed TCP message; and submitting the reconstructed TCP message to the business process processing program to be tested. The solution provided in this embodiment allows the server under test to receive a TCP message carrying preset indication information but without valid data, and the server under test to obtain valid data locally to generate the TCP message, thus achieving stress testing with relatively low network bandwidth.

[0027] Other features and advantages of this application will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the application. Other advantages of this application can be realized and obtained by means of the solutions described in the description and the accompanying drawings. Attached Figure Description

[0028] The accompanying drawings are used to provide an understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.

[0029] Figure 1 A flowchart of a test method (sender end) provided for an exemplary embodiment;

[0030] Figure 2 A schematic diagram of the Transmission Control Protocol message structure provided for an exemplary embodiment;

[0031] Figure 3 A schematic diagram illustrating the Transmission Control Protocol (TCP) message construction process provided for an exemplary embodiment;

[0032] Figure 4 A flowchart of a test method (receiving end) provided for an exemplary embodiment;

[0033] Figure 5 A schematic diagram of pressure data storage provided for an exemplary embodiment;

[0034] Figure 6 A schematic diagram of multiple pressure data storage provided for an exemplary embodiment;

[0035] Figure 7 A schematic diagram of the Transmission Control Protocol (TCP) message stripping process provided as an exemplary embodiment;

[0036] Figure 8 A schematic diagram of a reassembled Transmission Control Protocol (TCP) message provided as an exemplary embodiment;

[0037] Figure 9 A block diagram of a test apparatus provided for an exemplary embodiment;

[0038] Figure 10 A schematic diagram of a test system provided for an exemplary embodiment. Detailed Implementation

[0039] This application describes several embodiments, but these descriptions are exemplary and not restrictive, and it will be apparent to those skilled in the art that many more embodiments and implementations are possible within the scope of the embodiments described herein. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with, or may replace, any feature or element of any other embodiment.

[0040] This application includes and contemplates combinations of features and elements known to those skilled in the art. The embodiments, features, and elements disclosed in this application may also be combined with any conventional features or elements to form a unique inventive scheme as defined by the claims. Any feature or element of any embodiment may also be combined with features or elements from other inventive schemes to form another unique inventive scheme as defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in this application may be implemented individually or in any suitable combination. Therefore, the embodiments are not limited except by the limitations imposed by the appended claims and their equivalents. Furthermore, various modifications and changes may be made within the scope of the appended claims.

[0041] Furthermore, in describing representative embodiments, the specification may have presented methods and / or processes as a specific sequence of steps. However, the method or process should not be limited to the specific order of steps described herein, to the extent that the method or process does not depend on the specific order of steps described herein. As will be understood by those skilled in the art, other sequences of steps are also possible. Therefore, the specific order of steps set forth in the specification should not be construed as a limitation of the claims. Moreover, the claims for the method and / or process should not be limited to performing the steps in the written order; those skilled in the art will readily understand that these orders can be varied and still remain within the spirit and scope of the embodiments of this application. This disclosure proposes a testing method in which the required stress data to be transmitted is pre-processed, segmented, and stored in the server under test. An external simulation server constructs Transmission Control Protocol (TCP) messages without carrying valid data. When the TCP message is sent to the server under test, the server under test detects the TCP message, fills the TCP message with the pre-stored data, generates a reassembled TCP message, and then provides the reassembled TCP message as a normal TCP message to the business process processing program under test, thereby achieving stress testing. The solution provided in this embodiment only requires the transmission of TCP headers between the peripheral simulation server and the server under test, without the need to transmit valid data. This can save data transmission bandwidth, greatly improve bandwidth utilization, and enable high-stress testing with relatively small bandwidth.

[0042] Figure 1 This is a flowchart of a testing method provided in an embodiment of this disclosure. This embodiment describes the operation of the sending end of the test. Figure 1 As shown, the test method provided in this embodiment includes:

[0043] Step 101: The peripheral simulation server generates a transmission control protocol message, which carries preset indication information but does not carry valid data.

[0044] Step 102: The peripheral simulation server sends the Transmission Control Protocol (TCP) message to the server under test.

[0045] The solution provided in this embodiment saves network bandwidth by not carrying valid data when the peripheral simulation server sends Transmission Control Protocol (TCP) messages.

[0046] In one exemplary embodiment, the valid data refers to actual business data, such as video stream data, audio stream data, image stream data, etc.

[0047] The peripheral simulation server is used to simulate real devices and interact with the server under test via signaling to perform the test. The server under test is a set of servers that need to be subjected to high-stress flow testing; this set can contain one or more servers.

[0048] In one exemplary embodiment, the peripheral simulation server can send the aforementioned Transmission Control Protocol (TCP) message carrying preset indication information but without valid data when it needs to send a data stream (such as a video stream) that requires a large bandwidth. The large bandwidth can be a bandwidth greater than or equal to a preset value. The peripheral simulation server can also send a TCP message without the aforementioned preset indication information but carrying valid data when it needs to send a data stream with a bandwidth less than the preset value; that is, it can send a regular TCP message.

[0049] In an exemplary embodiment, the transmission control protocol (TCP) message carrying preset indication information includes: the reserved field of the TCP message being non-zero. In a conventional TCP message, a reserved field is provided and its value is 0; therefore, preset indication information can be carried by setting the reserved field to non-zero. However, this embodiment is not limited to this; a new field can be used to carry the preset indication information. In a conventional TCP message, the reserved field is 0; when the reserved field is non-zero, it indicates that preset indication information is being carried.

[0050] In this embodiment, the network card driver source code of the peripheral simulation server is modified.

[0051] The standard TCP packet structure is as follows: Figure 2 As shown, the header includes the following fields: a 16-bit source port number field, a 16-bit destination port number field, a 32-bit sequence number field, a 32-bit acknowledgment number field, a 4-bit header length field, a 3-bit reserved field, NON (nonce), CWR (Congestion Window Reduce), ECE (ECN-Echo), URG (URGENT POINTER), ACK (ACKNOWLEDGEMENT), PSH (PUSH), RST (Reset), SYN (Synchronize) and FIN (Finish) flags, a 16-bit window size field, a 16-bit checksum field, a 16-bit urgent pointer field, an options field, and a data field. The data field carries the valid data. In a regular TCP packet, the reserved field has a value of 0 (000 in binary). In this embodiment, the reserved field has a non-zero value.

[0052] The construction process of a TCP packet is as follows: Figure 3As shown. Throughout the construction process, the protocol header is added layer by layer. The kernel network processing module of the peripheral simulation server creates a data packet containing the data to be transmitted. This data packet is a structure named sk_buff. Then, sk_buff is passed to the next layer. Each layer adds different protocol headers to sk_buff until it is handed over to the network device for transmission. Specifically, the TCP protocol header, IP (Internet Protocol) protocol header, and MAC (Media Access Control) protocol header are added in sequence. The sk_buff structure includes: a head pointer (unsigned char*head), a data start pointer (unsigned char*data), a data end pointer (unsigned char*tail), and an end pointer (unsigned char*end), all of which are unsigned byte variables.

[0053] In one exemplary implementation, a TCP header modification interface is added to the network card driver source code of the peripheral simulation server. This interface is used to clear valid data in the TCP packet and modify the reserved field. Modifying the reserved field means changing it to a non-zero value. The TCP packet construction process is changed from the original "add TCP header --> add IP header --> add MAC header" to the following new process: "add TCP header --> modify TCP header --> add IP header --> add MAC header". The TCP header modification interface can be set to not be called by default, and the new process can be used when needed, thus maintaining compatibility with the conventional TCP packet construction process.

[0054] In this embodiment, the reserved field is 3 bits. In another exemplary embodiment, the reserved field can be 4 bits, in which case the NON flag may not be included in the TCP packet.

[0055] In an exemplary embodiment, the reserved field value of the transmission control protocol message can be associated with the type of pressure data. That is, it is associated with the type of pressure data to be sent, and different types of pressure data can correspond to different values. Table 1 is an association information table of reserved field values ​​and pressure data types provided in an exemplary embodiment. As shown in Table 1, when the reserved field values ​​are 001, 010, and 011, they are associated with pressure data 1, pressure data 2, and pressure data 3, respectively. This table can be stored on the server under test and the peripheral simulation server. Table 1 is only an example; the reserved field can also be 100, 101, 110, and 111, respectively, and associated with different types of pressure data. That is, when the reserved field has 3 bits, it can indicate 7 types of pressure data. However, the embodiments of this disclosure are not limited to this; when the reserved field has 4 bits, it can indicate 15 types of pressure data. In another exemplary implementation, the reserved field may not indicate the type of stress data, meaning only one type of stress data is supported. In this case, the value of the reserved field can be any one or more of 001, 010, 011, 100, 101, 110, and 111. That is, as long as the reserved field is not 0, it indicates the supported type of stress data. When calling the TCP header modification interface to change the value of the reserved field, the reserved field is modified to the value associated with the required type of stress data to be sent. For example, if stress data 1 needs to be sent, the reserved field is modified to 001. After receiving the data, the server under test can determine that it needs to read stress data 1 based on the value 001 of the reserved field.

[0056] Table 1. Information on the association between reserved fields and data types

[0057] 001 Pressure data 1 010 Stress Data 2 011 Stress data 3 … …

[0058] Figure 4 This is a flowchart of a test method provided in an embodiment of this disclosure. This embodiment describes the operation of the receiving end during testing. Figure 4 As shown, the test method provided in this embodiment includes:

[0059] Step 401: The server under test stores the stress data required for the test;

[0060] Step 402: The server under test receives a transmission control protocol message sent by the peripheral simulation server. When the transmission control protocol message carries preset indication information, the transmission control protocol message does not carry valid data. According to the preset indication information, the pressure data is read from the stored pressure data required for the test and filled into the data field of the transmission control protocol message to generate a reconstructed transmission control protocol message.

[0061] Step 403: The server under test submits the reconstructed Transmission Control Protocol (TCP) message to the business process processing program to be tested.

[0062] The solution provided in this embodiment is that the Transmission Control Protocol (TCP) message received by the server under test carries preset indication information but has no valid data. The server under test obtains valid data from the local machine to generate the TCP message, which can achieve stress testing with a small network bandwidth.

[0063] In one exemplary embodiment, the stress data is data used to test the business processes of the server under test, and may include data on which encryption, unencryption, encoding, and other operations are performed on video (audio) streams, image streams, etc.

[0064] In one exemplary embodiment, the transmission control protocol message does not carry valid data. This could be because the sending end does not load valid data into the transmission control protocol message, or the transmission control protocol message carries valid data, but the receiving end does not receive the valid data when receiving it.

[0065] In one exemplary embodiment, step 401, where the server under test stores the stress data required for the test, may include:

[0066] The server under test obtains the raw data required for the test, and initializes the raw data to obtain the stress data required for the test. The initialization process is consistent with the processing of the raw data required for the test by the peripheral simulation server before the stress data required for the test is sent to the server under test by the peripheral simulation server through a transmission control protocol message.

[0067] The pressure data required for the test is sliced ​​and stored according to a preset length, wherein the preset length is less than or equal to the maximum data length supported by the transmission control protocol message.

[0068] That is, if the stress data is sent directly from the peripheral simulation server to the server under test, the peripheral simulation server performs the same processing and initialization processing on the data before sending the stress data. In this embodiment, the stress data is not sent from the peripheral simulation server to the server under test, but the server under test still performs the same processing on the original data as the peripheral simulation server, maintaining consistency with the operation of the data sending end in the conventional process (that is, in the conventional test method, the peripheral simulation server directly performs initialization processing on the original data to obtain the stress data and then sends the stress data).

[0069] In an exemplary embodiment, the stress data required for the test includes at least one of the following: video stream data actually acquired, data obtained by stitching together a group of frames from different video streams actually acquired, wherein the group of frames includes a keyframe and multiple reference frames. The keyframe can be an I-frame, the reference frames can be B-frames or P-frames, and the group of frames can include one I-frame, multiple B-frames and multiple P-frames, or one I-frame or multiple P-frames, etc. That is, in this embodiment, a new video stream is obtained by stitching together groups of frames from different video streams as test data. For example, the even-numbered frames of the first video stream and the even-numbered frames of the second video stream are swapped to obtain a third video stream and a fourth video stream, thereby obtaining four sets of test data. This is just an example, and new video streams can be obtained by stitching together the data arbitrarily. The solution provided in this embodiment can obtain a large amount of different data by stitching together the data, which can avoid the influence of duplicate data on the test results. For example, when the server under test receives the same data, the processing speed will be faster because the data has already been cached, which is inconsistent with the actual situation and thus leads to inaccurate test results. In this embodiment, by splicing the test data to make them different, the actual operating conditions can be better simulated, and the test results are more accurate.

[0070] In one exemplary embodiment, when the length of the remaining data is less than the preset length, the remaining data is directly used as the last slice data. That is, the lengths of the slice data before the last slice data are all preset lengths, and the length of the last slice data is the actual length of the remaining data. However, this embodiment is not limited to this, and the pressure data can be sliced ​​in other ways.

[0071] In one exemplary embodiment, the initialization process may include, but is not limited to, at least one of the following: encryption, decryption, encoding, decoding, etc.

[0072] In one exemplary embodiment, the stress data required for the test stored on the server under test may include one or more types of stress data.

[0073] In one exemplary embodiment, the server under test can obtain the raw data required for the test from an external data source server.

[0074] In an exemplary embodiment, storing the pressure data required for the test after slicing it into segments of a preset length includes:

[0075] Pressure data of the same type is stored as follows: a data header and multiple data units stored after the data header, wherein each data unit includes a unit header and slice data; the data header includes the number of data units; and the unit header includes the slice data length.

[0076] Figure 5This is a schematic diagram illustrating the storage of pressure data as provided in an exemplary embodiment. In this embodiment, the pressure data is sliced ​​to obtain sliced ​​data, and the sliced ​​data is arranged according to... Figure 5 The data is stored in shared memory. Figure 5 As shown, it includes: a data header and multiple data units, where each data unit includes a unit header and sliced ​​data, wherein:

[0077] The data header may include: the stored pressure data type (which can be 2 bytes), the shared memory data length (which can be 4 bytes), and the number of data units (which can be 4 bytes). The shared memory data length is the total length of the data header and the multiple data units.

[0078] The unit header may include: slice data sequence number (which can be 4 bytes) and slice data length (which can be 2 bytes). The slice data length is the length of the slice data of the data unit to which this unit header belongs.

[0079] Sliced ​​data: Sliced ​​stress data (the maximum length of valid data in a TCP packet is 1448 bytes, and the length of the sliced ​​data is no greater than this value).

[0080] The lengths of the fields in the above embodiments are merely examples, and the embodiments disclosed herein are not limited thereto.

[0081] Figure 5 The diagram illustrates a storage structure for pressure data. When multiple pressure data types exist, each type is sliced, and the sliced ​​data is then ordered according to... Figure 5 The storage method shown is used to store the data, resulting in the following: Figure 6 The data structure shown. For example... Figure 6 As shown, this embodiment includes three types of pressure data: pressure data 1, pressure data 2, and pressure data 3.

[0082] The stress data 1 includes a first data header and multiple data units. The first data header includes stress data type information (stress data 1), shared memory data length, and the number of data units in stress data 1.

[0083] The stress data 2 includes a second data header and multiple data units; the second data header includes stress data type information (stress data 2), shared memory data length, and the number of data units in stress data 2;

[0084] The stress data 3 includes a third data header and multiple data units. The third data header includes stress data type information (stress data 3), the length of the shared memory data, and the number of data units in stress data 3.

[0085] Each data unit includes a unit header and slice data.

[0086] The aforementioned stress data can be stored in a preset directory of the server under test, and the starting address of each stress data point can be recorded.

[0087] The data types of stress can be defined by the user. For example, one video stream can be used as stress data 1, another video stream as stress data 2, an audio stream as stress data 3, and so on.

[0088] In the standard procedure, after the network card of the server under test receives the TCP packet, it follows the... Figure 7 Data extraction is performed as shown. Figure 7 As shown, the protocol headers contained in the sk_buff structure of the TCP packet are stripped layer by layer, that is, the MAC protocol header, IP protocol header, and TCP protocol header are stripped in sequence. Finally, the valid data is extracted and used by the processing programs of the relevant business processes, such as the data processing (storage, forwarding, etc.) programs running on the server under test.

[0089] In this embodiment, the network card driver of the server under test is modified to add an additional processing interface, namely a packet reassembly interface. When the network card driver strips the TCP header, it identifies the reserved field in the TCP header. If the reserved field value is 0, no processing is performed, and the normal process continues; if the reserved field value is not 0, the received specially constructed TCP packet does not contain valid data, such as... Figure 7 As shown, the packet reassembly interface of the network card driver is called at this time to reassemble the packet.

[0090] In one exemplary embodiment, reading pressure data from the stored pressure data required for the test includes: reading pressure data from the storage address where the associated pressure data type is located, based on the value of the reserved field.

[0091] In an exemplary embodiment, reading pressure data from the storage address where the associated pressure data type is located based on the value of the reserved field includes:

[0092] Read the data header based on the starting address Phead where the associated pressure data type is located, and obtain the number of data units N from the data header;

[0093] Determine the unit header address Pdatahead = Phead + data header length + slice data length * (n % (N+1)), where n represents the nth transmission control protocol message of the current type of pressure data; and the slice data length is the preset length mentioned above when slicing the slice data with a preset length.

[0094] Read the unit header according to the unit header address, and obtain the data length Ldata of the current data unit from the unit header;

[0095] Determine the data address Pdata = Pdatahead + unit header length, and start reading data of length Ldata from the data address Pdata, which is the pressure data required for reorganization.

[0096] Taking a reserved field value of 001 and a slice data length of 1448 as an example, the network card driver recognizes a reserved field value of 001 and, according to Table 1, reads the shared memory segment where stress data 1 is located. Assuming the received TCP data transmission packet is the nth data transmission packet, and the starting address of the shared memory segment where stress data 1 is located is Phead, then:

[0097] Read the data header to obtain the number of data units: N;

[0098] Determine the cell header address: Pdatahead = Phead + 10 + 1448 * ((n-1) % (N+1)). By using n % (N+1), we can ensure that when the data cells in memory are exhausted, the cell data can be read from the beginning again as needed.

[0099] The data length, Ldata, is obtained by reading the cell header from the cell header address.

[0100] Determine the data address: Pdata = Pdatahead + cell header length (6 in this embodiment).

[0101] Then, space is allocated to the `data` pointer in the `sk_buff` structure, and data of length `Ldata` from `Pdata` is copied to the space pointed to by `data`. Next, other relevant fields in the `sk_buff` structure are modified, such as the buffer data length, thus completing the TCP packet reassembly. The reassembled TCP packet is as follows: Figure 8 As shown, the reassembled TCP packet carries valid data. The reassembled TCP packet is submitted to the business process processing program to be tested to achieve the test.

[0102] like Figure 9 As shown, this embodiment of the present disclosure provides a testing device 90, including a memory 910 and a processor 920. The memory 910 stores a program, which, when read and executed by the processor 920, implements the testing method described in any of the above embodiments.

[0103] This disclosure provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the testing method described in any of the above embodiments.

[0104] like Figure 10 As shown, this disclosure provides a testing system, including: a peripheral simulation server and a server under test, wherein:

[0105] The peripheral simulation server is configured to generate a Transmission Control Protocol (TCP) message, which carries preset indication information but does not carry valid data, and send the TCP message to the server under test.

[0106] The server under test is configured to store the stress data required for the test; and to receive transmission control protocol messages sent by the peripheral simulation server. When the transmission control protocol message carries preset indication information, the transmission control protocol message does not carry valid data. According to the preset indication information, the stress data is read from the stored stress data required for the test and filled into the data field of the transmission control protocol message to generate a reconstructed transmission control protocol message. The reconstructed transmission control protocol message is then submitted to the business process processing program to be tested.

[0107] The testing system provided in this embodiment allows the peripheral simulation server to perform tests without sending valid data, saving network bandwidth. It can simulate high-stress scenarios with fewer materials and equipment, reducing the setup and preparation time for the test environment. Furthermore, when using the same type of server (including the peripheral simulation server and the server under test), the modified network card driver (supporting the processing of TCP packets provided in this embodiment) can be reused without requiring changes to the server. Additionally, the solution provided in this embodiment only requires modifying the values ​​of reserved fields to support stress testing of multiple data types, with low latency and virtually seamless switching.

[0108] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

Claims

1. A testing method, characterized in that, include: The server under test stores the stress data required for the test. The system receives a Transmission Control Protocol (TCP) message sent by an external simulation server. When the TCP message carries preset indication information, the TCP message does not carry valid data. The system reads pressure data from the stored pressure data required for the test according to the preset indication information and fills it into the data field of the TCP message to generate a reconstructed TCP message. The system then submits the reconstructed TCP message to the business process processing program to be tested. Wherein, when the transmission control protocol message carries preset indication information, it includes: the reserved field of the transmission control protocol message is set to a non-zero value as preset indication information; the value of the reserved field is associated with the type of pressure data; The step of reading pressure data from the stored pressure data required for the test includes: reading pressure data from the storage address where the associated pressure data type is located, according to the value of the reserved field.

2. The test method according to claim 1, characterized in that, The server under test stores the stress data required for the test, including: The server under test obtains the raw data required for the test, and initializes the raw data to obtain the stress data required for the test. The initialization process is consistent with the processing of the raw data required for the test by the peripheral simulation server before the stress data required for the test is sent to the server under test by the peripheral simulation server through a transmission control protocol message. The pressure data required for the test is sliced ​​and stored according to a preset length, wherein the preset length is less than or equal to the maximum data length supported by the transmission control protocol message.

3. The test method according to claim 2, characterized in that, The stress data required for the test includes at least one of the following: video stream data actually collected, or data obtained by stitching together a group of frames of different video stream data actually collected, wherein the group of frames includes a keyframe and multiple reference frames.

4. The test method according to claim 1, characterized in that, The step of slicing and storing the pressure data required for the test into slices of a preset length includes: storing pressure data of the same type in the following manner: a data header and multiple data units stored after the data header, wherein each data unit includes a unit header and slice data; the data header includes the number of data units; and the unit header includes the slice data length. The step of reading pressure data from the storage address where the associated pressure data type is located based on the value of the reserved field includes: Read the data header based on the starting address Phead where the associated pressure data type is located, and obtain the number of data units N from the data header; Determine the cell header address: Pdatahead = Phead + data header length + slice data length ((n-1)%(N+1)), where the current Transmission Control Protocol (TCP) message is the nth TCP message of the current pressure data type; Read the unit header according to the unit header address, and obtain the data length Ldata of the current data unit from the unit header; Determine the data address Pdata = Pdatahead + cell header length, and start reading data of length Ldata from the data address Pdata.

5. A testing method, characterized in that, include: The peripheral simulation server generates a Transmission Control Protocol (TCP) message. The TCP message carries preset indication information but does not carry valid data. The TCP message is sent to the server under test, so that the server under test reads the pressure data from the stored pressure data required for the test according to the preset indication information, fills the data field of the TCP message to generate a reconstructed TCP message, and submits the reconstructed TCP message to the business process processing program to be tested. The transmission control protocol message carries preset indication information, including: the reserved field of the transmission control protocol message is set to a non-zero value as preset indication information, and the value of the reserved field of the transmission control protocol message is associated with the type of pressure data; The server under test reads pressure data from the stored pressure data required for the test by: reading pressure data from the storage address where the associated pressure data type is located according to the value of the reserved field.

6. A testing apparatus, characterized in that, It includes a memory and a processor, the memory storing a program that, when read and executed by the processor, implements the test method as described in any one of claims 1 to 5.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the test method as described in any one of claims 1 to 5.

8. A testing system, characterized in that, include: The peripheral simulation server and the server under test, wherein: The peripheral simulation server is configured to generate a Transmission Control Protocol (TCP) message, which carries preset indication information but does not carry valid data, and send the TCP message to the server under test. The server under test is configured to store the stress data required for the test; and to receive transmission control protocol messages sent by the peripheral simulation server. When the transmission control protocol message carries preset indication information, the transmission control protocol message does not carry valid data. According to the preset indication information, the stress data is read from the stored stress data required for the test and filled into the data field of the transmission control protocol message to generate a reconstructed transmission control protocol message. The reconstructed transmission control protocol message is then submitted to the business process processing program to be tested. The transmission control protocol message carries preset indication information, including: the reserved field of the transmission control protocol message is set to a non-zero value as preset indication information, and the value of the reserved field of the transmission control protocol message is associated with the type of pressure data; The server under test reads pressure data from the stored pressure data required for the test by: reading pressure data from the storage address where the associated pressure data type is located according to the value of the reserved field.

Citation Information

Patent Citations

  • Zero-copy mode based TCP / IP messaging method and device

    CN101707590A