Test method, device, apparatus, non-transitory storage medium, and electronic device

By using protocol configuration libraries and container technology, multi-protocol stress testing was implemented, which solved the problems of resource waste and increased costs caused by single protocols in existing technologies, supports high-concurrency connections, and improves server resource utilization.

CN117176607BActive Publication Date: 2026-05-19CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TELECOM CORP LTD
Filing Date
2023-09-08
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing technologies cannot effectively perform multi-protocol stress testing, resulting in wasted server resources and increased costs, and cannot effectively utilize client-side server resources.

Method used

The system obtains the image data of the target protocol from the protocol configuration library, injects it into the target container in the preset container set, and binds it to the target network sub-interface in the preset interface set. It then sends test traffic to the server according to the target interface address to perform stress testing, supporting the generation of test traffic for multiple protocols.

Benefits of technology

It implements stress testing based on multiple protocols, solving the problems of resource waste and increased costs caused by a single protocol type, supporting tens of millions of concurrent connections, and improving server resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117176607B_ABST
    Figure CN117176607B_ABST
Patent Text Reader

Abstract

The application discloses a test method, device, apparatus, nonvolatile storage medium and electronic device. The method comprises the following steps: obtaining target image data of a target protocol from a protocol configuration library, wherein the protocol configuration library is used for storing image data of multiple preset protocols; injecting the target image data into a target container in a preset container set, wherein the preset container set comprises multiple preset containers, and the target container is used for generating test traffic based on the target protocol; binding the target container with a target network sub-interface in a preset interface set, wherein the preset interface set comprises multiple preset network sub-interfaces, the target network sub-interface has a pre-bound target interface address, and the target interface address is used for connecting a server; and sending the test traffic to the server according to the target interface address, wherein the server performs stress testing on the test traffic sent according to the target interface address. The application solves the technical problem that stress testing cannot be performed based on multiple protocols.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network testing, and more specifically, to a testing method, equipment, apparatus, non-volatile storage medium, and electronic device. Background Technology

[0002] Currently, the protocols supported by the client are relatively limited and lack versatility. Therefore, when multi-protocol stress testing is required, it is necessary to establish a cluster to perform stress tests based on different protocols. However, expanding the cluster requires multiple servers, increasing server costs and related expenses, consuming a lot of energy, and failing to effectively utilize the client's server resources, resulting in resource waste. Adding clusters is also too cumbersome.

[0003] There is currently no effective solution to the problem of not being able to perform stress tests based on multiple protocols. Summary of the Invention

[0004] This invention provides a testing method, device, apparatus, non-volatile storage medium, and electronic device to at least solve the technical problem of being unable to perform stress testing based on multiple protocols.

[0005] According to one aspect of the present invention, a testing method is provided, comprising: obtaining target image data of a target protocol from a protocol configuration library, wherein the protocol configuration library is used to store image data of multiple preset protocols, the multiple preset protocols including at least: Transmission Control Protocol (TCP), Message Queuing Telemetry Transport Protocol (MQTT), and Lightweight Machine-to-Machine Protocol (LWM2M); injecting the target image data into a target container in a preset container set, wherein the preset container set includes multiple preset containers, and the target container is used to generate test traffic based on the target protocol; binding the target container to a target network sub-interface in a preset interface set, wherein the preset interface set includes multiple preset network sub-interfaces, the target network sub-interface has a pre-bound target interface address, the target interface address being used to connect to a server; and sending the test traffic to the server according to the target interface address, wherein the server performs stress testing based on the test traffic sent based on the target interface address.

[0006] Optionally, before binding the target container to the target network sub-interface, the method further includes: obtaining an initialization network sub-interface; obtaining a target interface address from a plurality of preset interface addresses recorded in the address resource pool; and binding the target interface address to the initialization network sub-interface to generate the target network sub-interface.

[0007] Optionally, the method further includes: storing multiple preset interface addresses through an address resource pool; and / or reclaiming preset interface addresses used by preset containers that have been destroyed through the address resource pool; and / or recording the usage of preset interface addresses through the address resource pool.

[0008] Optionally, binding the target container to the target network sub-interface includes: obtaining the target container address that has been pre-bound to the target container; obtaining the target interface address that has been pre-bound to the target network sub-interface; and binding the target container address and the target interface address using a firewall.

[0009] Optionally, before sending the test traffic to the server according to the target interface address, the method further includes: obtaining test parameters, wherein the test parameters are used to indicate the maximum concurrency of the target container sending the test traffic; gradually increasing the initial concurrency of the test traffic according to a preset increment rule until the test traffic reaches the maximum concurrency, wherein the preset increment rule includes at least one of the following: uniform increment, step increment, and fixed pressure increment.

[0010] Optionally, the method further includes: after gradually increasing the initial concurrency according to a preset increment rule, detecting the server's operation within a preset time period; if the operation indicates that the server is running stably, increasing the initial concurrency according to the preset increment rule; if the operation indicates that the server is running unstable, reverting to the initial concurrency before increasing according to the preset increment rule.

[0011] According to another aspect of the present invention, a testing device is also provided, comprising: a protocol configuration library for storing image data of multiple preset protocols, wherein the multiple preset protocols include at least: Transmission Control Protocol (TCP), Message Queuing Telemetry Transport Protocol (MQTT), and Lightweight Machine-to-Machine Protocol (LWM2M); a control module for obtaining target image data of a target protocol from the protocol configuration library, injecting the target image data into a target container in a preset container set; binding the target container to a target network sub-interface in a preset interface set, wherein the preset container set includes multiple preset containers; the target container for generating test traffic based on the target protocol; and the target network sub-interface for sending the test traffic to a server according to a target interface address, wherein the preset interface set includes multiple preset network sub-interfaces, the target network sub-interface has a pre-bound target interface address, the target interface address is used to connect to the server, and the server performs stress testing based on the test traffic sent by the target interface address.

