A screening method, device, equipment and storage medium for the traffic to be tested

By obtaining and analyzing the fields and the number and types of the target traffic, filtering out the traffic to be tested, solving the problem that the untested traffic cannot be accurately screened in the existing technology, ensuring the stable operation of the production project.

CN115766487BActive Publication Date: 2025-08-01GUANGZHOU PINWEI SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211356213.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-01
Publication Date
2025-08-01
Estimated Expiration
2042-11-01

AI Technical Summary

Technical Problem

The existing traffic filtering methods cannot accurately filter out traffic that has not been tested, resulting in production projects failure and losses.

Method used

By obtaining the target traffic in the target interface, determining its corresponding first field and its number of values, filtering out the traffic to be tested based on the number of values and data types of the fields.

Benefits of technology

Accurately filter out untested traffic to ensure the normal operation of production projects and avoid failures caused by untested traffic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115766487B_ABST
    Figure CN115766487B_ABST
Patent Text Reader

Abstract

The present application discloses a method, apparatus, device, and storage medium for screening traffic to be tested. By responding to an operation instruction for screening traffic of a target interface, each target traffic in the target interface is obtained; each first field corresponding to each target traffic is determined, and the number of first values of each first field corresponding to each target traffic is obtained; at least one target field is determined, and each target field is a first field that exists in at least two target traffics; based on the number of first values of each first field, the number of second values of each target field is obtained; based on the number of second values of each target field, the data type of each target field is determined; according to the data type of each target field, each traffic to be tested is determined from each target traffic. This method can accurately screen out untested traffic and ensure the normal progress of the production project corresponding to the traffic to be tested.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of traffic screening, and particularly to a method, apparatus, device, and storage medium for screening traffic to be tested. Background Art

[0002] In the technical field of traffic screening, it is necessary to test a large amount of data traffic in a network interface to ensure the normal operation of the production project corresponding to the traffic. However, some traffic will be skipped and not tested. Therefore, it is necessary to regularly screen out the traffic that has not been tested and then conduct supplementary tests to avoid losses caused by failures in the production project corresponding to the traffic due to problems with the skipped traffic.

[0003] However, the existing traffic screening methods cannot accurately screen out the untested traffic, resulting in failures in the production project corresponding to the traffic itself and causing losses. Summary of the Invention

[0004] In view of this, this application provides a method, apparatus, device, and storage medium for screening traffic to be tested, which is used to solve the problem that the existing traffic screening methods cannot accurately screen out the untested traffic, resulting in failures in the production project corresponding to the traffic itself and causing losses.

[0005] To achieve the above object, the following solutions are proposed:

[0006] In a first aspect, a method for screening traffic to be tested includes:

[0007] Responding to an operation instruction for traffic screening on a target interface, and obtaining each target traffic in the target interface;

[0008] Determining each first field corresponding to each target traffic, and obtaining the number of first values of each first field corresponding to each target traffic;

[0009] Determining at least one target field, where each target field is a first field that exists in at least two target traffics;

[0010] Based on the number of first values of each first field, obtaining the number of second values of each target field; <U+

[0011] Based on the number of second values of each target field, determining the data type of each target field; <U+ <U+

[0012] According to the data type of each target field, determining each traffic to be tested from each target traffic. <U+ <U+

[0013] Preferably, the determining each first field corresponding to each target traffic includes:

[0014] For each target traffic, obtain each leaf node corresponding to the target traffic;

[0015] Flatten each of the leaf nodes to obtain each first field.

[0016] Preferably, obtaining the second value count of each target field based on the first value count of each first field includes:

[0017] For each target field, add up the first value counts corresponding to the target field in each target traffic to obtain the second value count of the target field.

[0018] Preferably, determining the data type of each target field based on the second value count of each target field includes:

[0019] Obtain the interface type of the target interface;

[0020] Based on the interface type, determine the first number threshold corresponding to the target interface;

[0021] For each target field, determine whether the second value count of the target field is greater than the first number threshold;

[0022] If the second value count of the target field is greater than the first number threshold, the data type of the target field is a random number;

