Message testing method, device, electronic device and computer-readable storage medium
By configuring multiple types of test data and expected marking results, and using token bucket quantity data and detectors to detect token bucket conditions, the problem of insufficient marking algorithm coverage is solved, more accurate packet traffic supervision and differentiated services are achieved, and network service quality is improved.
Patent Information
- Application Number
- CN202211386695.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-07
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-11-07
AI Technical Summary
Existing marking algorithms cannot fully cover message traffic, resulting in poor supervision effects and inability to provide better differentiated services.
By configuring multiple types of test data and expected marking results, marking and verifying the tested messages based on the marking algorithm, and determining the test results of the marking algorithm, including setting expected marking results and corresponding test data in multiple colors, using token bucket quantity data for testing, and using detectors to detect the actual situation of the token bucket to reduce calculation errors.
It improves the comprehensiveness and accuracy of marking algorithm testing, enhances the ability to monitor packet traffic, provides better differentiated services, and improves network service quality.
Smart Images

Figure CN115941556B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of network communication supervision, and in particular to a message testing method, device, electronic device and computer-readable storage medium. Background Art
[0002] Communications on a network are composed of a variety of application traffic flows. These applications have varying requirements for network services and performance. However, these specific requirements are determined by the network's QoS (Quality of Service) capabilities. Based on the network's ability to control applications, network QoS capabilities can be categorized into three models: best-effort, integrated services, and differentiated services. The differentiated services model categorizes data for different services based on service requirements and prioritizes packets by category, providing differentiated services. This model can provide end-to-end QoS for critical applications.
[0003] Differentiated services (DSS) models typically implement differentiated services through technologies such as traffic marking and control, congestion management, and congestion avoidance. A token bucket mechanism is often used to mark and control packet traffic. This mechanism typically uses marking algorithms, such as the single-rate three-color marker or dual-rate three-color marking algorithm, to measure packet traffic and assign color codes based on the evaluation results. Current marking tests fail to fully cover the measured packet traffic, leading to omissions and other issues. This results in poor traffic monitoring effectiveness and an inability to provide differentiated services. Summary of the Invention
[0004] In view of this, the purpose of the embodiments of the present application is to provide a message testing method, device, electronic device and computer-readable storage medium to improve the problem of poor monitoring effect of message traffic in the prior art.
[0005] In order to solve the above problems, in the first aspect, an embodiment of the present application provides a message testing method, which includes: configuring multiple types of test data corresponding to multiple expected marking results according to a marking algorithm; marking the test data based on the marking algorithm to obtain a test marking result; determining the test result of the marking algorithm according to the expected marking result and the test marking result; wherein, the test data includes at least one message to be tested and token bucket quantity data used to mark the message to be tested.
[0006] In the above implementation process, starting from the implementation logic of the marking algorithm, it is possible to set a variety of expected marking results of different colors, and configure corresponding test data for each expected marking result, so as to mark and verify multiple types of test data according to the marking algorithm, and then verify the obtained test marking results with the expected marking results, so as to effectively test the marking accuracy of the marking algorithm and obtain the test results of the marking algorithm. It is possible to verify a variety of different marking situations, comprehensively cover the traffic of the tested messages, reduce omissions during testing, and improve the comprehensiveness and accuracy of the testing of the marking algorithm, thereby improving the accuracy of the marking algorithm in marking message traffic, so as to effectively regulate the message traffic in the network, provide better differentiated services, and improve the service quality of the network.
[0007] Optionally, the expected marking result includes: a first color marking result, a second color marking result and a third color marking result; the test data includes first test data, second test data and third test data; the token bucket quantity data includes the number of remaining tokens in the first bucket and the number of remaining tokens in the second bucket; the configuration of multiple types of test data corresponding to multiple expected marking results according to the marking algorithm includes: determining the corresponding first color marking result, the second color marking result and the third color marking result according to the marking algorithm; determining the corresponding first test data according to the first color marking result; wherein the size of the tested message in the first test data is less than or equal to the number of remaining tokens in the first bucket; determining the corresponding second test data according to the second color marking result; wherein the size of the tested message in the second test data is greater than the number of remaining tokens in the first bucket and less than or equal to the number of remaining tokens in the second bucket; determining the corresponding third test data according to the third color marking result; wherein the size of the tested message in the third test data is greater than the number of remaining tokens in the second bucket.
[0008] In the above implementation process, the corresponding expected marking results can be determined based on the color marking capability of the marking algorithm. In the three-color marking algorithm, there are three different color marking results. Since the message traffic size represented by each color marking result is different, corresponding multiple types of test data can be set according to each color marking result to limit the size of the tested message and the number of remaining tokens in the first bucket or the second bucket of the token bucket used to mark the tested message. Various situations of token bucket number boundary values can be tested, so that multiple different types of test data can correspond to multiple different expected color marking results. The corresponding expected situation and test data can be determined based on the theoretical calculation of the marking algorithm, which improves the correlation between the test data and the expected situation and the validity of the test data, thereby improving the accuracy and validity of testing the marking results of the marking algorithm.
[0009] Optionally, determining the test result of the marking algorithm based on the expected marking result and the test marking result includes: comparing the test marking result with the corresponding first color marking result, the second color marking result and the third color marking result; if it is determined that the test marking result is consistent with the corresponding first color marking result, the second color marking result and the third color marking result, then the test result is correct marking; if it is determined that the test marking result is inconsistent with the corresponding first color marking result, the second color marking result and the third color marking result, then the test result is incorrect marking.
[0010] In the above implementation, during testing, the current test marking results generated by testing various types of test data using the marking algorithm can be obtained. The test marking results can then be compared with the expected color marking results corresponding to the test data to determine whether the current test results of the marking algorithm are correct based on whether the comparisons are consistent. By comparing various theoretical marking conditions of the marking algorithm with the corresponding actual marking conditions, the test results of the marking algorithm can be quickly and accurately obtained, effectively improving the efficiency and accuracy of testing the marking algorithm.
[0011] Optionally, the method also includes: detecting the water level in the token bucket based on a first sampling period by a first detector to obtain token water level data; after the first device sends the tested message in the test data to the second device, detecting the token reduction in the token bucket by a second detector to obtain token reduction data; detecting the token increase in the token bucket based on the second sampling period by a third detector to obtain token increase data; and determining the token bucket test data based on the token water level data, the token reduction data and the token increase data.
[0012] In the above implementation process, in order to test the actual situation of the token bucket used to mark message traffic, three detectors with different functions can be set in the device under test, and the water level data, decrease and increase of the token bucket can be detected respectively during the test process to determine the token bucket test data that represents the actual situation of the token bucket, so as to reduce the calculation error caused by the change of tokens in the same token bucket during the test.
[0013] Optionally, the test result includes a token bucket status result; the method also includes: judging whether the token bucket test data conforms to the token bucket expected data corresponding to the expected marking result; if it is determined that the token bucket test data conforms to the token bucket expected data, then the token bucket status result of the marking algorithm is generated as passed; if it is determined that the token bucket test data does not conform to the token bucket expected data, then the token bucket status result of the marking algorithm is generated as failed.
[0014] In the above implementation, the marking algorithm test results may also include token bucket status results. The actual token bucket test data of the token bucket during the test can be compared with the expected token bucket data corresponding to the expected marking result to determine whether the token bucket test data meets the expected token bucket data, thereby determining whether the actual change in the token bucket during the test meets the corresponding theoretical change. This can determine whether the actual change in the token bucket when marking messages is normal, thereby reducing calculation errors caused by changes in the number of tokens in the token bucket.
[0015] Optionally, before marking the test data based on the marking algorithm and obtaining the test marking result, the method also includes: detecting the communication status of message transmission between the first device and the second device; if the communication between the first device and the second device fails, generating a corresponding test failure result.
[0016] In the above implementation, the tested message in the test data is transmitted between the first device and the second device. Before marking the tested message in the test data, the communication status of the message transmission between the first and second devices can also be tested to determine whether the tested message can be transmitted normally. In the event of a communication failure, a corresponding test failure result can be generated to notify the staff of the communication failure. This effectively avoids the adverse impact of the marking algorithm's marking test caused by the failure of normal message transmission, thereby improving the accuracy and effectiveness of the test.
[0017] Optionally, the test result includes a policy verification result; before marking the test data based on the marking algorithm and obtaining the test marking result, the method also includes: verifying whether the test data matches the test strategy of the marking algorithm based on the marking algorithm; if the test data does not match the test strategy, generating an unmarked result; and determining the policy verification result of the marking algorithm based on the unmarked result.
[0018] In the above implementation, the marking algorithm's test results can also include policy verification results, which determine whether the message meets the policy. The marking algorithm verifies whether the tested message in the test data matches its corresponding test policy. If a mismatch is detected, a corresponding unmarked result is generated, and the marking algorithm's policy verification result is determined based on the unmarked result. This allows for test coverage from two different test dimensions, distinguishing between messages that match the marking algorithm's test policy and those that do not, effectively improving test coverage and comprehensiveness.
[0019] In the second aspect, an embodiment of the present application also provides a message testing device, which includes: a control module for configuring multiple types of test data corresponding to multiple expected marking results according to a marking algorithm; a testing module for marking the test data based on the marking algorithm to obtain a test marking result; the control module is also used to determine the test result of the marking algorithm based on the expected marking result and the test marking result; wherein, the test data includes at least one message to be tested and token bucket quantity data used to mark the message to be tested.
[0020] In the above implementation process, it is possible to set a plurality of expected marking results of different colors, and configure corresponding test data for each expected marking result, so as to mark and verify multiple categories of test data according to the marking algorithm, and then verify the obtained test marking results with the expected marking results to effectively test the marking accuracy of the marking algorithm and obtain the test results of the marking algorithm.
[0021] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores program instructions, and when the processor reads and runs the program instructions, it executes the steps in any implementation of the above-mentioned message testing method.
[0022] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer program instructions are stored in the computer-readable storage medium. When the computer program instructions are read and executed by a processor, the steps in any implementation of the above-mentioned message testing method are executed.
[0023] In summary, the embodiments of the present application provide a message testing method, device, electronic device and computer-readable storage medium, which can verify a variety of different marking situations, comprehensively cover the traffic of the measured message, reduce omissions during testing, and improve the comprehensiveness and accuracy of testing the marking algorithm, thereby improving the accuracy of the marking algorithm in marking message traffic, so as to effectively supervise the message traffic in the network, provide better differentiated services, and improve the service quality of the network. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0025] Figure 1 A block diagram of an electronic device provided in an embodiment of the present application;
[0026] Figure 2 A flowchart of the first message testing method provided in an embodiment of the present application;
[0027] Figure 3 A detailed flowchart of step S200 provided in an embodiment of the present application;
[0028] Figure 4 A detailed flowchart of step S400 provided in an embodiment of the present application;
[0029] Figure 5 A flowchart of the second message testing method provided in an embodiment of the present application;
[0030] Figure 6 A flowchart of the third message testing method provided in an embodiment of the present application;
[0031] Figure 7 A flowchart of the fourth message testing method provided in an embodiment of the present application;
[0032] Figure 8 A flowchart of the fifth message testing method provided in an embodiment of the present application;
[0033] Figure 9 A schematic diagram of the structure of a message testing device provided in an embodiment of the present application;
[0034] Figure 10 A schematic diagram of the operating environment of a message testing method provided in an embodiment of the present application.
[0035] Icons: 100-electronic device; 111-memory; 112-storage controller; 113-processor; 114-peripheral interface; 115-input and output unit; 116-display unit; 700-message test device; 710-control module; 720-test module; 810-control device; 820-device under test; 830-first device; 840-second device. DETAILED DESCRIPTION
[0036] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are only part of the embodiments of the present application, not all of them. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the embodiments of the present application.
[0037] Communication on a network is composed of a variety of application traffic flows. These applications have varying requirements for network services and performance. For example, FTP (File Transfer Protocol) downloads require maximum bandwidth, while certain services, such as VoIP, require minimal latency and jitter. The specific requirements of these applications are determined by the network's QoS (Quality of Service) capabilities. Depending on the network's ability to control applications, network QoS capabilities can be categorized as follows: Best Effort: In this model, network devices do not implement any QoS and ensure the transmission of all packets. However, when network congestion occurs, the network devices discard packets beyond their capabilities. This model can be considered a scenario without QoS. Integrated Service: This model implements QoS based on the Resource Reservation Protocol (RSVP). In this model, all network traffic must pre-register bandwidth and other services. The disadvantage of this model is that it is software-based and therefore lacks QoS guarantees.
[0038] Therefore, to resolve the conflict between these two models, existing technologies typically use a differentiated services model to ensure QoS. This model, also known as DiffServ (Differentiated Service), classifies data for different services based on service requirements, prioritizes packets by class, and then provides differentiated services. DiffServ is generally used to provide end-to-end QoS for critical applications. It is implemented through the following technologies: 1. Traffic marking and control: This technology classifies packets based on information such as the CoS (Class of Service) field, the ToS field (for IP packets, this refers to the IP precedence or DSCP), and the IP packet's five-tuple (protocol, source address, destination address, source port number, and destination port number), performing packet marking and traffic policing. Currently, traffic policing often uses a token bucket mechanism. 2. Congestion management and avoidance: This technology uses various queuing technologies to buffer and schedule congested packets, achieving both congestion management and avoidance. A token bucket mechanism is typically used for traffic marking and control. For example, the Internet Engineering Task Force (IETF) recommends using the single-rate three-color marker (srTCM) or two-rate three-color marker (trTCM) algorithms to measure packet traffic flow. Based on the evaluation results, packets are marked with colors (green, yellow, and red). When monitoring packet traffic, green and yellow packets are typically forwarded, while red packets are discarded.
[0039] In the prior art, when using a marking algorithm to test the marking of message traffic, usually after the network device under test receives the message, due to the traffic regulation strategy of the traffic token bucket of the single-speed three-color marker algorithm, the excess default traffic is discarded, and the other traffic that is allowed by the strategy communicates successfully; for traffic that is less than the token delivery rate, it is marked as green, and the test is passed if the sending and receiving rates are consistent; for traffic that exceeds the token delivery rate, a short burst is allowed, but the subsequent rate must be consistent with the set token delivery rate to pass the test. However, the coverage of this marking test method is not comprehensive, and the marking algorithm cannot fully cover the traffic of the tested message, which will lead to problems such as test omissions, and the test results can only be obtained after the traffic is sent. The test efficiency is low, resulting in poor regulation of message traffic and the inability to provide better differentiated services.
[0040] In order to solve the above problems, an embodiment of the present application provides a message testing method, which is applied to electronic devices. The electronic devices can be servers, personal computers (PCs), tablet computers, smart phones, personal digital assistants (PDAs), and other electronic devices with logical computing functions. The marking algorithm can be tested accordingly for different marking situations, effectively improving the effectiveness and accuracy of the marking test.
[0041] Optionally, see Figure 1 , Figure 1 This is a block diagram of an electronic device provided in an embodiment of the present application. The electronic device 100 may include a memory 111, a storage controller 112, a processor 113, a peripheral interface 114, an input and output unit 115, and a display unit 116. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the electronic device 100. For example, the electronic device 100 may further include Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0042] The memory 111, storage controller 112, processor 113, peripheral interface 114, input / output unit 115, and display unit 116 are electrically connected to each other directly or indirectly to enable data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses or signal lines. The processor 113 is used to execute the executable modules stored in the memory. The memory 111 can be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc. Among them, the memory 111 is used to store programs, and the processor 113 executes the program after receiving the execution instruction. The method executed by the electronic device 100 defined by the process disclosed in any embodiment of the present application can be applied to the processor 113 or implemented by the processor 113.
[0043] The processor 113 may be an integrated circuit chip with signal processing capabilities. The processor 113 may be a general-purpose processor, including a central processing unit (CPU) or a network processor (NP); it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. It may implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor may be a microprocessor or any conventional processor. The peripheral interface 114 couples various input / output devices to the processor 113 and memory 111. In some embodiments, the peripheral interface 114, processor 113, and memory controller 112 may be implemented in a single chip. In other embodiments, they may be implemented in separate chips. The input / output unit 115 is used to provide user input data. The input / output unit 115 may be, but is not limited to, a mouse and keyboard. The above-mentioned display unit 116 provides an interactive interface (such as a user operation interface) between the electronic device 100 and the user or is used to display image data for the user's reference. In this embodiment, the display unit can be a liquid crystal display or a touch display. If it is a touch display, it can be a capacitive touch screen or a resistive touch screen that supports single-point and multi-touch operations. Supporting single-point and multi-touch operations means that the touch display can sense touch operations generated simultaneously from one or more positions on the touch display, and hand over the sensed touch operations to the processor for calculation and processing. In an embodiment of the present application, the display unit 116 can display data such as the color of the expected mark of the tested message and the color of the mark during the actual test, the test results of the marking algorithm, etc.
[0044] The electronic device in this embodiment can be used to execute each step in each message testing method provided in the embodiment of this application. The implementation process of the message testing method is described in detail below through several embodiments.
[0045] See also Figure 2 , Figure 2 This is a flow chart of a first message testing method provided in an embodiment of the present application. The method may include steps S200-S400.
[0046] Step S200: configuring multiple categories of test data corresponding to multiple expected labeling results according to a labeling algorithm.
[0047] Among them, it is possible to set a plurality of expected marking results of different colors based on the implementation logic of the marking algorithm, and configure corresponding test data for each expected marking result. The test data includes at least one tested message and the number of token buckets used to mark the tested message.
[0048] It should be noted that the tested message can be transmitted by the first device and the second device, and the first device and the second device can communicate with each other through the tested device corresponding to the marking algorithm; the message generation tool is an open source tool and requires no cost investment. The marking algorithm used in the device under test can be a single-rate three-color marker algorithm, or a dual-rate three-color marker algorithm, or other marking algorithms. Taking the single-rate three-color marker algorithm as an example, it can include two token buckets, the first bucket, namely bucket C, and the second bucket, namely bucket E. Before testing, the relevant test configuration of the traffic policing policy based on the traffic token bucket of the single-rate three-color marker algorithm can also be performed on the device under test. The following parameters can be configured separately: CIR (Committed Information Rate): Committed Information Rate, which indicates the rate at which tokens are put into bucket C, that is, the average rate at which bucket C allows to transmit or forward messages; CBS (Committed Burst Size): Committed Burst Size, which indicates the capacity of bucket C, that is, the committed burst traffic that bucket C can pass instantly; EBS (Excess Burst Size): Excess Burst Size, which indicates the capacity of bucket E, that is, the excess burst traffic that bucket E can pass instantly. For example, if CIR=1000000 bit / s, CB=2000 bytes, and EBS=2000 bytes are configured, the corresponding expected marking results and multiple types of test data can be determined according to the configured parameters of the marking algorithm.
[0049] Step S300: Mark the test data based on the marking algorithm to obtain a test marking result.
[0050] Among them, multiple types of test data can be marked and verified according to the marking algorithm, so as to obtain the test marking results corresponding to the color marking of the tested message.
[0051] Step S400: determining a test result of the marking algorithm according to the expected marking result and the test marking result.
[0052] The test marking result is verified with the expected marking result to effectively test the marking accuracy of the marking algorithm and obtain the test result of the marking algorithm.
[0053] exist Figure 2In the embodiment shown, it is possible to verify a variety of different marking situations, comprehensively cover the traffic of the measured messages, reduce omissions during testing, and improve the comprehensiveness and accuracy of testing the marking algorithm, thereby improving the accuracy of the marking algorithm in marking message traffic, so as to effectively supervise the message traffic in the network, provide better differentiated services, and improve the service quality of the network.
[0054] It should be noted that due to the differences in marking algorithms, the expected marking results corresponding to the marking algorithms are also different. Taking the three-color marking algorithm as an example, the corresponding expected marking results may include: a first color marking result, a second color marking result, and a third color marking result, which may correspond to the three expected marking scenarios of expected marking green messages, expected marking yellow messages, and expected marking red messages, respectively. The number and color of the expected marking results can be set and modified accordingly according to the changes in the marking algorithm, and other situations will not be described in detail. When there are three colors of expected marking results, the test data corresponding to each expected marking result is also different. Therefore, the test data may include first test data, second test data, and third test data. Taking the single-speed three-color marker algorithm as an example, since it has two token buckets, bucket C and bucket E, the token bucket quantity data for marking traffic may include the remaining token quantity in the first bucket and the remaining token quantity in the second bucket.
[0055] It should be noted that, based on long-term testing experience, marking errors are prone to occur when the message traffic is at the boundary of the token bucket input or output range. Therefore, by adding relevant tests on the boundary values of the token bucket number in multiple types of test data, targeted tests can be performed on boundary conditions to improve the comprehensiveness of the test.
[0056] Optionally, see Figure 3 , Figure 3 A detailed flow chart of step S200 is provided in an embodiment of the present application. Step S200 may include steps S210-S240.
[0057] Step S210 , determining corresponding first color marking results, second color marking results, and third color marking results according to a marking algorithm.
[0058] Among them, the first color marking result is a green marking result, the second color marking result is a yellow marking result, and the third color marking result is a red marking result.
[0059] Step S220: determining corresponding first test data according to the first color marking result.
[0060] The size of the tested message in the first test data is less than or equal to the number of tokens remaining in the first bucket. Optionally, the first device can use software to construct a tested message that matches the traffic policing policy of the traffic token bucket of the marking algorithm. The tested message size is less than the committed burst size of bucket C in the marking algorithm, that is, the number of tokens remaining in the first bucket. For example, the size of the sent tested message is 1500 bytes. After the tested message arrives at the device under test, it should be marked green due to the traffic policing policy of the traffic token bucket of the marking algorithm. Alternatively, in order to test the boundary value of bucket C, the first device can also construct two tested messages that can match the traffic policing policy of the traffic token bucket of the marking algorithm. The two tested messages are sent sequentially, and the size of the first tested message is smaller than the committed burst size of bucket C, and the size of the second tested message meets the following conditions: committed burst size of bucket C - size of the first tested message = size of the second tested message. For example, the size of the first tested message is 1500 bytes, and the size of the second tested message is 500 bytes. Therefore, after the two tested messages arrive at the tested device, due to the effect of the traffic policing policy of the traffic token bucket of the marking algorithm, the sizes of the two tested messages at the boundary value are not exceeded and should also be marked green, which corresponds to the first color marking result.
[0061] Step S230: determining corresponding second test data according to the second color marking result.
[0062] Among them, the size of the tested message in the second test data is greater than the number of remaining tokens in the first bucket and less than or equal to the number of remaining tokens in the second bucket. Optionally, the first device can use software to construct two tested messages of the traffic policing policy that can match the traffic token bucket of the marking algorithm. The two tested messages are sent sequentially. The size of the first tested message is less than the committed burst size of bucket C in the marking algorithm, that is, the number of remaining tokens in the first bucket. The size of the second tested message meets the following conditions: committed burst size of bucket C - size of the first tested message < size of the second tested message, and size of the second tested message < excess burst size of bucket E, that is, the number of remaining tokens in the second bucket. For example, the size of the first tested message sent is 1500 bytes, and the size of the second tested message is 1500 bytes. After the packets arrive at the device under test, the first packet consumes tokens from bucket C due to the traffic policing policy of the marking algorithm's traffic token bucket. Therefore, the first packet is marked green. Due to the consumption of tokens by the first packet, the remaining tokens in bucket C are insufficient for the second packet under test. Therefore, the second packet consumes tokens from bucket E. However, since the excess burst size of bucket E is not exceeded, the second packet is marked yellow. Alternatively, to test the boundary value of bucket E, the first device may construct three test messages that match the traffic policing policy of the traffic token bucket of the marking algorithm. The three test messages are sent sequentially, and the size of the first test message is smaller than the committed burst size of bucket C, i.e., the number of tokens remaining in bucket C. The size of the second test message satisfies the following conditions: committed burst size of bucket C - first test message size < second test message size, and the size of the second test message < excess burst size of bucket E, i.e., the number of tokens remaining in bucket E. The third test message satisfies the following conditions: third test message size = excess burst size of bucket E - second test message size. For example, the size of the first test message is 1500 bytes, the size of the second test message is 1500 bytes, and the size of the third test message is 500 bytes. Therefore, after the two tested packets arrive at the device under test, due to the traffic policing policy of the traffic token bucket of the marking algorithm, the first tested packet should consume the tokens of bucket C and be marked green. Due to the consumption of the first tested packet, the remaining tokens in bucket C can no longer meet the token usage requirements of the second tested packet. The second tested packet should consume the tokens of bucket E. Since it does not exceed the excess burst size of bucket E, the second tested packet is marked yellow. The remaining tokens in bucket E just meet the token usage requirements of the third tested packet. The third tested packet is marked yellow, which corresponds to the second color marking result.
[0063] Step S240: determining corresponding third test data according to the third color marking result.
[0064] The size of the tested message in the third test data is greater than the number of remaining tokens in the second bucket. Optionally, the first device can use software to construct three tested messages that match the traffic policing policy of the traffic token bucket of the marking algorithm. The three tested messages are sent sequentially, the size of the first tested message is less than the committed burst size of bucket C, that is, the number of remaining tokens in the first bucket, the size of the second tested message satisfies the following conditions: committed burst size of bucket C - size of the first tested message < size of the second tested message, and the size of the second tested message < excess burst size of bucket E, that is, the number of remaining tokens in the second bucket; and the size of the third tested message satisfies the following conditions: size of the third tested message > excess burst size of bucket E - size of the second tested message. For example, the size of the first measured message is 1500 bytes, the size of the second measured message is 1500 bytes, and the size of the third measured message is 1500 bytes. After the measured messages arrive at the device under test, due to the traffic policing policy of the traffic token bucket of the marking algorithm, the first measured message should consume the tokens of bucket C and be marked green. Due to the consumption of the first measured message, the remaining tokens in bucket C can no longer meet the token usage requirements of the second measured message. The second measured message should consume the tokens of bucket E. Since it does not exceed the excess burst size of bucket E, it is marked yellow. The remaining tokens in bucket C cannot meet the token usage requirements of the third measured message, and the remaining tokens in bucket E cannot meet the token usage requirements of the third measured message. The third measured message is marked red, that is, the third color marking result.
[0065] Optionally, in order to judge the interim results of the effectiveness of the traffic token bucket of the marking algorithm, we can start from the implementation logic of the marking algorithm and test the marking situation from a micro perspective by controlling the sending of a small number of tested messages such as a single, two, or three. Therefore, the number of tested messages in the first test data, the second test data, and the third test data can be a small number such as a single, two, or three, and the actual number of tested messages can also be set and adjusted according to actual conditions and needs.
[0066] exist Figure 3 In the embodiment shown, the corresponding expected conditions and test data can be determined based on the theoretical calculation of the marking algorithm, thereby improving the correlation between the test data and the expected conditions and the validity of the test data, thereby improving the accuracy and validity of testing the marking results of the marking algorithm.
[0067] Optionally, see Figure 4 , Figure 4 A detailed flowchart of step S400 is provided in an embodiment of the present application. Step S400 may include steps S410-S430.
[0068] Step S410 : comparing the test marking result with the corresponding first color marking result, second color marking result and third color marking result.
[0069] Herein, current test marking results generated by testing a plurality of test data of different types according to the marking algorithm are respectively obtained, so as to compare the test marking results with expected color marking results corresponding to the test data.
[0070] In step S420 , if it is determined that the test marking result is consistent with the corresponding first color marking result, second color marking result and third color marking result, the test result is that the marking is correct.
[0071] Among them, if the marking algorithm marks the first test data in green, the second test data in yellow, and the third test data in red, then the test result is that the actual marking result of the marking algorithm is correct.
[0072] Step S430: If it is determined that the test marking result is inconsistent with the corresponding first color marking result, second color marking result and third color marking result, the test result is a marking error.
[0073] Among them, if the color marked by the marking algorithm for the first test data is not green, the color marked for the second test data is not yellow, and the color marked for the third test data is not red, then the test result is that the actual marking result of the marking algorithm is wrong.
[0074] exist Figure 4 In the illustrated embodiment, various theoretical marking situations of the marking algorithm can be compared with corresponding actual marking situations to quickly and accurately obtain the test results of the marking algorithm, thereby effectively improving the efficiency and accuracy of testing the marking algorithm.
[0075] It's important to note that to test the actual performance of the token bucket used to mark packet traffic, three detectors with different functions can be set up in the device under test. These detectors are all implemented using software scripts and are: a token bucket water level detector, a token decrease detector, and a token increase detector.
[0076] Optionally, see Figure 5 , Figure 5 This is a flow chart of a second message testing method provided in an embodiment of the present application. The method may further include steps S510-S540.
[0077] Step S510 : Detecting the water level in the token bucket based on a first sampling period by a first detector to obtain token water level data.
[0078] Among them, the first detector is a token bucket water level detector, which can perform periodic detection on the token bucket, with a fixed time as the first sampling period, for example, 1ms. The first sampling period can be set and modified according to needs to regularly detect the token water level of bucket C and bucket E of the device under test to obtain the corresponding token water level data.
[0079] In step S520 , after the first device sends the tested message in the test data to the second device, the second detector is used to detect the token reduction in the token bucket to obtain token reduction data.
[0080] Among them, the second detector is a token reduction detector, which can be automatically triggered after the first device sends the measured message to the second device. After triggering, it automatically detects the token reduction status of the C bucket and E bucket of the measured network device and obtains corresponding token reduction data.
[0081] Step S530: Detecting the token increase in the token bucket based on the second sampling period by a third detector to obtain token increase data.
[0082] Among them, the third detector is a token increase detector, which can periodically detect the token bucket with a fixed time as the second sampling period, such as 1ms. The second sampling period can also be set and modified according to needs to regularly detect the token increase in the C bucket and E bucket of the network device under test to obtain the corresponding token increase data.
[0083] Step S540 , determining token bucket test data according to the token water level data, the token reduction data, and the token increase data.
[0084] The token bucket test data can be integrated to determine the actual token bucket status. It should be noted that since the token bucket test data includes multiple types of data, it can be integrated into a table for output. Please refer to Table 1. Table 1 takes the test results of the marking algorithm on the first test data as an example to illustrate a token bucket test data situation:
[0085] Table 1
[0086]
[0087] exist Figure 5 In the illustrated embodiment, calculation errors caused by changes in tokens in the same token bucket during the test process can be reduced by determining token bucket test data.
[0088] Optionally, see Figure 6 , Figure 6This is a flow chart of a third message testing method provided in an embodiment of the present application. The method may further include steps S550-S570.
[0089] Step S550: determine whether the token bucket test data meets the token bucket expected data corresponding to the expected marking result.
[0090] If the marking algorithm tests the first test data, the number of tokens added to the device's C and E buckets can be periodically obtained. The expected token bucket data is as follows: if bucket C is not full (using a token bucket water level detector), the number of tokens added = Committed Information Rate (CIR) × the first sampling period; if bucket C is full (using a token bucket water level detector), no more tokens are added; if bucket E is always full (using a token bucket water level detector), the number of tokens added is zero. If the marking algorithm tests the second test data, the number of tokens added to the device's C and E buckets can be periodically obtained. The expected token bucket data is as follows: if bucket C is not full (using a token bucket water level detector), the number of tokens added = Committed Information Rate (CIR) × the sampling period; if bucket C is full (using a token bucket water level detector), no more tokens are added, and overflowing tokens from bucket C are added to bucket E (if bucket E is not full); and if bucket E is full (using a token bucket water level detector), no more tokens are added. If the marking algorithm tests the third test data, the number of token increases in bucket C and bucket E of the device under test can be obtained regularly. The expected data of the token bucket is: if bucket C is not full (detected by the token bucket water level detector), the number of token increases = committed information rate × sampling period; if bucket C is full (detected by the token bucket water level detector), tokens will no longer be increased, and the overflow tokens in bucket C will be added to bucket E (when bucket E is not full); after bucket E is full (detected by the token bucket water level detector), tokens will no longer be increased.
[0091] Step S560: If it is determined that the token bucket test data meets the token bucket expected data, the token bucket condition result of the marking algorithm is generated as passed.
[0092] Among them, if the token bucket test data meets the corresponding token bucket expected data, it meets expectations, and the token bucket situation result of the marking algorithm is passed.
[0093] Step S570: If it is determined that the token bucket test data does not meet the token bucket expected data, the token bucket condition result of the marking algorithm is generated as failed.
[0094] Among them, if the token bucket test data does not meet the token bucket expected data, it does not meet expectations, the token bucket situation result of the marking algorithm is failed, and the test can be ended directly.
[0095] Optionally, the token bucket status result may be associated with the marked test result. Only when the token bucket status result test passes, the corresponding color-marked test result can be effectively output.
[0096] exist Figure 6 In the illustrated embodiment, it is possible to determine whether the actual change in the token bucket marking the message is normal, thereby reducing calculation errors caused by changes in the number of tokens in the token bucket.
[0097] Optionally, see Figure 7 , Figure 7 This is a flow chart of the fourth message testing method provided in an embodiment of the present application. Before step S300, the method may further include steps S610-S620.
[0098] Step S610: Detect the communication status of message transmission between the first device and the second device.
[0099] Before the marking algorithm marks the test data, the communication status between the first device and the second device and the corresponding relationship with the session information of the device under test can be detected to determine whether the tested message can be transmitted normally.
[0100] Step S620: If the communication between the first device and the second device fails, a corresponding test failure result is generated.
[0101] Among them, when communication fails, a corresponding test failure result can be generated, the test can be terminated, and the staff can be notified of the communication failure.
[0102] exist Figure 7 In the illustrated embodiment, the adverse effects on the marking test of the marking algorithm caused by the failure of normal message transmission are effectively avoided, thereby improving the accuracy and effectiveness of the test.
[0103] Optionally, see Figure 8 , Figure 8 This is a flow chart of the fifth message testing method provided in an embodiment of the present application. Before step S300, the method may further include steps S630-S650.
[0104] Step S630: Verify whether the test data matches the test strategy of the marking algorithm based on the marking algorithm.
[0105] Since the marking algorithm can filter transmitted messages for marking, the verification results of the marking algorithm's message filtering strategy can also be obtained during the marking test. The marking algorithm's test strategy can be determined based on filtering conditions, that is, messages that meet the filtering conditions are marked, and messages that do not meet the filtering conditions are not marked. The corresponding filtering conditions can be configured and modified according to actual needs and circumstances. For example, the filtering conditions can be configured to filter messages with source addresses between 10.1.1.20 and 10.1.1.29.
[0106] Step S640: If the test data does not match the test strategy, an unmarked result is generated.
[0107] After the tested packets in the test data reach the device under test, packets that do not match the policy should not hit the test policy. For example, if the source address of the tested packet in the test data is 10.1.1.20, it matches the test policy of the marking algorithm and the marking algorithm can mark it. However, if the source address of the tested packet in the test data is 10.1.1.30, it also matches the test policy of the marking algorithm and the marking algorithm should not mark it, generating a corresponding unmarked result.
[0108] Step S650: Determine the strategy verification result of the marking algorithm according to the unmarking result.
[0109] Among them, the unmarking result obtained by the actual detection of the marking algorithm in the device under test can be compared with the theoretical unmarking result of the marking algorithm to obtain the corresponding strategy verification result, and verify the marking or unmarking operation of the marking algorithm for the test strategy.
[0110] It should be noted that since the test results can include color-coded test results, token bucket status test results, and policy verification results, any test can be stopped if the test fails, effectively saving testing time. Furthermore, the test results can be integrated into a table for output. Please refer to Table 2. Table 2 uses the test results of the marking algorithm on the first test data as an example to illustrate one test result scenario:
[0111] Table 2
[0112] Strategy hit count Passed +1 pass +0 Fail Token bucket reduction detection results Passed The number of tokens in bucket C is reduced by 1500 bytes and the number of tokens in bucket E is reduced by 0. pass The number of tokens in bucket C decreased by 0 and the number of tokens in bucket E decreased by 0 Fail The number of tokens in bucket C is reduced by 0 and the number of tokens in bucket E is reduced by 1500 bytes. Fail other Fail Color marking of the tested message Passed green yes yellow no red no No mark no
[0113] exist Figure 8 In the illustrated embodiment, test coverage can be performed from two different test dimensions, and messages that match the test strategy of the marking algorithm and messages that do not match the test strategy can be tested separately, effectively improving the coverage and comprehensiveness of the test.
[0114] See also Figure 9 , Figure 9 This is a schematic diagram of the structure of a message testing device provided in an embodiment of the present application. The message testing device 700 may include:
[0115] The control module 710 is used to configure multiple types of test data corresponding to multiple expected marking results according to the marking algorithm; the test module 720 is used to mark the test data based on the marking algorithm to obtain the test marking result; the control module 710 is also used to determine the test result of the marking algorithm based on the expected marking result and the test marking result; wherein the test data includes at least one tested message and the token bucket quantity data used to mark the tested message.
[0116] In an optional embodiment, the expected marking results include: a first color marking result, a second color marking result, and a third color marking result; the test data includes first test data, second test data, and third test data; the token bucket quantity data includes the number of remaining tokens in the first bucket and the number of remaining tokens in the second bucket; the control module 710 may also include a configuration submodule for determining the corresponding first color marking result, second color marking result, and third color marking result according to the marking algorithm; determining the corresponding first test data according to the first color marking result; wherein the size of the tested message in the first test data is less than or equal to the number of remaining tokens in the first bucket; determining the corresponding second test data according to the second color marking result; wherein the size of the tested message in the second test data is greater than the number of remaining tokens in the first bucket and less than or equal to the number of remaining tokens in the second bucket; determining the corresponding third test data according to the third color marking result; wherein the size of the tested message in the third test data is greater than the number of remaining tokens in the second bucket.
[0117] In an optional embodiment, the control module 710 may further include a comparison submodule for comparing the test mark result with the corresponding first color mark result, second color mark result and third color mark result; if it is determined that the test mark result is consistent with the corresponding first color mark result, second color mark result and third color mark result, the test result is a correct mark; if it is determined that the test mark result is inconsistent with the corresponding first color mark result, second color mark result and third color mark result, the test result is an incorrect mark.
[0118] In an optional embodiment, the message testing device 700 may also include a first detector, a second detector and a third detector; the first detector is used to detect the water level in the token bucket based on the first sampling period to obtain token water level data; after the first device sends the tested message in the test data to the second device, the second detector is used to detect the reduction of tokens in the token bucket to obtain token reduction data; the third detector is used to detect the increase of tokens in the token bucket based on the second sampling period to obtain token increase data; the test module 720 is also used to determine the token bucket test data based on the token water level data, token reduction data and token increase data.
[0119] In an optional embodiment, the test result includes a token bucket status result; the control module 710 may also include a token bucket sub-module for determining whether the token bucket test data meets the token bucket expected data corresponding to the expected marking result; if it is determined that the token bucket test data meets the token bucket expected data, the token bucket status result of the marking algorithm is generated as passed; if it is determined that the token bucket test data does not meet the token bucket expected data, the token bucket status result of the marking algorithm is generated as failed.
[0120] In an optional embodiment, the control module 710 may further include a communication submodule for detecting the communication status of message transmission between the first device and the second device; if the communication between the first device and the second device fails, a corresponding test failure result is generated.
[0121] In an optional embodiment, the test result includes a policy verification result; the control module 710 may also include a policy sub-module for verifying whether the test data matches the test strategy of the marking algorithm based on the marking algorithm; if the test data does not match the test strategy, an unmarked result is generated; and the policy verification result of the marking algorithm is determined based on the unmarked result.
[0122] Since the principle of solving the problem by the message testing device 700 in the embodiment of the present application is similar to that of the embodiment of the aforementioned message testing method, the implementation of the message testing device 700 in this embodiment can refer to the description in the embodiment of the aforementioned message testing method, and the repeated parts will not be repeated.
[0123] It should be noted that the control module 710 and the test module 720 in the message test device 700 can be both set in the network device under test, or can be set separately. For example, the control module 710 is set in the control device, and the test module 720 is set in the device under test corresponding to the marking algorithm. The control module 710 and the test module 720 can be connected to each other through a communication medium such as a wired network, a wireless network, or Bluetooth to perform message transmission. For example, please refer to Figure 10 , Figure 10A schematic diagram of the operating environment of a message testing method provided in an embodiment of the present application shows a situation in which a control module 710 and a test module 720 are respectively set up in different devices, including: a control device 810, a device under test 820, a first device 830, and a second device 840. Among them, the control device 810 serves as a test script running device, and issues relevant commands to the device under test 820, the first device 830, and the second device 840 through a communication connection, and collects the running results to generate test results. The control device 810 is used to configure multiple types of test data corresponding to multiple expected marking results according to the marking algorithm. The first device 830 and the second device 840 are used to transmit the test data through the device under test 820 to detect the marking status of the marking algorithm in the device under test 820. The device under test 820 is used to mark the test data based on the marking algorithm to obtain a test marking result. The control device 810 is also used to determine the test result of the marking algorithm based on the expected marking result and the test marking result.
[0124] An embodiment of the present application further provides a computer-readable storage medium, in which computer program instructions are stored. When the computer program instructions are read and executed by a processor, the steps of any one of the message testing methods provided in this embodiment are executed.
[0125] In the several embodiments provided in this application, it should be understood that the disclosed devices can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices according to the multiple embodiments of the present application. In this regard, each box in the block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram, and the combination of the block diagrams, can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0126] In addition, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0127] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0128] The foregoing is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included within the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined or explained in subsequent figures.
[0129] The above is only a specific implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.
[0130] It should be noted that, in this document, relational terms such as first and second, etc., are used only 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 terms "comprises," "comprising," or any other variants thereof are 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 explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, the elements defined by the phrase "comprising..." do not exclude the presence of other identical elements in the process, method, article, or device comprising the elements.
Claims
1. A message testing method, characterized in that: The method comprises: Configure multiple categories of test data corresponding to multiple expected labeling results according to the labeling algorithm; Marking the test data based on a marking algorithm to obtain a test marking result; Determining a test result of the marking algorithm according to the expected marking result and the test marking result; The test data includes at least one message under test and token bucket quantity data for marking the message under test; The method also includes: detecting the water level in the token bucket based on a first sampling period by a first detector to obtain token water level data; after the first device sends the tested message in the test data to the second device, detecting the token reduction in the token bucket by a second detector to obtain token reduction data; detecting the token increase in the token bucket based on a second sampling period by a third detector to obtain token increase data; determining token bucket test data based on the token water level data, the token reduction data and the token increase data; wherein the test result includes a token bucket situation result; judging whether the token bucket test data meets the token bucket expected data corresponding to the expected marking result; if it is determined that the token bucket test data meets the token bucket expected data, then generating the token bucket situation result of the marking algorithm as passed; if it is determined that the token bucket test data does not meet the token bucket expected data, then generating the token bucket situation result of the marking algorithm as failed.
2. The method according to claim 1, characterized in that in, The expected marking results include: a first color marking result, a second color marking result, and a third color marking result; the test data includes first test data, second test data, and third test data; the token bucket quantity data includes the number of remaining tokens in the first bucket and the number of remaining tokens in the second bucket; The configuration of multiple types of test data corresponding to multiple expected labeling results according to the labeling algorithm includes: Determine the corresponding first color marking result, the second color marking result and the third color marking result according to the marking algorithm; Determine the corresponding first test data according to the first color marking result; wherein the size of the tested message in the first test data is less than or equal to the number of remaining tokens in the first bucket; Determining the corresponding second test data according to the second color marking result; wherein the size of the tested message in the second test data is greater than the number of remaining tokens in the first bucket and less than or equal to the number of remaining tokens in the second bucket; The corresponding third test data is determined according to the third color marking result; wherein the size of the tested message in the third test data is greater than the number of remaining tokens in the second bucket.
3. The method according to claim 2, characterized in that Determining a test result of the marking algorithm according to the expected marking result and the test marking result includes: comparing the test marking result with the corresponding first color marking result, the second color marking result, and the third color marking result; If it is determined that the test marking result is consistent with the corresponding first color marking result, the second color marking result and the third color marking result, then the test result is marked correctly; If it is determined that the test marking result is inconsistent with the corresponding first color marking result, the second color marking result and the third color marking result, the test result is a marking error.
4. The method according to claim 1, wherein Before labeling the test data based on the labeling algorithm to obtain a test labeling result, the method further includes: detecting a communication status of message transmission between the first device and the second device; If the communication between the first device and the second device fails, a corresponding test failure result is generated.
5. The method according to any one of claims 1 to 3, characterized in that The test results include strategy verification results; Before labeling the test data based on the labeling algorithm to obtain a test labeling result, the method further includes: Verifying whether the test data matches a test strategy of the marking algorithm based on the marking algorithm; If the test data does not match the test strategy, generating an unmarked result; A strategy verification result of the marking algorithm is determined according to the unmarking result.
6. A message testing device, characterized in that: The device comprises: A control module is used to configure multiple types of test data corresponding to multiple expected labeling results according to the labeling algorithm; A testing module, configured to mark the test data based on the marking algorithm to obtain a test marking result; The control module is further configured to determine a test result of the marking algorithm based on the expected marking result and the test marking result; The test data includes at least one message under test and token bucket quantity data for marking the message under test; The first detector is used to detect the water level in the token bucket based on the first sampling period to obtain token water level data; after the first device sends the tested message in the test data to the second device, the second detector is used to detect the token reduction in the token bucket to obtain token reduction data; the third detector is used to detect the token increase in the token bucket based on the second sampling period to obtain token increase data; the test module is also used to determine the token bucket test data according to the token water level data, the token reduction data and the token increase data; wherein the test result includes the token bucket situation result; the control module is specifically used to: determine whether the token bucket test data is consistent with the token bucket expected data corresponding to the expected marking result; if it is determined that the token bucket test data is consistent with the token bucket expected data, then the token bucket situation result of the marking algorithm is generated as passed; if it is determined that the token bucket test data is not consistent with the token bucket expected data, then the token bucket situation result of the marking algorithm is generated as failed.
7. An electronic device, characterized in that: The electronic device includes a memory and a processor, wherein program instructions are stored in the memory, and when the processor runs the program instructions, the steps of the method according to any one of claims 1 to 5 are executed.
8. A computer-readable storage medium, characterized in that: The readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the steps of the method according to any one of claims 1 to 5 are executed.
Citation Information
Patent Citations
Data flow testing method and system
CN111382069A