Data packet processing method and device

By dealing with the problem of packet length changes in the management system under the C/S architecture, and by calculating and determining the packet length, the script error problem caused by the change in the packet length during concurrent tests is solved, the stability of the packet length is achieved, and the normal operation of the script is ensured.

CN114238118BActive Publication Date: 2025-06-06CAXA TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111556730.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-17
Publication Date
2025-06-06
Estimated Expiration
2041-12-17

AI Technical Summary

Technical Problem

In the management system under the C/S architecture, when concurrent testing is performed, the value of the key field in the data packet continues to grow, causing the packet length to change, which in turn causes the problem of script errors.

Method used

By running the target script in the management system under the C/S architecture, the data packet returned by the target server and the length of its key fields is determined. Add this length to the packet length of the target script to obtain the target length. Then, the length and packet header of the data request packet to be sent by the client are processed according to the target length to ensure that the length of the data request packet remains unchanged.

Benefits of technology

It effectively solves the problem of script error reporting caused by changes in packet length, ensuring that when concurrent testing is performed in the management system under the C/S architecture, the packet length is stable and the script runs without error reporting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114238118B_ABST
    Figure CN114238118B_ABST
Patent Text Reader

Abstract

The present application discloses a data packet processing method and device. The method comprises: running a target script in a management system under a C / S architecture, triggering a data request to a target server through a client; receiving a data packet returned to the client by the target server in response to the data request, and determining the length of a key field in the data packet returned to the client by the target server; adding the length of the key field in the data packet returned to the client by the target server to the length of the data packet of the target script to obtain a target length; processing the length and header of the data request packet to be sent to the target server by the client according to the target length to obtain a processed data request packet; and sending the processed data request packet to the target server. The method solves the problem in the related art that in a management system under a C / S architecture, when concurrent testing is performed, the value of the key field in the data packet continues to increase, so that the length of the data packet changes, causing the script to report an error.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data information processing, and in particular to a method and device for processing a data packet. Background Art

[0002] At present, many companies will perform performance testing on their products in order to ensure the performance quality of the released products. Therefore, in the IT industry, product performance testing and optimization are becoming more and more important in the industry. The purpose of performance testing is to verify whether the software system can achieve performance indicators and to find performance bottlenecks in the software system. In addition, the above-mentioned product can be a PLM system, which can be a file management system. When using this system, since there may be multiple users downloading or uploading files at the same time, it is necessary to use a script to perform concurrent performance testing on this system to ensure the performance quality of this product. When performing performance testing on a management system in a client / server (C / S) architecture, sometimes in order to simulate the stability of the program, it is necessary to perform cyclic iterative stress testing. However, when the script is run in a loop for a long time, or the script has a very large number of requests at one time, the field value in the database table will continue to grow, thereby changing the number of digits of the field value. That is, the number of digits of the field value in the data packet has changed, that is, the length of the data packet has changed, which will cause the script to report an error.

[0003] In the current related technologies, when the performance test of the management system under the C / S architecture is performed by running the script in a long loop, the association method is usually adopted. Moreover, the current stress testing tools such as LoadRunner, Jmeter, PerformanceRunner, etc. generally process the operation package and the data package separately, and associate the operation package with the data package at the same time, and the data package has a header and a packet size. Because the key field value in the database table, that is, the source of the field value in the data package is returned by the front-end script request, it is generally associated with it, and the field value is obtained after being associated and then passed to the subsequent request for use. For example, when the performance test of the PLM system under the C / S architecture is performed, the field value Obj_ID when uploading the file in the system, the script recorded at the beginning is the four-digit 4039. When the script is run for a long time and multiple files are stored in and out of the warehouse at one time, assuming 1000 iterations, the number of digits of the field value Obj_ID will become the five-digit 10000 or the six-digit 100000, etc. At this time, after our script sends the request, it will return 0 bytes and the script will report an error. The reason is that when we record the script, the Obj_ID is a four-digit number. Because the source of Obj_ID is returned by the front-end script request, we associate it, associate Obj_ID, and pass it to the subsequent request for use. This seems to have completed the script modification, but when the script runs for a while, the value becomes a five-digit number. At this time, after we associate it, when we continue to pass it to the subsequent request for use, the actual request data length will be 1 bit longer than the buf length during recording, which will cause the server to return 0 bytes after the request is sent, resulting in a script error. Therefore, when using this method, it is necessary to limit the concurrency or the number of iterations, and at the same time, it is necessary to meet the requirement that the number of Obj_ID bits remains unchanged, that is, it is necessary to meet the requirement that the length of the data packet remains unchanged. Otherwise, when the number of Obj_ID bits changes, the length and header size of the subsequent request packet are still the same as the original Obj_ID bits, which will cause the script to report an error.