[0023] If the second value count of the target field is not greater than the first number threshold, the data type of the target field is a non-random number.

[0024] Preferably, determining each test traffic from each target traffic according to the data type of each target field includes:

[0025] Determine each equivalent traffic and each non-equivalent traffic from each target traffic according to the data type of each target field;

[0026] Obtain the generation time of each equivalent traffic;

[0027] Compare the generation times of each equivalent traffic, and use the equivalent traffic with the earliest generation time as the first traffic;

[0028] Use each of the first traffic and each non-equivalent traffic as each test traffic.

[0029] Preferably, determining each equivalent traffic from each target traffic according to the data type of each target field includes:

[0030] Randomly select two target flows from all the said target flows as the first flow and the second flow;

[0031] Determine whether the first fields corresponding to the first flow are exactly the same as the first fields corresponding to the second flow;

[0032] If not, both the first flow and the second flow are non - equivalent flows;

[0033] If so, determine whether the data types of each first field corresponding to the first flow and the second flow are all random numbers. If so, both the first flow and the second flow are equivalent flows;

[0034] If the data types of each first field corresponding to the first flow and the second flow are not all random numbers, regard each first field with a non - random data type as a non - random field;

[0035] If the number of first values of each of the said non - random fields in the first flow is the same as the number of first values in the second flow, both the first flow and the second flow are equivalent flows;

[0036] If there exists a non - random field whose number of first values in the first flow is different from the number of first values in the second flow, both the first flow and the second flow are non - equivalent flows;

[0037] Repeat the step of randomly selecting two target flows from all the said target flows as the first flow and the second flow until all target flows are traversed.

[0038] In a second aspect, a screening device for a flow to be tested includes:

[0039] A target flow acquisition module, configured to acquire each target flow in the target interface in response to an operation instruction for screening the flow of the target interface;

[0040] A first field determination module, configured to determine each first field corresponding to each target flow and obtain the number of first values of each first field corresponding to each target flow;

[0041] A target field determination module, configured to determine at least one target field, where each target field is a first field that exists in at least two target flows;

[0042] A second value number determination module, configured to obtain the number of second values of each of the said target fields based on the number of first values of each first field;

[0043] A data type determination module, configured to determine the data type of each target field based on the number of second values of each target field;

[0044] A to-be-tested traffic determination module, configured to determine each to-be-tested traffic from each of the target traffics according to the data type of each target field.

[0045] Preferably, the data type determination module includes:

[0046] An interface type acquisition module, configured to acquire the interface type of the target interface;

[0047] A first number threshold determination module, configured to determine a first number threshold corresponding to the target interface based on the interface type;

[0048] A judgment module, configured to judge, for each target field, whether the number of second values of the target field is greater than the first number threshold;

[0049] A random number determination module, configured to, if the number of second values of the target field is greater than the first number threshold, determine that the data type of the target field is a random number;

[0050] A non-random number determination module, configured to, if the number of second values of the target field is not greater than the first number threshold, determine that the data type of the target field is a non-random number.

[0051] In a third aspect, a screening device for to-be-tested traffic includes a memory and a processor;

[0052] The memory is configured to store a program;

[0053] The processor is configured to execute the program to implement each step of the screening method for to-be-tested traffic as described in the first aspect.

[0054] In a fourth aspect, a storage medium stores a computer program, and when the computer program is executed by a processor, each step of the screening method for to-be-tested traffic as described in the first aspect is implemented.

[0055] As can be seen from the above technical solution, in this application, in response to an operation instruction for traffic screening of a target interface, each target traffic in the target interface is obtained; each first field corresponding to each target traffic is determined, and the number of first values of each first field corresponding to each target traffic is obtained; at least one target field is determined, where each target field is a first field that exists in at least two target traffics; based on the number of first values of each first field, the number of second values of each target field is obtained; based on the number of second values of each target field, the data type of each target field is determined; according to the data type of each target field, each traffic to be tested is determined from each target traffic. This solution determines each first field in each target traffic, determines the number of values of each target field through the number of values of the first field, thereby determining the data type of the target field, and determining the traffic to be tested based on this. This method can accurately screen out the traffic that has not been tested, ensuring the normal progress of the production project corresponding to the traffic to be tested. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on the provided drawings.