[0012] According to another aspect of the present invention, a testing apparatus is also provided, comprising: an acquisition module, configured to acquire target image data of a target protocol from a protocol configuration library, wherein the protocol configuration library is configured to store image data of multiple preset protocols, the multiple preset protocols including at least: Transmission Control Protocol (TCP), Message Queuing Telemetry Transport Protocol (MQTT), and Lightweight Machine-to-Machine Protocol (LWM2M); an injection module, configured to inject the target image data into a target container in a preset container set, wherein the preset container set includes multiple preset containers, and the target container is used to generate test traffic based on the target protocol; a binding module, configured to bind the target container to a target network sub-interface in a preset interface set, wherein the preset interface set includes multiple preset network sub-interfaces, the target network sub-interface has a pre-bound target interface address, the target interface address being used to connect to a server; and a sending module, configured to send the test traffic to the server according to the target interface address, wherein the server performs stress testing based on the test traffic sent based on the target interface address.

[0013] According to another aspect of the present invention, a non-volatile storage medium is also provided, characterized in that the non-volatile storage medium is used to store a program, wherein the program controls the device where the non-volatile storage medium is located to execute the above-described test method during runtime.

[0014] According to another aspect of the present invention, an electronic device is also provided, characterized in that it includes: a memory and a processor, the processor being configured to run a program stored in the processor, wherein the program executes the above-described test method when it runs.

[0015] In this embodiment of the invention, target image data of a target protocol is obtained from a protocol configuration library, wherein the protocol configuration library is used to store image data of multiple preset protocols, including at least: Transmission Control Protocol (TCP), Message Queuing Telemetry Transport Protocol (MQTT), and Lightweight Machine-to-Machine Protocol (LWM2M); the target image data is injected into a target container in a preset container set, wherein the preset container set includes multiple preset containers, and the target container is used to generate test traffic based on the target protocol; the target container is bound to a target network sub-interface in a preset interface set, wherein the preset interface set includes multiple preset network sub-interfaces, and the target network sub-interface has a pre-bound target interface address, which is used to connect to the server; test traffic is sent to the server according to the target interface address, wherein the server performs stress testing based on the test traffic sent based on the target interface address; the multiple preset containers in the preset container set can be configured according to the image data of multiple preset protocols, and test traffic based on multiple protocols can be generated according to the configured multiple preset containers, thereby achieving the technical effect of stress testing based on multiple protocols, and thus solving the technical problem of not being able to perform stress testing based on multiple protocols. Attached Figure Description

[0016] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0017] Figure 1 This is a flowchart of a testing method according to an embodiment of the present invention;

[0018] Figure 2 This is a schematic diagram of a testing device according to an embodiment of the present invention;

[0019] Figure 3 This is a schematic diagram of a container-based high-concurrency multi-protocol stress test client according to an embodiment of the present invention;

[0020] Figure 4 This is a schematic diagram of a process for creating a target container according to an embodiment of the present invention;

[0021] Figure 5 This is a schematic diagram of a control module according to an embodiment of the present invention;

[0022] Figure 6 This is a schematic diagram of a container according to an embodiment of the present invention;

[0023] Figure 7 This is a schematic diagram of a protocol configuration library according to an embodiment of the present invention;

[0024] Figure 8This is a schematic diagram of an IP resource pool according to an embodiment of the present invention;

[0025] Figure 9 This is a schematic diagram of a testing apparatus according to an embodiment of the present invention;

[0026] Figure 10 This is a structural block diagram of a computer terminal according to an embodiment of the present invention. Detailed Implementation

[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0029] For ease of description, the following explains some of the nouns or terms used in the embodiments of this application:

[0030] TCP is a connection-oriented communication protocol that establishes a connection through a three-way handshake and tears down the connection when communication is complete. It is a byte-stream-based transport layer communication protocol.

[0031] MQTT is an asynchronous messaging protocol built on the TCP / IP protocol stack, used for publishing and subscribing to messages. It can operate in unreliable network environments, and publishers and subscribers do not need to establish a direct connection. Its advantages lie in its spatial and temporal decoupling; new subscribers joining the network do not require modifications to the publisher's behavior, and the absence of subscribers does not affect the publisher's ability to publish messages. Multiple publishers can publish messages to a single subscriber, and multiple subscribers can simultaneously receive messages from a single publisher.

[0032] LWM2M is a lightweight, standard IoT device management protocol that provides a compact and secure communication interface and an efficient data model to enable M2M device management and service support.

[0033] According to an embodiment of the present invention, a test method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0034] Figure 1 This is a flowchart of a testing method according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:

[0035] Step S102: Obtain target image data of the target protocol from the protocol configuration library. The protocol configuration library is used to store image data of multiple preset protocols. The multiple preset protocols include at least: Transmission Control Protocol TCP, Message Queuing Telemetry Transport Protocol MQTT, and Lightweight Machine-to-Machine Protocol LWM2M.

[0036] Step S104: Inject the target image data into the target container in the preset container set, wherein the preset container set includes multiple preset containers, and the target container is used to generate test traffic based on the target protocol;

[0037] Step S106: Bind the target container to the target network sub-interface in the preset interface set. The preset interface set includes multiple preset network sub-interfaces. The target network sub-interface has a pre-bound target interface address, which is used to connect to the server.

[0038] Step S108: Send test traffic to the server according to the target interface address, wherein the server performs stress testing based on the test traffic sent based on the target interface address.

[0039] In this embodiment of the invention, target image data of a target protocol is obtained from a protocol configuration library, wherein the protocol configuration library is used to store image data of multiple preset protocols, including at least: Transmission Control Protocol (TCP), Message Queuing Telemetry Transport Protocol (MQTT), and Lightweight Machine-to-Machine Protocol (LWM2M); the target image data is injected into a target container in a preset container set, wherein the preset container set includes multiple preset containers, and the target container is used to generate test traffic based on the target protocol; the target container is bound to a target network sub-interface in a preset interface set, wherein the preset interface set includes multiple preset network sub-interfaces, and the target network sub-interface has a pre-bound target interface address, which is used to connect to the server; test traffic is sent to the server according to the target interface address, wherein the server performs stress testing based on the test traffic sent based on the target interface address; the multiple preset containers in the preset container set can be configured according to the image data of multiple preset protocols, and test traffic based on multiple protocols can be generated according to the configured multiple preset containers, thereby achieving the technical effect of stress testing based on multiple protocols, and thus solving the technical problem of not being able to perform stress testing based on multiple protocols.