[0004] In the related art, in a management system under a C / S architecture, when concurrent testing is performed, the key field value in the data packet continues to grow, so that the length of the data packet changes, causing the script to report an error. No effective solution has been proposed yet. Summary of the invention

[0005] The main purpose of the present application is to provide a method and device for processing a data packet to solve the problem in the related art that in a management system under a C / S architecture, when concurrent testing is performed, the key field value in the data packet continues to grow, thereby changing the length of the data packet and causing a script error.

[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for processing a data packet is provided. The method comprises: running a target script in a management system under a C / S architecture, triggering a data request to a target server through a client, wherein the target script is used to perform a concurrent performance test on the management system under the C / S architecture; receiving a data packet returned to the client by the target server in response to the data request, and determining the length of a key field in the data packet returned to the client by the target server; adding the length of the key field in the data packet returned to the client by the target server to the length of the data packet of the target script to obtain a target length; processing the length and header of the data request packet to be sent by the client to the target server according to the target length to obtain a processed data request packet, wherein the data request packet carries a data request instruction; and sending the processed data request packet to the target server.

[0007] Furthermore, the length and header of the data request packet to be sent by the client to the target server are processed according to the target length, and the processed data request packet includes: determining the length and header of the request packet to be sent by the client to the target server according to the target length; replacing the length and header of the data packet returned to the client with the length and header of the request packet to be sent by the client to the target server, to obtain the processed data request packet.

[0008] Furthermore, according to the target length, determining the length and header of the request packet to be sent by the client to the target server includes: obtaining the header length of the request packet to be sent by the client to the target server according to the target length; and determining the length and header of the request packet to be sent by the client to the target server according to a preset rule and the header length of the request packet to be sent by the client to the target server.

[0009] Furthermore, determining the length of the key field in the data packet returned by the target server to the client includes: determining the number of bits of the key field in the data packet returned by the target server to the client; and determining the length of the key field in the data packet returned by the target server to the client based on the number of bits of the key field.

[0010] Furthermore, before adding the length of the key field in the data packet returned by the target server to the client to the length of the data packet of the target script to obtain the target length, the method also includes: determining the number of bits of preset field two in the data packet of the target script; and determining the length of the data packet of the target script based on the number of bits of the preset field two.

[0011] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a data packet processing device is provided. The device comprises: a first processing unit, which is used to run a target script in a management system under a C / S architecture, and trigger a data request to a target server through a client, wherein the target script is used to perform a concurrent performance test on the management system under the C / S architecture; a second processing unit, which is used to receive a data packet returned to the client by the target server in response to the data request, and determine the length of a key field in the data packet returned to the client by the target server; a first adding unit, which is used to add the length of the key field in the data packet returned to the client by the target server to the length of the data packet of the target script, to obtain a target length; a third processing unit, which is used to process the length and header of the data request packet to be sent by the client to the target server according to the target length, to obtain a processed data request packet, wherein the data request packet carries a data request instruction; and a first sending unit, which is used to send the processed data request packet to the target server.

[0012] Furthermore, the third processing unit includes: a first determination module, used to determine the length and header of the request packet to be sent by the client to the target server according to the target length; a first replacement module, used to replace the length and header of the data packet returned to the client with the length and header of the request packet to be sent by the client to the target server, so as to obtain a processed data request packet.

[0013] Furthermore, the first determination module includes: a first processing submodule, used to obtain the header length of the request packet to be sent by the client to the target server according to the target length; a first determination submodule, used to determine the length and header of the request packet to be sent by the client to the target server according to a preset rule and the header length of the request packet to be sent by the client to the target server.

[0014] Furthermore, the second processing unit includes: a second determination module, used to determine the number of bits of the key field in the data packet returned by the target server to the client; and a third determination module, used to determine the length of the key field in the data packet returned by the target server to the client based on the number of bits of the key field.

[0015] Furthermore, the device also includes: a first determination unit, used to determine the number of bits of preset field two in the data packet of the target script before adding the length of the key field in the data packet returned by the target server to the client to the length of the data packet of the target script to obtain the target length; a second determination unit, used to determine the length of the data packet of the target script based on the number of bits of the preset field two.

[0016] In order to achieve the above objective, according to another aspect of the present application, a processor is provided, wherein the processor is used to run a program, wherein the program executes any one of the above-mentioned methods for processing data packets when running.

[0017] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a storage medium is provided, wherein the storage medium includes a stored program, wherein the program executes any one of the above-mentioned methods for processing a data packet.

[0018] Through the present application, the following steps are adopted: running a target script in a management system under a C / S architecture, triggering a data request to a target server through a client, wherein the target script is used to perform a concurrent performance test on the management system under the C / S architecture; receiving a data packet returned to the client by the target server in response to the data request, and determining the length of a key field in the data packet returned to the client by the target server; adding the length of the key field in the data packet returned to the client by the target server to the length of the data packet of the target script to obtain a target length; processing the length and header of a data request packet to be sent by the client to the target server according to the target length to obtain a processed data request packet, wherein the data request packet carries a data request instruction; sending the processed data request packet to the target server, thereby solving the problem in the related art that in a management system under a C / S architecture, when concurrent testing is performed, the value of a key field in a data packet continues to increase, thereby causing a script error after the length of the data packet changes. By processing the length and packet header of the data request packet to be sent by the client to the target server according to the length obtained by adding the length of the key field in the data packet returned by the target server to the length of the data packet of the target script, and sending the processed data request packet to the target server, it is ensured that in the management system under the C / S architecture, when concurrent testing is performed, the key field value in the data packet continues to increase, so that the script does not report an error after the length of the data packet changes. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0020] Figure 1 is a flowchart of a method for processing a data packet provided in an embodiment of the present application;