[0057] Figure 1 It is an optional flowchart of a method for screening traffic to be tested provided by an embodiment of the present application;

[0058] Figure 2 It is an optional flowchart of another method for screening traffic to be tested provided by an embodiment of the present application;

[0059] Figure 3 It is a schematic structural diagram of a device for screening traffic to be tested provided by an embodiment of the present application;

[0060] Figure 4 It is a schematic structural diagram of a device for screening traffic to be tested provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0061] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.

[0062] In the field of traffic screening technology, it is necessary to test the massive data traffic in the network interface to ensure the normal operation of the production project corresponding to the traffic. However, some traffic will be skipped and not tested. Therefore, it is necessary to regularly screen out the untested traffic and then conduct supplementary testing to avoid losses caused by failures in the production project corresponding to the traffic due to problems with the skipped traffic.

[0063] However, the existing traffic screening methods cannot accurately screen out the untested traffic, resulting in failures in the production project corresponding to the traffic itself and causing losses.

[0064] An embodiment of the present invention provides a method for screening traffic to be tested. This method can be applied to various computer terminals or intelligent terminals, and its execution entity can be the processor or server of the computer terminal or intelligent terminal. The flowchart of the method is as Figure 1 shown and specifically includes:

[0065] S1: In response to an operation instruction for traffic screening of a target interface, obtain each target traffic in the target interface.

[0066] For any interface in the production project, the request traffic of the interface is very large and it is necessary to test these traffic one by one. However, often a part of the traffic is missed without being tested. Therefore, in this application, a time period can be set, and in response to an operation instruction for traffic screening of the target interface every other time period, obtain all the target traffic in the interface. The target traffic in this application can be the traffic in the test environment or the production environment, and this embodiment does not limit this.

[0067] S2: Determine each first field corresponding to each target traffic, and obtain the number of first values of each first field corresponding to each target traffic.