[0040] The above testing methods can be executed on the client used for stress testing.

[0041] In step S102 above, the protocol configuration library can record the configuration information of various preset protocols in the form of image data. The configuration information of each preset protocol is recorded as the corresponding preset image data. When configuring a target container, the target image data can be obtained from the protocol configuration library according to the target protocol required by the target container, and then the target image data can be input into the target container to realize the configuration of the target container.

[0042] In step S104 above, the preset container set includes multiple preset containers built using container Docker technology.

[0043] It's important to note that Docker is an open-source virtualization technology that packages an application and all its dependencies into a single container, enabling it to run on any operating system. Docker provides a lightweight, portable, and scalable way to encapsulate applications and offers a suite of tools and platforms for managing and deploying these containers. By using Docker, users can build, deliver, and run applications more quickly and easily, improving development and deployment efficiency.

[0044] In step S104 above, the target container can be a container initialized in a preset container set. By initializing the container, the target container can be obtained, and then the target image data can be injected into the target container to configure the target container.

[0045] Optionally, the client can set up multiple preset containers, and the target container can be a preset container into which the target image data is injected.

[0046] Optionally, the preset containers in the preset container set can be injected with image data of different preset protocols.

[0047] For example, the preset container set includes: a preset container for injecting mirrored data of the Transmission Control Protocol TCP, a preset container for injecting mirrored data of the Message Queuing Telemetry Transport Protocol MQTT, and a preset container for injecting mirrored data of the Lightweight Machine-to-Machine Protocol LWM2M.

[0048] Optionally, the image data of each preset protocol can be injected into multiple preset containers, and stress tests on the same preset protocol can be performed jointly by multiple preset containers.

[0049] Optionally, multiple target containers using the same target protocol can increase the concurrency of test traffic, enabling high-concurrency stress testing.

[0050] In step S104 above, the target container can generate multiple connection requests to the server, and these multiple connection requests together serve as the test traffic for the target container.

[0051] In step S106 above, the target network sub-interface can be pre-bound to the target interface address, and the target network sub-interface and the server can be connected through the target interface address, thereby binding the target container to the target network sub-interface. Test traffic generated by the target container can be sent to the server through the target network sub-interface.

[0052] Optionally, multiple preset network sub-interfaces in the preset container set can be bound to multiple preset containers, and each preset network sub-interface can be bound to one preset container.

[0053] Optionally, the client can set multiple preset network sub-interfaces, each preset network sub-interface being bound to a different preset interface address, with the target container being the target network sub-interface among the multiple preset network sub-interfaces.

[0054] In step S108 above, the server receives test traffic from the target container and can obtain multiple connection requests based on the target protocol. By testing the server's ability to handle multiple connection requests, stress testing of the server can be achieved.

[0055] As an optional embodiment, before binding the target container to the target network sub-interface, the method further includes: obtaining an initialization network sub-interface; obtaining a target interface address from a plurality of preset interface addresses recorded in the address resource pool; and binding the target interface address to the initialization network sub-interface to generate a target network sub-interface.

[0056] In the above embodiments of the present invention, the address resource pool can record multiple preset interface addresses. Based on the preset interface addresses recorded in the address resource pool, an initialization network sub-interface can be bound and the server connected to each initialization network sub-interface can be determined. The connection relationship between the container and the server can be established through the network sub-interface, and stress testing can be performed based on the connection relationship established by the network sub-interface.

[0057] Optionally, the preset interface addresses recorded in the address resource pool need to be on the same network segment as the client and the server.

[0058] As an optional embodiment, the method further includes: storing multiple preset interface addresses through an address resource pool; and / or reclaiming preset interface addresses used by preset containers that have been destroyed through the address resource pool; and / or recording the usage of preset interface addresses through the address resource pool.

[0059] In the above embodiments of the present invention, the address resource pool can store multiple preset interface addresses. The preset interface addresses stored in the address resource pool can be pre-set or recycled after the preset container that has completed stress testing is destroyed. Furthermore, the address resource pool can record the usage of the preset interface addresses, which facilitates the management of the preset interface addresses in the address resource pool.

[0060] It should be noted that after a stress test is completed using a preset container, the preset container can be destroyed. Since the preset container has a preset network sub-interface bound to it during the stress test, the preset network sub-interface will also be destroyed after the preset container is destroyed. The preset interface address bound to the preset network sub-interface can then be recycled to the address resource pool for reallocation.

[0061] As an optional embodiment, binding the target container to the target network sub-interface includes: obtaining the target container address that has been pre-bound to the target container; obtaining the target interface address that has been pre-bound to the target network sub-interface; and binding the target container address and the target interface address using a firewall.

[0062] In the above embodiments of the present invention, the target container has a bound target container address, and the target network sub-interface has a bound target interface address. By using a firewall to bind the target container address and the target interface address, the binding of the target container and the target network sub-interface can be achieved.

[0063] As an optional embodiment, before sending test traffic to the server according to the target interface address, the method further includes: obtaining test parameters, wherein the test parameters are used to indicate the maximum concurrency of the target container sending test traffic; gradually increasing the initial concurrency of the test traffic according to a preset increment rule until the test traffic reaches the maximum concurrency, wherein the preset increment rule includes at least one of the following: uniform increment, step increment, and fixed pressure increment.

[0064] In the above embodiments of the present invention, stress testing represents the server's ability to process test traffic sent to the target container. If the target container directly sends test traffic to the server at the maximum concurrency, it may cause the server to crash directly, and the accurate results of the stress test cannot be obtained. Therefore, test traffic is first sent at the initial concurrency to perform stress testing, and then the concurrency of the test traffic is gradually increased until the test traffic reaches the maximum concurrency, ensuring that the server can still run stably during the stress test and guaranteeing the stability of the service.