[0021] Figure 2 is a flowchart of an optional data packet processing method provided according to an embodiment of the present application;

[0022] Figure 3It is a schematic diagram of a data packet processing device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] The present invention is described below in conjunction with preferred implementation steps. Figure 1 is a flowchart of a method for processing a data packet provided in an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:

[0027] Step S101, running a target script in a management system under a C / S architecture, triggering a data request to a target server through a client, wherein the target script is used to perform a concurrent performance test on the management system under the C / S architecture.

[0028] For example, when a script is run in a management system under a client / server (C / S) architecture, a client sends a request to a server, requesting the server to send a data packet to the client. Furthermore, the script is used to perform concurrent performance testing on the management system under the C / S architecture.

[0029] Step S102, receiving a data packet returned by the target server to the client in response to the data request, and determining the length of a key field in the data packet returned by the target server to the client.

[0030] For example, the server responds to the client's request and returns a data packet to the client, and at the same time determines the length of the key field in the data packet returned by the server to the client.

[0031] Step S103, adding the length of the key field in the data packet returned by the target server to the client and the length of the data packet of the target script to obtain the target length.

[0032] For example, the target length may be the length of buf, buflength. Therefore, the length of the key field in the data packet returned by the server to the client is added to the length of the data packet of the script to obtain the length of buf.

[0033] Step S104, processing the length and header of the data request packet to be sent by the client to the target server according to the target length to obtain a processed data request packet, wherein the data request packet carries a data request instruction.

[0034] For example, the length and header of the data request packet to be sent from the client to the server are processed according to the length buflength to obtain a processed data request packet. Moreover, the above data request packet carries a data request instruction.

[0035] Step S105, sending the processed data request packet to the target server.

[0036] For example, the client sends the processed data request packet to the target server.

[0037] Through the above steps S101 to S105, the length and header of the data request packet to be sent by the client to the target server are processed according to the length obtained by adding the length of the key field in the data packet returned by the target server to the length of the data packet of the target script, and the processed data request packet is sent to the target server, thereby ensuring that in the management system under the C / S architecture, when concurrent testing is performed, the value of the key field in the data packet continues to increase, so that the script does not report an error after the length of the data packet changes.