[0068] After obtaining all the target traffic in the above step S1, determine each first field in each target traffic. In one example, for the target traffic of the transaction type, the first fields of this target traffic may include: payment account, password, amount, receiving account, payment status, prompt message, etc., and these fields form a traffic. From another perspective, the first fields of this target traffic may include: input parameters, output parameters, cookies (which can be used to identify the user's personal identity), etc. Specifically, the account is saved in the cookies, the input parameter represents the amount, and the output parameter represents the payment status, such as payment success or payment failure, etc.

[0069] Next, obtain the number of first values of each first field corresponding to each target traffic. For each first field, the number of first values refers to the total number of this first field in a target traffic where it exists.

[0070] S3: Determine at least one target field, where each target field is a first field that exists in at least two target flows.

[0071] For a first field, it may exist in one or more target flows. The first field that exists in at least two target flows is determined as the target field.

[0072] S4: Based on the number of first values of each first field, obtain the number of second values of each target field.

[0073] For a first field in a target flow, the number of first values of this first field in this target flow has been determined. Then, the number of second values of each target field can be obtained. The number of second values of a target field refers to the total number of this target field in all the obtained target flows.

[0074] S5: Based on the number of second values of each target field, determine the data type of each target field.

[0075] In the embodiments provided in the present application, each target field has its corresponding data type. The data type may include random numbers and non - random numbers, and this embodiment does not limit this.

[0076] According to the number of second values of each target field, the data type of each target field can be determined.

[0077] S6: According to the data type of each target field, determine each test - to - be - performed flow from each target flow.

[0078] The test - to - be - performed flow can be understood as the flow that has not been tested yet. Therefore, according to the data type of the target field in the target flow, it can be determined whether each target flow is a test - to - be - performed flow.

[0079] As can be seen from the above technical solution, in this application, in response to an operation instruction for traffic screening of a target interface, each target traffic in the target interface is obtained; each first field corresponding to each target traffic is determined, and the number of first values of each first field corresponding to each target traffic is obtained; at least one target field is determined, and each target field is a first field that exists in at least two target traffics; based on the number of first values of each first field, the number of second values of each target field is obtained; based on the number of second values of each target field, the data type of each target field is determined; according to the data type of each target field, each traffic to be tested is determined from each target traffic. This solution determines each first field in each target traffic, and determines the number of values of each target field through the number of values of the first field, thereby determining the data type of the target field, and determining the traffic to be tested based on this. This method can accurately screen out the traffic that has not been tested, and ensure the normal progress of the production project corresponding to the traffic to be tested.

[0080] In the method provided by the embodiment of the present invention, the process of determining each first field corresponding to each target traffic is specifically described as follows:

[0081] S21: For each target traffic, each leaf node corresponding to the target traffic is obtained.

[0082] S22: The flat processing is performed on each leaf node to obtain each first field.

[0083] Specifically, in an example, each leaf node of a target traffic may include:

[0084]

[0085] Then, by performing flat processing on the target traffic, three fields a, bb, and bbb can be obtained.

[0086] The above embodiment describes the process of determining each first field corresponding to each target traffic in this application. Next, the process of obtaining the number of second values of each target field based on the number of first values of each first field in this application is specifically described.

[0087] For a target field, it has a corresponding number of first values in each target traffic. Therefore, select the target traffics in which it exists, and add up the number of first values of the target field in each target traffic, then the number of second values of the target field can be obtained.

[0088] The above embodiments illustrate the process of obtaining the second value counts of the respective target fields based on the first value counts of the respective first fields. Next, the process of determining the data type of each target field based on the second value count of each target field in the present application will be specifically described.

[0089] S51: Obtain the interface type of the target interface.

[0090] S52: Based on the interface type, determine the first number threshold corresponding to the target interface.

[0091] In the above steps, the interface type of the target interface can be obtained, and the first number threshold corresponding to the target interface can be determined according to the interface type. In one example, it can also be configured according to the database corresponding to the target interface, and the first number threshold can be set to 20 based on past experience.

[0092] S53: For each target field, determine whether the second value count of the target field is greater than the first number threshold.

[0093] S54: If the second value count of the target field is greater than the first number threshold, the data type of the target field is a random number.

[0094] S55: If the second value count of the target field is not greater than the first number threshold, the data type of the target field is a non-random number.

[0095] Optionally, in one example, if the second value count of a target field is greater than 20, it is considered that the target field appears many times, then it can be explained that the data type of the target field is a random number; if the second value count of the target field is less than or equal to 20, it can be explained that the data type of the target field is a non-random number.

[0096] In the above process, the analysis of the request count of the target field can be added to further determine the data type of the target field, including:

[0097] Obtain the request count of the target field. The request count of the target field refers to the number of target flows in which the target field exists. If a target field appears in 3 target flows, the request count of the target field is 3.

[0098] Next, the number of second values is combined with the number of requests for judgment: If the number of second values of the target field is not greater than the first number threshold, it is judged whether the number of requests for the target field is greater than the first number threshold. If the number of requests for the target field is greater than the first number threshold, it can be determined that the data type of the target field is a non-random number; If the number of second values of the target field is not greater than the first number threshold, and the number of requests for the target field is less than or equal to the first number threshold, then when obtaining the target traffic in the next time interval for screening the traffic to be tested, the data type of the target field can be judged again to make the judgment result more accurate.

[0099] The above embodiments illustrate the process of determining the data type of each target field based on the number of second values of each target field. Next, the process of determining each traffic to be tested from each target traffic according to the data type of each target field in the present application will be specifically described.

[0100] S61: Determine each equivalent traffic and each non-equivalent traffic from each target traffic according to the data type of each target field;

[0101] S62: Obtain the generation time of each equivalent traffic;

[0102] S63: Compare the generation times of each equivalent traffic, and use the equivalent traffic with the earliest generation time as the first traffic;

[0103] S64: Use each of the first traffic and each non-equivalent traffic as each traffic to be tested.

[0104] In one example, the target traffic includes four, namely A, B, C, and D. The above process may include:

[0105] According to the data type of each target field corresponding in target traffic B and target traffic A, target traffic B and target traffic A are judged for equivalence. If target traffic B and target traffic A are not equivalent, then target traffic B is used as the traffic to be determined.

[0106] For target traffic C, target traffic C and target traffic A are judged for equivalence. If target traffic C and target traffic A are not equivalent, then target traffic C and target traffic B are continuously judged for equivalence. If target traffic C and target traffic B are equivalent, then target traffic C and target traffic B are determined as equivalent traffic;

[0107] Then, the target traffic D is equivalently judged against the target traffic A. If the target traffic D is not equivalent to the target traffic A, the target traffic A can be determined as non-equivalent traffic. Next, the target traffic D is equivalently judged against the target traffic B. If the target traffic D is not equivalent to the target traffic B, since the target traffic C is equivalent to the target traffic B, the equivalent judgment between the target traffic D and the target traffic C does not need to be carried out any further. Therefore, the target traffic D is determined as non-equivalent traffic.

[0108] Since the equivalent traffic B is generated earlier than the equivalent traffic C, the equivalent traffic B is taken as the first traffic. Therefore, the target traffic A, the target traffic B, and the target traffic D are the screened traffic to be tested.

[0109] In the embodiment provided by the present application, the process of determining each equivalent traffic and each non-equivalent traffic from each of the target traffic according to the data type of each of the target fields in the above step S61 may be as Figure 2 shown, and the specific process includes:

[0110] S611: Randomly select two target traffic from all the target traffic as the first traffic and the second traffic.

[0111] S612: Judge whether the first field corresponding to the first traffic is exactly the same as the first field corresponding to the second traffic. If not, execute step S613; if so, execute step S614.

[0112] S613: Both the first traffic and the second traffic are non-equivalent traffic, and execute step S618.

[0113] S614: Judge whether the data type of each first field corresponding to the first traffic and the second traffic is a random number. If so, execute step S615; if not, execute step S616.

[0114] S615: Both the first traffic and the second traffic are equivalent traffic, and execute step S618.

[0115] S616: Take each first field with a non-random data type as each non-random field.

[0116] S617: Judge whether the number of first values of each non-random field in the first traffic is the same as that in the second traffic. If so, execute step S615; if not, execute step S613.

[0117] S618: Judge whether all the target traffic has been traversed. If so, end; if not, return to execute step S611.

[0118] Specifically, it can be understood that for target traffic a and target traffic b, the target fields of target traffic a are: input parameter a1, output parameter a2, and cookies a3, and the target fields of target traffic b are: input parameter b1, output parameter b2, and cookies b3. If a1 and b1 are equivalent, a2 and b2 are equivalent, and a3 and b3 are equivalent, then target traffic a and target traffic b are considered equivalent traffic; otherwise, target traffic a and target traffic b are not considered equivalent traffic.

[0119] And Figure 1 Corresponding to the method described above, an embodiment of the present invention further provides a screening device for traffic to be tested, which is used to Figure 1 For the specific implementation of the method in, the screening device for traffic to be tested provided by the embodiment of the present invention can be in a computer terminal or various mobile devices, and in combination with Figure 3 , introduce the screening device for traffic to be tested. As Figure 3 shown, the device may include:

[0120] A target traffic acquisition module 10, configured to obtain each target traffic in the target interface in response to an operation instruction for traffic screening on the target interface;

[0121] A first field determination module 20, configured to determine each first field corresponding to each target traffic, and obtain the number of first values of each first field corresponding to each target traffic;

[0122] A target field determination module 30, configured to determine at least one target field, where each target field is a first field that exists in at least two target traffics;

[0123] A second value number determination module 40, configured to obtain the number of second values of each target field based on the number of first values of each first field;

[0124] A data type determination module 50, configured to determine the data type of each target field based on the number of second values of each target field;

[0125] A traffic-to-be-tested determination module 60, configured to determine each traffic to be tested from each target traffic according to the data type of each target field.

[0126] As can be seen from the above technical solution, in this application, by responding to an operation instruction for traffic screening of a target interface, each target traffic in the target interface is obtained; each first field corresponding to each target traffic is determined, and the number of first values of each first field corresponding to each target traffic is obtained; at least one target field is determined, where each target field is a first field that exists in at least two target traffics; based on the number of first values of each first field, the number of second values of each target field is obtained; based on the number of second values of each target field, the data type of each target field is determined; and according to the data type of each target field, each traffic to be tested is determined from each target traffic. In this solution, each first field in each target traffic is determined, and the number of values of each target field is determined by the number of values of the first field, so as to determine the data type of the target field and thereby determine the traffic to be tested. This method can accurately screen out the traffic that has not been tested, ensuring the normal progress of the production project corresponding to the traffic to be tested.

[0127] In one example, the first field determination module 20 may include:

[0128] A leaf node acquisition module, configured to, for each target traffic, acquire each leaf node corresponding to the target traffic;

[0129] A flattening processing module, configured to perform flattening processing on each of the leaf nodes to obtain each first field.

[0130] In one example, the second value number determination module 40 may include:

[0131] An addition module, configured to, for each target field, add up the number of first values corresponding to the target field in each target traffic to obtain the number of second values of the target field.

[0132] In one example, the data type determination module 50 may include:

[0133] An interface type acquisition module, configured to acquire the interface type of the target interface;

[0134] A first number threshold determination module, configured to determine, based on the interface type, a first number threshold corresponding to the target interface;

[0135] A judgment module, configured to, for each target field, judge whether the number of second values of the target field is greater than the first number threshold;

[0136] A random number determination module, configured to, if the number of second values of the target field is greater than the first number threshold, set the data type of the target field as a random number;

[0137] A non-random number determination module, configured to determine that the data type of the target field is a non-random number if the number of second values of the target field is not greater than the first number threshold.

[0138] In one example, the to-be-tested traffic determination module 60 may include:

[0139] A first determination module, configured to determine respective equivalent traffic and respective non-equivalent traffic from each of the target traffic according to the data type of each target field;

[0140] A time acquisition module, configured to acquire the generation time of each of the equivalent traffic;

[0141] A first traffic determination module, configured to compare the generation times of each of the equivalent traffic, and use the equivalent traffic with the earliest generation time as the first traffic;

[0142] A to-be-tested traffic final determination module, configured to use each of the first traffic and each of the non-equivalent traffic as each of the to-be-tested traffic.

[0143] In one example, the first determination module may include:

[0144] A selection module, configured to randomly select two target traffic from all the target traffic as the first traffic and the second traffic;

[0145] A first field judgment module, configured to judge whether the first field corresponding to the first traffic is exactly the same as the first field corresponding to the second traffic;

[0146] A first non-equivalent traffic determination module, configured to, if not, determine that both the first traffic and the second traffic are non-equivalent traffic;

[0147] A first equivalent traffic determination module, configured to, if so, judge whether the data type of each first field corresponding to the first traffic and the second traffic is a random number. If so, both the first traffic and the second traffic are equivalent traffic;

[0148] A non-random field determination module, configured to, if the data type of each first field corresponding to the first traffic and the second traffic is not all random numbers, use each first field with a non-random data type as each non-random field;

[0149] A second equivalent traffic determination module, configured to, if the number of first values of each non-random field in the first traffic is the same as the number of first values of each non-random field in the second traffic, determine that both the first traffic and the second traffic are equivalent traffic;

[0150] A second non-equivalent traffic determination module, configured to determine that both the first traffic and the second traffic are non-equivalent traffic if the number of first values of a non-random field in the first traffic is different from the number of first values of the non-random field in the second traffic.

[0151] A repeated operation module, configured to repeat the step of randomly selecting two target traffic flows from all the target traffic flows as the first traffic flow and the second traffic flow until all the target traffic flows are traversed.

[0152] Furthermore, an embodiment of the present application provides a screening device for traffic to be tested. Optionally, Figure 4 The hardware structure block diagram of the screening device for traffic to be tested is shown. Referring to Figure 4 , the hardware structure of the screening device for traffic to be tested may include: at least one processor 01, at least one communication interface 02, at least one memory 03, and at least one communication bus 04.

[0153] In the embodiment of the present application, the number of the processor 01, the communication interface 02, the memory 03, and the communication bus 04 is at least one, and the processor 01, the communication interface 02, and the memory 03 communicate with each other through the communication bus 04.

[0154] The processor 01 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.

[0155] The memory 03 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.

[0156] Wherein, the memory stores a program, and the processor can call the program stored in the memory. The program is used to execute the following screening method for traffic to be tested, including:

[0157] In response to an operation instruction for traffic screening on a target interface, obtain each target traffic flow in the target interface;

[0158] Determine each first field corresponding to each target traffic flow, and obtain the number of first values of each first field corresponding to each target traffic flow;

[0159] Determine at least one target field, where each target field is a first field that exists in at least two target traffic flows;

[0160] Based on the number of first values of each first field, obtain the number of second values of each target field;

[0161] Determine the data type of each target field based on the number of second values of each target field;

[0162] Determine each traffic to be tested from each target traffic according to the data type of each target field.

[0163] Optionally, the refinement function and expansion function of the program can refer to the description of the method for screening traffic to be tested in the method embodiments.

[0164] The embodiment of the present application also provides a storage medium, which can store a program suitable for execution by a processor. When the program runs, it controls the device where the storage medium is located to execute the following method for screening traffic to be tested, including:

[0165] In response to an operation instruction for traffic screening on a target interface, obtain each target traffic in the target interface;

[0166] Determine each first field corresponding to each target traffic, and obtain the number of first values of each first field corresponding to each target traffic;

[0167] Determine at least one target field, where each target field is a first field that exists in at least two target traffics;

[0168] Based on the number of first values of each first field, obtain the number of second values of each target field;

[0169] Determine the data type of each target field based on the number of second values of each target field;

[0170] Determine each traffic to be tested from each target traffic according to the data type of each target field.

[0171] Specifically, the storage medium may be a computer-readable storage medium, and the computer-readable storage medium may be an electronic memory such as a flash memory, EEPROM (electrically erasable programmable read-only memory), EPROM, hard disk, or ROM.

[0172] Optionally, the refinement function and expansion function of the program can refer to the description of the method for screening traffic to be tested in the method embodiments.

[0173] In addition, in each of the embodiments of the present disclosure, the functional modules can be integrated together to form an independent part, or each module can exist alone, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present disclosure, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a live broadcast device, or a network device, etc.) to execute all or part of the steps of the methods in the various embodiments of the present disclosure.