[0065] As an optional embodiment, the method further includes: after gradually increasing the initial concurrency according to a preset incremental rule, detecting the server's operation within a preset time period; if the operation indicates that the server is running stably, increasing the initial concurrency according to the preset incremental rule; if the operation indicates that the server is running unstable, reverting to the initial concurrency before increasing according to the preset incremental rule.

[0066] In the above embodiments of the present invention, after increasing the traffic, the server is allowed to run stably for a period of time to observe its performance. If a bottleneck is found in the dependent service or component, the load test traffic can be reduced first, for example, by rolling back to the concurrency of the previous load test to ensure the stability of the service. Then, the capacity of the service or component is expanded, and then the traffic load test is increased again.

[0067] As an optional embodiment, the method further includes: designing a protocol configuration library using the factory pattern, wherein the protocol configuration library is used to set up corresponding instances for different planning conditions, each instance representing a server framework, and the framework uses at least one preset protocol as a product class to jointly implement a preset network sub-interface.

[0068] In the above embodiments of the present invention, the protocol configuration library is designed using the factory pattern, which can create different instances under different planning conditions. The designed connection server framework has a variety of preset protocols to choose from: MQTT, LWM2M, TUP, etc. These preset protocols are treated as product classes and jointly implement an interface.

[0069] As an optional embodiment, injecting target image data into a target container in a preset container set includes: establishing a concurrent connection on a device gateway according to target configuration information, wherein the device gateway is used to establish a connection relationship between the target container and the server based on the target protocol; sending a first message to the server according to test traffic; and receiving a second message from the server.

[0070] In the above embodiments of the present invention, the test traffic represents multiple first messages sent by the target container to the server. Based on the server's processing capacity for the first messages in the test traffic, a stress test on the server can be completed. Furthermore, the target container can also receive second messages from the server, through which it can learn about the server's processing status of the first messages and the server's operating status.

[0071] Figure 2 This is a schematic diagram of a testing device according to an embodiment of the present invention, such as... Figure 2 As shown, it includes: a protocol configuration library 22, used to store image data of various preset protocols, wherein the various preset protocols include at least: Transmission Control Protocol (TCP), Message Queuing Telemetry Transport Protocol (MQTT), and Lightweight Machine-to-Machine Protocol (LWM2M); a control module 24, used to obtain target image data of the target protocol from the protocol configuration library, inject the target image data into the target container in the preset container set; bind the target container to the target network sub-interface in the preset interface set, wherein the preset container set includes multiple preset containers; a target container 26, used to generate test traffic based on the target protocol; and a target network sub-interface 28, used to send test traffic to the server according to the target interface address, wherein the preset interface set includes multiple preset network sub-interfaces, the target network sub-interface has a pre-bound target interface address, the target interface address is used to connect to the server, and the server performs stress testing based on the test traffic sent by the target interface address.

[0072] In this embodiment of the invention, target image data of a target protocol is obtained from a protocol configuration library, wherein the protocol configuration library is used to store image data of multiple preset protocols, including at least: Transmission Control Protocol (TCP), Message Queuing Telemetry Transport Protocol (MQTT), and Lightweight Machine-to-Machine Protocol (LWM2M); the target image data is injected into a target container in a preset container set, wherein the preset container set includes multiple preset containers, and the target container is used to generate test traffic based on the target protocol; the target container is bound to a target network sub-interface in a preset interface set, wherein the preset interface set includes multiple preset network sub-interfaces, and the target network sub-interface has a pre-bound target interface address, which is used to connect to the server; test traffic is sent to the server according to the target interface address, wherein the server performs stress testing based on the test traffic sent based on the target interface address; the multiple preset containers in the preset container set can be configured according to the image data of multiple preset protocols, and test traffic based on multiple protocols can be generated according to the configured multiple preset containers, thereby achieving the technical effect of stress testing based on multiple protocols, and thus solving the technical problem of not being able to perform stress testing based on multiple protocols.

[0073] The present invention also provides an optional embodiment, which provides a container-based end-to-end multi-protocol high-concurrency testing method. This testing method can solve the problems of existing client testing processes, such as single protocol type, poor universality, and the inability of a single server to achieve tens of millions of concurrent connections.

[0074] Figure 3 This is a schematic diagram of a container-based high-concurrency multi-protocol stress testing client according to an embodiment of the present invention, as shown below. Figure 3 As shown, it includes: a control module, a set of preset containers, a protocol configuration library, and an IP resource pool (i.e., an address resource pool).

[0075] Optionally, the control module is used to obtain a target interface address IP (192.XX1) to be allocated from the IP resource pool. This target interface address IP is used to bind the target network sub-interface of the client. The target container sends a request to the server through this target interface address IP. Each target interface address IP can establish a maximum of 65535 connections.

[0076] Optionally, the control module creates the target network sub-interface eth0:X and binds the target interface address IP (192.XX1) obtained above to the target network sub-interface (ifconfig eth0:x192.XX1netmask255.255.255.0up).

[0077] Optionally, the control module obtains the configuration information of the target protocol from the protocol configuration library module, that is, the image data of the target protocol.

[0078] Optionally, the control module builds image data with the target protocol. During the build process, the configuration information of the target protocol is injected into the target container, and a startup container is created (e.g., target container IP: 10.XX1).

[0079] Optionally, the control module uses the firewall iptables to bind the target container address IP of the target container to the target network sub-interface eth:X of the client (iptables -t nat -I postrouting -p all -s 10.XX1-js nat --to-source 192.XX1).

[0080] Optionally, the control module also includes a destruction module for destroying the target container after a performance evaluation (such as a stress test) is completed.

[0081] Optionally, when the client starts the program, the control module begins to build preset containers with different protocols. Multiple preset containers support multiple preset protocols. The control module receives the test target parameters input by the user through the parameter configurator and controls the preset containers to send the test traffic required for stress testing according to the test target parameters.