[0038] Optionally, in the data packet processing method provided in an embodiment of the present application, the length and header of the data request packet to be sent by the client to the target server are processed according to the target length, and the processed data request packet includes: determining the length and header of the request packet to be sent by the client to the target server according to the target length; replacing the length and header of the data packet returned to the client with the length and header of the request packet to be sent by the client to the target server, to obtain the processed data request packet.

[0039] For example, based on the length buflength of buf, the length and header of the data request packet to be sent by the client to the server are determined, and the length and header of the data packet returned to the client are replaced with the length and header of the request packet to be sent by the client to the server, thereby obtaining a processed data request packet.

[0040] In summary, by replacing the length and header of the data packet returned to the client with the length and header of the request packet to be sent by the client to the server, the processed data request packet can be accurately obtained.

[0041] Optionally, in the data packet processing method provided in an embodiment of the present application, determining the length and header of the request packet to be sent by the client to the target server according to the target length includes: obtaining the header length of the request packet to be sent by the client to the target server according to the target length; determining the length and header of the request packet to be sent by the client to the target server according to a preset rule and the header length of the request packet to be sent by the client to the target server.

[0042] For example, the length of the header of the request packet to be sent by the client to the server is determined according to the length of the header of the request packet to be sent by the client to the target server and the preset rules, and the length and header of the request packet to be sent by the client to the target server are determined.

[0043] In summary, the length and header of the request packet to be sent by the client to the target server can be accurately obtained through the header length of the request packet to be sent by the client to the server and the preset rule.

[0044] Optionally, in the data packet processing method provided in an embodiment of the present application, determining the length of the key field in the data packet returned by the target server to the client includes: determining the number of bits of the key field in the data packet returned by the target server to the client; and determining the length of the key field in the data packet returned by the target server to the client based on the number of bits of the key field.

[0045] For example, determine the number of bits of the key field in the data packet returned by the server to the client; based on the number of bits of the key field, determine the length of the key field in the data packet returned by the server to the client.

[0046] Through the above solution, the length of the key field in the data packet can be quickly and accurately obtained from the number of bits of the key field in the data packet.

[0047] Optionally, in the data packet processing method provided in an embodiment of the present application, before adding the length of the key field in the data packet returned by the target server to the client to the length of the data packet of the target script to obtain the target length, the method also includes: determining the number of bits of preset field two in the data packet of the target script; and determining the length of the data packet of the target script based on the number of bits of preset field two.

[0048] For example, before adding the length of the key field in the data packet returned by the server to the length of the script data packet to obtain the length of buf, buflength, it is necessary to use a performance testing tool to record, write and adjust the script, and then determine the number of bits of the field in the script data packet. Based on the number of bits of the field, determine the length of the script data packet.

[0049] Through the above scheme, the length of the script data packet can be quickly and accurately obtained from the number of bits of the fields in the script data packet.

[0050] A flowchart of an optional data packet processing method, such as Figure 2 As shown. Taking Obj_ID in the database table, Obj_ID will cause the field value to increase continuously during concurrency and iteration, which will cause the length of the data packet to change as an example. The specific steps are as follows: (1) Use performance testing tools to record, write, and adjust scripts. When running this script in a management system under the client / server (C / S) architecture, obtain the returned Obj_ID and calculate the number of bits of the field value, that is, the length of the Obj_ID data packet; (2) Add the calculated number of bits of Obj_ID and the number of bits of the script, that is, add the length of the Obj_ID data packet and the length of the script data packet to obtain the length of buf, buflength; (3) According to the length of buflength, generate the header size of the request packet, that is, the header length of the request packet; (4) Determine the length and header of the request packet according to the header length of the request packet and the preset rules; (5) Replace the length buflength and header of the request packet with the request packet message to be sent by the client to the target server.

[0051] In summary, the method for processing data packets provided in the embodiment of the present application runs a target script in a management system under a C / S architecture, triggers a data request to a target server through a client, wherein the target script is used to perform concurrent performance testing on the management system under the C / S architecture; receives a data packet returned to the client by the target server in response to the data request, and determines the length of a key field in the data packet returned to the client by the target server; adds the length of the key field in the data packet returned to the client by the target server to the length of the data packet of the target script to obtain a target length; processes the length and header of the data request packet to be sent by the client to the target server according to the target length to obtain a processed data request packet, wherein the data request packet carries a data request instruction; and processes the data packet to solve the problem in the related art that, in a management system under a C / S architecture, when concurrent testing is performed, the value of the key field in the data packet continues to increase, thereby causing the length of the data packet to change, resulting in a script error. By processing the length and packet header of the data request packet to be sent by the client to the target server according to the length obtained by adding the length of the key field in the data packet returned by the target server to the length of the data packet of the target script, and sending the processed data request packet to the target server, it is ensured that in the management system under the C / S architecture, when concurrent testing is performed, the value of the key field in the data packet continues to increase, so that the script does not report an error after the length of the data packet changes.