[0174] Finally, it should also be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.

[0175] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other.

[0176] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be obvious to those skilled in the art. The general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A screening method for the flow rate to be tested, characterized in that, Including: In response to an operation instruction for traffic screening on a target interface, obtain each target traffic in the target interface; Determine each first field corresponding to each target traffic, and obtain the number of first values of each first field corresponding to each target traffic; for each first field, the number of first values refers to the total number of times the first field appears in a target traffic where it exists; Determine at least one target field, where each target field is a first field that exists in at least two target traffics; Based on the number of first values of each first field, obtain the number of second values of each target field; The number of second values refers to the total number of times the target field appears in all the obtained target traffics; Based on the number of second values of each target field, determine the data type of each target field; including: obtain the interface type of the target interface; based on the interface type, determine a first number threshold corresponding to the target interface; for each target field, determine whether the number of second values of the target field is greater than the first number threshold; if the number of second values of the target field is greater than the first number threshold, the data type of the target field is a random number; if the number of second values of the target field is not greater than the first number threshold, the data type of the target field is a non-random number; According to the data type of each target field, determine each traffic to be tested from each target traffic; including: randomly select two target traffics from all the target traffics as the first traffic and the second traffic; determine whether the first fields corresponding to the first traffic are exactly the same as the first fields corresponding to the second traffic; if not, the first traffic and the second traffic are both non-equivalent traffics; if so, determine whether the data type of each first field corresponding to the first traffic and the second traffic is a random number; if so, the first traffic and the second traffic are both equivalent traffics; if the data type of each first field corresponding to the first traffic and the second traffic is not all random numbers, use the first fields with the data type of non-random numbers as each non-random field; if the number of first values of each non-random field in the first traffic is the same as the number of first values in the second traffic, the first traffic and the second traffic are both equivalent traffics; if there is a non-random field where the number of first values in the first traffic is different from the number of first values in the second traffic, the first traffic and the second traffic are both non-equivalent traffics; repeat the step of randomly selecting two target traffics from all the target traffics as the first traffic and the second traffic until all the target traffics are traversed; obtain the generation time of each equivalent traffic; compare the generation times of each equivalent traffic, and use the equivalent traffic with the earliest generation time as the first traffic; use each first traffic and each non-equivalent traffic as each traffic to be tested.