[0082] For example, the maximum concurrency of the overall system needs to reach 8 million requests per second. During stress testing, the test traffic will not be increased to 8 million requests per second all at once. Instead, the test traffic will be gradually increased according to a certain preset increment rule, supporting three increment methods: uniform increment, stepped increment, and fixed pressure increment. After increasing the test traffic once, the system (e.g., server) will be allowed to run stably for a period of time to observe its performance. If a bottleneck is found in a dependent service or component, the test traffic can be reduced first, for example, by rolling back to the concurrency of the previous test traffic to ensure service stability. Then, the service or component can be scaled up before increasing the test traffic again for stress testing.

[0083] Optionally, multiple preset containers in the preset container set send requests to the server to establish connections through the client's preset network sub-interface. Each preset container can establish a maximum of 65,535 connections. A client can establish a maximum of N (number of containers) * 65,535 connections, thereby achieving tens of millions of concurrent connections.

[0084] Figure 4 This is a schematic diagram of a process for creating a target container according to an embodiment of the present invention, such as... Figure 4As shown, the client network interface (eth0:192.XX245) is used. The control module creates a target network sub-interface (eth0:x), obtains the target interface address IP (192.XX1) from the IP resource pool (i.e., the address resource pool), and binds it to the target sub-interface (eth0:x192.XX1). Protocol information is obtained from the protocol configuration library, a Docker container is created, and the protocol information is injected into the container. Finally, iptables is used to bind the container's IP to the client sub-interface eth:0 (iptables -t nat-Ipostrouting -p all -s 10.XX1 -j snat --to-source 192.XX1).

[0085] Optionally, the IP resource pool (i.e., the address resource pool) stores preset interface addresses (IPs), provides preset interface addresses (IPs) for preset network sub-interfaces, recycles and destroys preset interface addresses (IPs), and records the usage of preset interface addresses (IPs).

[0086] Optionally, the preset interface address in the IP resource pool (i.e., the address resource pool) needs to be in the same network segment as the client and the server's IP address, so that other machines in the local area network can ping this preset interface address IP.

[0087] Alternatively, the target container can send a connection request to the server via the target interface address (IP).

[0088] Figure 5 This is a schematic diagram of a control module according to an embodiment of the present invention, such as... Figure 5 As shown, the control module includes: IP acquisition unit 51, network sub-interface creation unit 52, protocol information acquisition unit 53, container management unit 54, IP binding unit 55, scheduling unit 56, and parameter configurator unit 57.

[0089] Optionally, the IP acquisition unit 51 is used to obtain an interface address (such as a target interface address or a preset interface address) from the IP resource pool (i.e., the address resource pool) as the exit address of the network sub-interface (such as a target network sub-interface or a preset network sub-interface), through which the container (such as a target container or a preset container) can communicate with the server.

[0090] Optionally, a network sub-interface unit 52 is created to create a network sub-interface for the client, which is bound to the interface address obtained through the IP acquisition unit.

[0091] Optionally, the protocol information acquisition unit 53 is used to acquire configuration information of a preset protocol from the protocol configuration library. This configuration information will be put into the container in the form of image data. The container can send connection information to the server based on the preset protocol to establish a connection.

[0092] Optionally, the container management unit 54 is used to manage the lifecycle of containers, configure protocols according to protocol configuration information, connect to the device gateway, send connection requests, and receive server information.

[0093] Optionally, managing the lifecycle of a container includes: initializing the container, creating the container, starting the container, pausing the container, and destroying the container.

[0094] Optionally, initializing a container mainly involves performing some preparatory work for the container, such as obtaining image data and injecting specific configuration files (such as image data) into the container to enable the container to support the target protocol; creating a container indicates that the container has been successfully initialized; starting a container indicates that a container in a paused state has been started; pausing a container indicates that a container in a paused state has been paused; and destroying a container indicates that the container has been destroyed and cleaned up.

[0095] Optionally, the IP binding unit 55 is used to bind the container address IP (such as the target container address or the preset container address) of the container and the interface address IP (such as the target interface address or the preset interface address) of the network sub-interface (iptables-tnat-I postrouitng-p all-s XXXX-j snat--to-source XXXX), so that the test traffic of the container is sent to the server through the sub-interface address IP.

[0096] Optionally, the scheduling unit 56 is used to schedule the cooperation and interaction of each unit, calculate the number of containers required according to the concurrency requirements of the configuration, and call the container management unit to initialize the containers.

[0097] Optionally, the parameter configurator unit 57 is used to receive configuration parameters from the user, configure the load testing method, such as uniform incremental distribution, stepped incremental distribution, fixed pressure, and configure information such as the number of concurrent connections, protocol type, and number of containers.

[0098] Figure 6 This is a schematic diagram of a container according to an embodiment of the present invention, as shown below. Figure 6 As shown, the container includes: a protocol sampler 61, used to connect to the device gateway, send a first message, and receive a second message from the server according to the parameters configured in the protocol configuration library; a concurrent generator 62, used to call the protocol sampler, generate concurrent connections, and send data; and a concurrent adapter 63, used to call the concurrent generator.

[0099] Figure 7This is a schematic diagram of a protocol configuration library according to an embodiment of the present invention. As shown in the figure, the protocol configuration library includes: a protocol type factory 71, used to provide the control module with protocol information (or image data) of different preset protocols, and to call the protocol interface to create factories of different protocol types; a protocol interface 72, used to define an interface for creating protocol objects, allowing its subclasses to decide which factory class to instantiate, and the factory pattern delays the creation process to the subclass; and an implementation class 73, used to implement the protocol interface, providing multiple preset protocol types, such as MQTT, LWM2M, TUP, and TCP. Adding a new protocol type only requires adding this implementation class to complete the addition of protocol information.

[0100] Optionally, the protocol configuration library includes: a private protocol wrapper for encapsulating and parsing private protocol messages; the protocol configuration library is designed using the factory pattern, mainly to solve the problem of interface selection, and can create different instances under different planning conditions. It designs a framework for connecting to the server, and uses MQTT, LWM2M, and TCP as product classes to jointly implement an interface. If the protocol needs to be extended in the future, only the interface needs to be implemented.

[0101] This application proposes a protocol configuration library based on the factory pattern, combined with Docker container technology, enabling a single client to establish tens of millions of connections, achieve second-level scaling up and down, switch between multiple protocols, and test multi-protocol access to the server. Under high concurrency and high traffic, testers can observe the system's performance under peak load to identify potential performance issues in the system.