[0052] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0053] The embodiment of the present application also provides a data packet processing device. It should be noted that the data packet processing device of the embodiment of the present application can be used to execute the data packet processing method provided in the embodiment of the present application. The data packet processing device provided in the embodiment of the present application is introduced below.

[0054] Figure 3 is a schematic diagram of a data packet processing device according to an embodiment of the present application. Figure 3 As shown, the device includes: a first processing unit 301, a second processing unit 302, a first adding unit 303, a third processing unit 304 and a first sending unit 305.

[0055] Specifically, the first processing unit 301 is used to run a target script in the management system under the C / S architecture, and trigger a data request to the target server through the client, wherein the target script is used to perform a concurrent performance test on the management system under the C / S architecture;

[0056] The second processing unit 302 is used to receive a data packet returned by the target server to the client in response to the data request, and determine the length of the key field in the data packet returned by the target server to the client;

[0057] A first adding unit 303 is used to add the length of the key field in the data packet returned by the target server to the client and the length of the data packet of the target script to obtain a target length;

[0058] The third processing unit 304 is used to process the length and header of the data request packet to be sent by the client to the target server according to the target length to obtain a processed data request packet, wherein the data request packet carries a data request instruction;

[0059] The first sending unit 305 is used to send the processed data request packet to the target server.

[0060] Optionally, in the data packet processing device provided in the embodiment of the present application, the third processing unit includes: a first determination module, used to determine the length and header of the request packet to be sent by the client to the target server based on the target length; a first replacement module, used to replace the length and header of the data packet returned to the client with the length and header of the request packet to be sent by the client to the target server, so as to obtain a processed data request packet.

[0061] Optionally, in the data packet processing device provided in the embodiment of the present application, the first determination module includes: a first processing sub-module, used to obtain the header length of the request packet to be sent by the client to the target server according to the target length; a first determination sub-module, used to determine the length and header of the request packet to be sent by the client to the target server according to preset rules and the header length of the request packet to be sent by the client to the target server.

[0062] Optionally, in the data packet processing device provided in an embodiment of the present application, the second processing unit includes: a second determination module, used to determine the number of bits of the key field in the data packet returned by the target server to the client; and a third determination module, used to determine the length of the key field in the data packet returned by the target server to the client based on the number of bits of the key field.

[0063] Optionally, in the data packet processing device provided in the embodiment of the present application, the device also includes: a first determination unit, used to determine the number of bits of preset field two in the data packet of the target script before adding the length of the key field in the data packet returned by the target server to the client to the length of the data packet of the target script to obtain the target length; a second determination unit, used to determine the length of the data packet of the target script based on the number of bits of preset field two.

[0064] In summary, the data packet processing device provided in the embodiment of the present application runs the target script in the management system under the C / S architecture through the first processing unit 301, triggers a data request to the target server through the client, wherein the target script is used to perform concurrent performance testing on the management system under the C / S architecture; the second processing unit 302 receives the data packet returned by the target server to the client in response to the data request, and determines the length of the key field in the data packet returned by the target server to the client; the first adding unit 303 adds the length of the key field in the data packet returned by the target server to the client and the length of the data packet of the target script to obtain the target length; the third processing unit 304 processes the length and header of the data request packet to be sent by the client to the target server according to the target length to obtain a processed data request packet, wherein the data request packet carries a data request instruction; the first sending unit 305 sends the processed data request packet to the target server, which solves the problem in the related art that in the management system under the C / S architecture, when concurrent testing is performed, the key field value in the data packet continues to increase, so that the length of the data packet changes, resulting in a script error. By processing the length and packet header of the data request packet to be sent by the client to the target server according to the length obtained by adding the length of the key field in the data packet returned by the target server to the length of the data packet of the target script, and sending the processed data request packet to the target server, it is ensured that in the management system under the C / S architecture, when concurrent testing is performed, the value of the key field in the data packet continues to increase, so that the script does not report an error after the length of the data packet changes.