2. The method according to claim 1, wherein The determining each first field corresponding to each target traffic includes: For each target traffic, obtain each leaf node corresponding to the target traffic; Flatten each of the leaf nodes to obtain each first field.

3. The method according to claim 1, wherein Obtaining the second value count of each target field based on the first value count of each first field includes: For each target field, add up the first value counts corresponding to the target field in each target traffic to obtain the second value count of the target field.

4. A screening device for the flow rate to be tested, characterized in that, Includes: A target traffic acquisition module, configured to acquire each target traffic in the target interface in response to an operation instruction for traffic screening on the target interface; A first field determination module, configured to determine each first field corresponding to each target traffic and obtain the first value count of each first field corresponding to each target traffic; for each first field, the first value count refers to the total number of the first field in a target traffic where it exists; A target field determination module, configured to determine at least one target field, where each target field is a first field that exists in at least two target traffics; A second value count determination module, configured to obtain the second value count of each target field based on the first value count of each first field; A data type determination module, configured to determine the data type of each target field based on the second value count of each target field; The second value count refers to the total number of the target field in all the acquired target traffics; A traffic to be tested determination module, configured to determine each traffic to be tested from each target traffic according to the data type of each target field; includes: randomly selecting two target traffics from all the target traffics as the first traffic and the second traffic; determining whether the first fields corresponding to the first traffic are exactly the same as the first fields corresponding to the second traffic; if not, then both the first traffic and the second traffic are non-equivalent traffics; if so, then determining whether the data types of each first field corresponding to the first traffic and the second traffic are both random numbers, if so, then both the first traffic and the second traffic are equivalent traffics; if the data types of each first field corresponding to the first traffic and the second traffic are not both random numbers, then use each first field with a non-random data type as each non-random field; if the first value count of each non-random field in the first traffic is the same as the first value count in the second traffic, then both the first traffic and the second traffic are equivalent traffics; if there is a non-random field with a different first value count in the first traffic and the second traffic, then both the first traffic and the second traffic are non-equivalent traffics; repeat the step of randomly selecting two target traffics from all the target traffics as the first traffic and the second traffic until all the target traffics are traversed; obtain the generation time of each equivalent traffic; compare the generation times of each equivalent traffic, and use the equivalent traffic with the earliest generation time as the first traffic; use each of the first traffics and each non-equivalent traffic as each traffic to be tested; Among them, the data type determination module includes: an interface type acquisition module for acquiring the interface type of the target interface; a first number threshold determination module for determining a first number threshold corresponding to the target interface based on the interface type; a judgment module for judging, for each target field, whether the number of second values of the target field is greater than the first number threshold; a random number determination module for determining that the data type of the target field is a random number if the number of second values of the target field is greater than the first number threshold; and a non-random number determination module for determining that the data type of the target field is a non-random number if the number of second values of the target field is not greater than the first number threshold.

5. A screening device for the flow rate to be tested, characterized in that, including a memory and a processor; the memory is used for storing a program; the processor is used for executing the program to implement each step of the screening method for the traffic to be tested according to any one of claims 1-3.

6. A storage medium, on which a computer program is stored, characterized in that, When the computer program is executed by the processor, each step of the screening method for the traffic to be tested according to any one of claims 1-3 is implemented.

Citation Information

Patent Citations

  • Network traffic detection method and device, equipment and medium

    CN113542253A

  • Data leakage detection method and device, electronic equipment and readable storage medium

    CN114640530A