[0102] Figure 8 This is a schematic diagram of an IP resource pool according to an embodiment of the present invention, such as... Figure 8 As shown, the IP resource pool includes: IP library unit 81, IP allocation unit 82, and IP recycling unit 83.

[0103] Optionally, the IP library unit 81 is used to store an IP set, that is, to store multiple interface address IPs (such as target interface address or preset interface address), and supports adding, deleting, modifying, querying, freezing and unfreezing interface address IPs; where freezing means that the frozen interface address IP will not be used, and unfreezing means that the unfrozen interface address IP can be used normally.

[0104] Optionally, the IP allocation unit 82 is used to allocate an interface address IP to the control module and bind it to the client. This interface address IP serves as the exit point for the container to access the server.

[0105] Optionally, the IP recycling unit 83 is responsible for recycling the interface address IP bound to the network sub-interface after the container is destroyed, adding it back to the IP library for allocation in the next container creation.

[0106] This invention significantly reduces cluster client resources compared to current cluster models. Multiple containers running in parallel can fully utilize client resources, breaking through port limitations on a single machine to achieve tens of millions of concurrent connections. Using Docker containers, it enables second-level scaling up and down. The factory-pattern protocol configuration library offers excellent flexibility and scalability, allowing switching between multiple protocols. Adding a new protocol only requires implementing the factory class. It supports setting concurrent connection limits and three testing methods: uniform increment, stepped increment, and fixed pressure. The connection growth rate can be controlled by adjusting parameters during load testing.

[0107] According to an embodiment of the present invention, a testing device embodiment is also provided. It should be noted that the testing device can be used to execute the testing methods in the embodiments of the present invention, and the testing methods in the embodiments of the present invention can be executed in the testing device.

[0108] Figure 9 This is a schematic diagram of a testing apparatus according to an embodiment of the present invention, such as... Figure 9 As shown, the device may include: an acquisition module 92, used to acquire target image data of a target protocol from a protocol configuration library, wherein the protocol configuration library is used to store image data of multiple preset protocols, including at least: Transmission Control Protocol (TCP), Message Queuing Telemetry Transport Protocol (MQTT), and Lightweight Machine-to-Machine Protocol (LWM2M); an injection module 94, used to inject the target image data into a target container in a preset container set, wherein the preset container set includes multiple preset containers, and the target container is used to generate test traffic based on the target protocol; a binding module 96, used to bind the target container to a target network sub-interface in a preset interface set, wherein the preset interface set includes multiple preset network sub-interfaces, the target network sub-interface has a pre-bound target interface address, and the target interface address is used to connect to the server; and a sending module 98, used to send test traffic to the server according to the target interface address, wherein the server performs stress testing based on the test traffic sent based on the target interface address.

[0109] It should be noted that the acquisition module 92 in this embodiment can be used to execute step S102 in this application embodiment, the injection module 94 in this embodiment can be used to execute step S104 in this application embodiment, the binding module 96 in this embodiment can be used to execute step S106 in this application embodiment, and the sending module 98 in this embodiment can be used to execute step S108 in this application embodiment. The examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments.

[0110] In this embodiment of the invention, target image data of a target protocol is obtained from a protocol configuration library, wherein the protocol configuration library is used to store image data of multiple preset protocols, including at least: Transmission Control Protocol (TCP), Message Queuing Telemetry Transport Protocol (MQTT), and Lightweight Machine-to-Machine Protocol (LWM2M); the target image data is injected into a target container in a preset container set, wherein the preset container set includes multiple preset containers, and the target container is used to generate test traffic based on the target protocol; the target container is bound to a target network sub-interface in a preset interface set, wherein the preset interface set includes multiple preset network sub-interfaces, and the target network sub-interface has a pre-bound target interface address, which is used to connect to the server; test traffic is sent to the server according to the target interface address, wherein the server performs stress testing based on the test traffic sent based on the target interface address; the multiple preset containers in the preset container set can be configured according to the image data of multiple preset protocols, and test traffic based on multiple protocols can be generated according to the configured multiple preset containers, thereby achieving the technical effect of stress testing based on multiple protocols, and thus solving the technical problem of not being able to perform stress testing based on multiple protocols.

[0111] As an optional embodiment, the apparatus further includes: a first acquisition submodule, configured to acquire an initialization network subinterface before binding the target container to the target network subinterface; a second acquisition submodule, configured to acquire a target interface address from a plurality of preset interface addresses recorded in the address resource pool; and a binding submodule, configured to bind the target interface address to the initialization network subinterface to generate the target network subinterface.

[0112] As an optional embodiment, the device further includes: a first storage unit for storing multiple preset interface addresses through an address resource pool; and / or a second storage unit for recycling and destroying preset interface addresses used by preset containers through the address resource pool; and / or a third storage unit for recording the usage of preset interface addresses through the address resource pool.

[0113] As an optional embodiment, the binding module includes: a first acquisition unit for acquiring a target container address pre-bound to a target container; a second acquisition unit for acquiring a target interface address pre-bound to a target network sub-interface; and a binding unit for binding the target container address and the target interface address using a firewall.

[0114] As an optional embodiment, the apparatus further includes: a third acquisition submodule, configured to acquire test parameters before sending test traffic to the server according to the target interface address, wherein the test parameters are used to indicate the maximum concurrency of the target container sending test traffic; and a first increment submodule, configured to gradually increase the initial concurrency of the test traffic according to a preset increment rule until the test traffic reaches the maximum concurrency, wherein the preset increment rule includes at least one of the following: uniform increment, step increment, and fixed pressure increment.

[0115] As an optional embodiment, the device further includes: a detection submodule, used to detect the server's operation within a preset time period after gradually increasing the initial concurrency according to a preset incrementing rule; a second increase submodule, used to increase the initial concurrency according to a preset incrementing rule when the operation indicates that the server is running stably; and a rollback submodule, used to roll back to the initial concurrency before increasing according to the preset incrementing rule when the operation indicates that the server is running unstable.