[0065] The data packet processing device includes a processor and a memory. The above-mentioned first processing unit 301, second processing unit 302, first adding unit 303, third processing unit 304 and first sending unit 305 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.

[0066] The processor contains a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the script can be guaranteed not to report errors by adjusting the kernel parameters.

[0067] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0068] An embodiment of the present invention provides a storage medium on which a program is stored. When the program is executed by a processor, the method for processing the data packet is implemented.

[0069] An embodiment of the present invention provides a processor, which is used to run a program, wherein the method for processing a data packet is executed when the program is running.

[0070] An embodiment of the present invention provides a device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: running a target script in a management system under a C / S architecture, triggering a data request to a target server through a client, wherein the target script is used to perform a concurrent performance test on the management system under the C / S architecture; receiving a data packet returned by the target server to the client in response to the data request, and determining the length of a key field in the data packet returned by the target server to the client; adding the length of the key field in the data packet returned by the target server to the client to the length of the data packet of the target script to obtain a target length; processing the length and header of a data request packet to be sent by the client to the target server according to the target length to obtain a processed data request packet, wherein the data request packet carries a data request instruction; and sending the processed data request packet to the target server.

[0071] When the processor executes the program, the following steps are also implemented: the length and header of the data request packet to be sent by the client to the target server are processed according to the target length, and the processed data request packet includes: determining the length and header of the request packet to be sent by the client to the target server according to the target length; replacing the length and header of the data packet returned to the client with the length and header of the request packet to be sent by the client to the target server, and obtaining the processed data request packet.

[0072] When the processor executes the program, the following steps are also implemented: according to the target length, the length and header of the request packet to be sent by the client to the target server are determined, including: according to the target length, the header length of the request packet to be sent by the client to the target server is obtained; according to a preset rule and the header length of the request packet to be sent by the client to the target server, the length and header of the request packet to be sent by the client to the target server are determined.

[0073] When the processor executes the program, the following steps are also implemented: determining the length of the key field in the data packet returned by the target server to the client includes: determining the number of bits of the key field in the data packet returned by the target server to the client; and determining the length of the key field in the data packet returned by the target server to the client based on the number of bits of the key field.

[0074] When the processor executes the program, the following steps are also implemented: before adding the length of the key field in the data packet returned by the target server to the client and the length of the data packet of the target script to obtain the target length, the method also includes: determining the number of bits of the preset field two in the data packet of the target script; and determining the length of the data packet of the target script according to the number of bits of the preset field two. The device in this article can be a server, a PC, a PAD, a mobile phone, etc.

[0075] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: running a target script in a management system under a C / S architecture, triggering a data request to a target server through a client, wherein the target script is used to perform a concurrent performance test on the management system under the C / S architecture; receiving a data packet returned by the target server to the client in response to the data request, and determining the length of a key field in the data packet returned by the target server to the client; adding the length of the key field in the data packet returned by the target server to the client to the length of the data packet of the target script to obtain a target length; processing the length and header of the data request packet to be sent by the client to the target server according to the target length to obtain a processed data request packet, wherein the data request packet carries a data request instruction; and sending the processed data request packet to the target server.

[0076] When executed on a data processing device, it is also suitable for executing an initialization program having the following method steps: processing the length and header of the data request packet to be sent by the client to the target server according to the target length, and obtaining a processed data request packet including: determining the length and header of the request packet to be sent by the client to the target server according to the target length; replacing the length and header of the data packet returned to the client with the length and header of the request packet to be sent by the client to the target server, and obtaining a processed data request packet.

[0077] When executed on a data processing device, it is also suitable for executing an initialized program having the following method steps: determining the length and header of the request packet to be sent by the client to the target server according to the target length, including: obtaining the header length of the request packet to be sent by the client to the target server according to the target length; determining the length and header of the request packet to be sent by the client to the target server according to a preset rule and the header length of the request packet to be sent by the client to the target server.