[0116] Embodiments of the present invention can provide a computer terminal, which can be any computer terminal device in a group of computer terminals. Optionally, in this embodiment, the computer terminal can also be replaced by a mobile terminal or other terminal device.

[0117] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.

[0118] In this embodiment, the computer terminal described above can execute the program code for the following steps in the testing method: obtaining target image data of the target protocol from a protocol configuration library, wherein the protocol configuration library is used to store image data of various preset protocols, including at least: Transmission Control Protocol (TCP), Message Queuing Telemetry Transport Protocol (MQTT), and Lightweight Machine-to-Machine Protocol (LWM2M); injecting the target image data into a target container in a preset container set, wherein the preset container set includes multiple preset containers, and the target container is used to generate test traffic based on the target protocol; binding the target container to a target network sub-interface in a preset interface set, wherein the preset interface set includes multiple preset network sub-interfaces, the target network sub-interface has a pre-bound target interface address, and the target interface address is used to connect to the server; sending test traffic to the server according to the target interface address, wherein the server performs stress testing based on the test traffic sent based on the target interface address.

[0119] Optionally, Figure 10 This is a structural block diagram of a computer terminal according to an embodiment of the present invention. Figure 10As shown, the computer terminal 1000 may include one or more (only one is shown in the figure) processors 1002 and memory 1004.

[0120] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the test method and apparatus in this embodiment of the invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the aforementioned test method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal 1000 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0121] The processor can invoke information and applications stored in memory via a transmission device to perform the following steps: obtaining target image data for a target protocol from a protocol configuration library, wherein the protocol configuration library stores image data for various preset protocols, including at least: Transmission Control Protocol (TCP), Message Queuing Telemetry Transport Protocol (MQTT), and Lightweight Machine-to-Machine Protocol (LWM2M); injecting the target image data into a target container in a preset container set, wherein the preset container set includes multiple preset containers, and the target container is used to generate test traffic based on the target protocol; binding the target container to a target network sub-interface in a preset interface set, wherein the preset interface set includes multiple preset network sub-interfaces, and the target network sub-interface has a pre-bound target interface address, which is used to connect to the server; and sending test traffic to the server according to the target interface address, wherein the server performs stress testing based on the test traffic sent according to the target interface address.

[0122] Optionally, the processor may also execute program code that performs the following steps: before binding the target container to the target network sub-interface, obtain the initialization network sub-interface; obtain the target interface address from multiple preset interface addresses recorded in the address resource pool; bind the target interface address to the initialization network sub-interface to generate the target network sub-interface.

[0123] Optionally, the processor may also execute program code that performs the following steps: storing multiple preset interface addresses through an address resource pool; and / or reclaiming preset interface addresses used by destroyed preset containers through the address resource pool; and / or recording the usage of preset interface addresses through the address resource pool.

[0124] Optionally, the processor may also execute program code that performs the following steps: obtains the target container address pre-bound to the target container; obtains the target interface address pre-bound to the target network sub-interface; and binds the target container address and the target interface address using a firewall.

[0125] Optionally, the processor may also execute program code that performs the following steps: before sending test traffic to the server according to the target interface address, obtain test parameters, wherein the test parameters are used to indicate the maximum concurrency of the target container sending test traffic; gradually increase the initial concurrency of the test traffic according to a preset increment rule until the test traffic reaches the maximum concurrency, wherein the preset increment rule includes at least one of the following: uniform increment, step increment, and fixed pressure increment.

[0126] Optionally, the processor may also execute program code that performs the following steps: after gradually increasing the initial concurrency according to a preset increment rule, detect the server's operation within a preset time period; if the operation indicates that the server is running stably, increase the initial concurrency according to the preset increment rule; if the operation indicates that the server is running unstable, revert to the initial concurrency before increasing according to the preset increment rule.

[0127] This invention provides a testing scheme. In this embodiment, target image data of a target protocol is obtained from a protocol configuration library, which stores image data for multiple preset protocols, including at least: Transmission Control Protocol (TCP), Message Queuing Telemetry Transport Protocol (MQTT), and Lightweight Machine-to-Machine Protocol (LWM2M). The target image data is injected into a target container in a preset container set, which includes multiple preset containers. The target container is used to generate test traffic based on the target protocol. The target container is bound to a target network sub-interface in a preset interface set, which includes multiple preset network sub-interfaces. The target network sub-interface has a pre-bound target interface address used to connect to the server. Test traffic is sent to the server according to the target interface address, and the server performs stress testing based on the test traffic sent by the target interface address. The multiple preset containers in the preset container set can be configured according to the image data of multiple preset protocols. Based on the configured multiple preset containers, test traffic based on multiple protocols can be generated, thereby achieving the technical effect of stress testing based on multiple protocols and solving the technical problem of not being able to perform stress testing based on multiple protocols.

[0128] Those skilled in the art will understand that Figure 10The structure shown is for illustrative purposes only. The computer terminal can also be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a mobile internet device (MID), a PAD, and other terminal devices. Figure 10 This does not limit the structure of the aforementioned electronic device. For example, the computer terminal 1000 may also include components that are more advanced than those described above. Figure 10 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 10 The different configurations shown.

[0129] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a non-volatile medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0130] Embodiments of the present invention also provide a non-volatile storage medium. Optionally, in this embodiment, the non-volatile storage medium can be used to store the program code executed by the test method provided in the above embodiments.

[0131] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0132] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: obtaining target image data of a target protocol from a protocol configuration library, wherein the protocol configuration library is used to store image data of multiple preset protocols, including at least: Transmission Control Protocol (TCP), Message Queuing Telemetry Transport Protocol (MQTT), and Lightweight Machine-to-Machine Protocol (LWM2M); injecting the target image data into a target container in a preset container set, wherein the preset container set includes multiple preset containers, and the target container is used to generate test traffic based on the target protocol; binding the target container to a target network sub-interface in a preset interface set, wherein the preset interface set includes multiple preset network sub-interfaces, the target network sub-interface has a pre-bound target interface address, and the target interface address is used to connect to the server; sending test traffic to the server according to the target interface address, wherein the server performs stress testing based on the test traffic sent based on the target interface address.

[0133] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: obtaining an initialization network sub-interface before binding the target container to the target network sub-interface; obtaining the target interface address from a plurality of preset interface addresses recorded in the address resource pool; binding the target interface address to the initialization network sub-interface to generate the target network sub-interface.

[0134] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: storing multiple preset interface addresses through an address resource pool; and / or reclaiming preset interface addresses used by preset containers that have been destroyed through the address resource pool; and / or recording the usage of preset interface addresses through the address resource pool.

[0135] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: obtaining the target container address pre-bound to the target container; obtaining the target interface address pre-bound to the target network sub-interface; and binding the target container address and the target interface address using a firewall.

[0136] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: before sending test traffic to the server according to the target interface address, obtaining test parameters, wherein the test parameters are used to indicate the maximum concurrency of the target container sending test traffic; gradually increasing the initial concurrency of the test traffic according to a preset increment rule until the test traffic reaches the maximum concurrency, wherein the preset increment rule includes at least one of the following: uniform increment, step increment, and fixed pressure increment.

[0137] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: after gradually increasing the initial concurrency according to a preset increment rule, detecting the server's operation within a preset time period; if the operation indicates that the server is running stably, increasing the initial concurrency according to the preset increment rule; if the operation indicates that the server is running unstable, reverting to the initial concurrency before increasing according to the preset increment rule.

[0138] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0139] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0140] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0141] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0142] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0143] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a non-volatile storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned non-volatile storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0144] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A testing method, characterized in that, include: Obtain target image data of the target protocol from the protocol configuration library, wherein the protocol configuration library is used to store image data of a variety of preset protocols, and the variety of preset protocols include at least: Transmission Control Protocol TCP, Message Queuing Telemetry Transport Protocol MQTT, and Lightweight Machine-to-Machine Protocol LWM2M; The target image data is injected into a target container in a preset container set, wherein the preset container set includes multiple preset containers, and the target container is used to generate test traffic based on the target protocol; The target container is bound to a target network sub-interface in a preset interface set, wherein the preset interface set includes multiple preset network sub-interfaces, and the target network sub-interface has a pre-bound target interface address, which is used to connect to the server; The test traffic is sent to the server according to the target interface address, wherein the server performs stress testing based on the test traffic sent based on the target interface address.

2. The method according to claim 1, characterized in that, Before binding the target container to the target network sub-interface, the method further includes: Get the initialization network sub-interface; Obtain the target interface address from multiple preset interface addresses recorded in the address resource pool; The target interface address is bound to the initialization network sub-interface to generate the target network sub-interface.

3. The method according to claim 2, characterized in that, The method further includes: Storing multiple preset interface addresses through an address resource pool; and / or The preset interface address used by the preset container is reclaimed and destroyed through the address resource pool; and / or The usage of preset interface addresses is recorded through an address resource pool.

4. The method according to claim 1, characterized in that, Binding the target container to the target network sub-interface includes: Obtain the target container address that has been pre-bound to the target container; Obtain the target interface address that has been pre-bound to the target network sub-interface; The firewall is used to bind the target container address and the target interface address.

5. The method according to claim 1, characterized in that, Before sending the test traffic to the server according to the target interface address, the method further includes: Obtain test parameters, wherein the test parameters are used to indicate the maximum concurrency of the target container sending the test traffic; The initial concurrency of the test traffic is gradually increased according to a preset increment rule until the test traffic reaches the maximum concurrency. The preset increment rule includes at least one of the following: uniform increment, step increment, and fixed pressure increment.

6. The method according to claim 5, characterized in that, The method further includes: After gradually increasing the initial concurrency according to a preset incremental rule, the server's operation is detected within a preset time period; If the server is running stably as indicated by the operating status, the initial concurrency is increased according to the preset incremental rule; If the server is unstable as indicated by the operating conditions, the system will revert to the initial concurrency level before the increase according to the preset incremental rule.

7. A testing device, characterized in that, include: A protocol configuration library is used to store image data of various preset protocols, wherein the various preset protocols include at least: Transmission Control Protocol TCP, Message Queuing Telemetry Transport Protocol MQTT, and Lightweight Machine-to-Machine Protocol LWM2M; The control module is used to obtain target image data of the target protocol from the protocol configuration library, inject the target image data into the target container in the preset container set, and bind the target container to the target network sub-interface in the preset interface set, wherein the preset container set includes multiple preset containers; The target container is used to generate test traffic based on the target protocol; The target network sub-interface is used to send the test traffic to the server according to the target interface address. The preset interface set includes multiple preset network sub-interfaces. The target network sub-interface has a pre-bound target interface address. The target interface address is used to connect to the server. The server performs stress testing based on the test traffic sent by the target interface address.

8. A testing device, characterized in that, include: The acquisition module is used to acquire target image data of a target protocol from the protocol configuration library. The protocol configuration library is used to store image data of a variety of preset protocols. The variety of preset protocols include at least: Transmission Control Protocol TCP, Message Queuing Telemetry Transport Protocol MQTT, and Lightweight Machine-to-Machine Protocol LWM2M. An injection module is used to inject the target image data into a target container in a preset container set, wherein the preset container set includes multiple preset containers, and the target container is used to generate test traffic based on the target protocol; A binding module is used to bind the target container to a target network sub-interface in a preset interface set, wherein the preset interface set includes multiple preset network sub-interfaces, and the target network sub-interface has a pre-bound target interface address, which is used to connect to the server; The sending module is used to send the test traffic to the server according to the target interface address, wherein the server performs stress testing based on the test traffic sent based on the target interface address.

9. A non-volatile storage medium, characterized in that, The non-volatile storage medium is used to store a program, wherein, when the program is running, the device containing the non-volatile storage medium is controlled to execute the test method according to any one of claims 1 to 6.

10. An electronic device, characterized in that, include: A memory and a processor, the processor being configured to run a program stored in the processor, wherein the program, when executed, performs the test method according to any one of claims 1 to 6.