[0078] When executed on a data processing device, it is also suitable for executing a program initialized with the following method steps: determining the length of the key field in the data packet returned by the target server to the client includes: determining the number of bits of the key field in the data packet returned by the target server to the client; and determining the length of the key field in the data packet returned by the target server to the client based on the number of bits of the key field.

[0079] When executed on a data processing device, it is also suitable for executing an initialization program having the following method steps: before adding the length of the key field in the data packet returned by the target server to the client to the length of the data packet of the target script to obtain the target length, the method also includes: determining the number of bits of preset field two in the data packet of the target script; determining the length of the data packet of the target script based on the number of bits of the preset field two.

[0080] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0081] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0082] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0083] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0084] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0085] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0086] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0087] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0088] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0089] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for processing a data packet, It is characterized in that include: Running a target script in a management system under a C / S architecture, and triggering a data request to a target server through a client, wherein the target script is used to perform a concurrent performance test on the management system under the C / S architecture; receiving a data packet returned by the target server to the client in response to the data request, and determining the length of a key field in the data packet returned by the target server to the client; Add the length of the key field in the data packet returned by the target server to the client to the length of the data packet of the target script to obtain a target length; Processing the length and header of the data request packet to be sent by the client to the target server according to the target length to obtain a processed data request packet, wherein the data request packet carries a data request instruction; Sending the processed data request packet to the target server; The length and header of the data request packet to be sent by the client to the target server are processed according to the target length, and the processed data request packet includes: Determine the length and header of the request packet to be sent by the client to the target server according to the target length; The length and header of the data packet returned to the client are replaced with the length and header of the request packet to be sent by the client to the target server, so as to obtain a processed data request packet.

2. The method according to claim 1, It is characterized in that Determining the length and header of the request packet to be sent by the client to the target server according to the target length includes: According to the target length, obtaining the header length of the request packet to be sent by the client to the target server; According to a preset rule and the length of the header of the request packet to be sent by the client to the target server, the length and header of the request packet to be sent by the client to the target server are determined.

3. The method according to claim 1, It is characterized in that Determining the length of the key field in the data packet returned by the target server to the client includes: Determine the number of bits of a key field in a data packet returned by the target server to the client; The length of the key field in the data packet returned by the target server to the client is determined according to the number of bits of the key field.

4. The method according to claim 1, It is characterized in that Before adding the length of the key field in the data packet returned by the target server to the client to the length of the data packet of the target script to obtain the target length, the method further includes: Determine the number of digits of the preset field two in the data packet of the target script; The length of the data packet of the target script is determined according to the number of bits of the preset field two.

5. A data packet processing device, It is characterized in that include: A first processing unit is used to run a target script in a management system under a C / S architecture, and trigger a data request to a target server through a client, wherein the target script is used to perform a concurrent performance test on the management system under the C / S architecture; a second processing unit, configured to receive a data packet returned by the target server to the client in response to the data request, and determine a length of a key field in the data packet returned by the target server to the client; A first adding unit, configured to add the length of the key field in the data packet returned by the target server to the client and the length of the data packet of the target script to obtain a target length; A third processing unit is used to process the length and header of the data request packet to be sent by the client to the target server according to the target length to obtain a processed data request packet, wherein the data request packet carries a data request instruction; A first sending unit, configured to send the processed data request packet to the target server; The third processing unit comprises: A first determining module, used to determine the length and header of the request packet to be sent by the client to the target server according to the target length; The first replacement module is used to replace the length and header of the data packet returned to the client with the length and header of the request packet to be sent by the client to the target server, so as to obtain a processed data request packet.

6. The device according to claim 5, It is characterized in that The first determining module comprises: A first processing submodule, configured to obtain, according to the target length, a header length of a request packet to be sent by the client to the target server; The first determination submodule is used to determine the length and header of the request packet to be sent by the client to the target server according to a preset rule and the header length of the request packet to be sent by the client to the target server.

7. A storage medium, It is characterized in that The storage medium includes a stored program, wherein the program executes the data packet processing method according to any one of claims 1 to 4.

8. A processor, It is characterized in that The processor is used to run a program, wherein the program executes the method for processing a data packet as described in any one of claims 1 to 4 when running.

Citation Information

Patent Citations

  • Data acquisition method and device, terminal and storage medium

    CN112417022A

  • Corresponding system for invasion on scenario basis using state-transfer of session and method thereof

    KR100684602B1