Test systems, methods, apparatus, storage media, and computer program products

By generating simulated objects to interact with the IoT platform, defining interface communication protocols, and establishing communication links and channels, the problem of simulating abnormal scenarios of multi-protocol interfaces in IoT platform testing was solved, achieving efficient test sufficiency and stability.

CN118827451BActive Publication Date: 2026-02-24CHINA MOBILE M2M +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410387225.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-01
Publication Date
2026-02-24
Estimated Expiration
2044-04-01

AI Technical Summary

Technical Problem

In automated testing of IoT platforms, it is difficult to simulate abnormal scenarios under interfaces with multiple different protocols, and it is difficult to guarantee stability and sufficiency of testing when connecting to real business services, resulting in difficulties and high costs in troubleshooting.

Method used

By generating simulated objects to interact with the IoT platform, defining interface communication protocols, establishing communication links and channels, and using a message distribution center for data forwarding, data transmission and reception and anomaly testing of multiple clients can be achieved.

Benefits of technology

It improves the sufficiency and effectiveness of IoT platform testing, enabling the simulation of multiple clients on the same computer to quickly detect product issues and reduce development complexity and testing costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118827451B_ABST
    Figure CN118827451B_ABST
Patent Text Reader

Abstract

The application discloses a test system, a test method, a test device, a storage medium and a computer program product, at least one simulation object for information interaction with an Internet of Things platform is generated according to configuration parameters, and a communication protocol of at least one interface in the Internet of Things platform is defined; a communication link with each interface is established through a transmission management module, and a communication channel with each simulation object is established, the transmission management module is used to uniformly maintain the connection of the communication link, bidirectional forwarding of data messages is realized according to a mapping relationship between the communication link and the communication channel, and the information interaction process of the simulation object and the Internet of Things platform is controlled, so that data transmission and reception of multiple clients can be simulated on the same computer, abnormal test of each interface of the Internet of Things platform is met, and the sufficiency and effectiveness of the test are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Internet of Things (IoT), and more particularly to a testing system, method, apparatus, storage medium, and computer program product. Background Technology

[0002] With the development of IoT technology, the number of IoT devices is increasing exponentially. A large number of terminal devices connect to device gateways through various protocol components, and then to IoT platforms. These IoT platforms simultaneously support the integration of various business services. In actual IoT product development, for IoT platforms supporting multiple interfaces, automated testing typically involves the IoT platform integrating with real business services after the business service development is complete, and the automated testing framework simulating terminal message sending and receiving for testing. However, when the platform under test (IoT platform) has multiple interfaces with different protocols, the solution for integrating the platform with real services requires ensuring the availability of stable real services in advance. Often, the platform and business services are developed by different teams, and some third-party business services are even developed by external companies. It is difficult to guarantee the provision of stable business services according to the development plan, leading to significant difficulties in troubleshooting and high delivery costs. Furthermore, because the integration involves real business services, it is difficult to trigger tests for certain abnormal scenarios. Summary of the Invention

[0003] The purpose of this invention is to provide a testing system, method, device, storage medium, and computer program product that, by controlling the information interaction process between the simulated object and the Internet of Things (IoT) platform, can simulate the data transmission and reception of multiple clients on the same computer, satisfying the anomaly testing of various interfaces of the IoT platform and improving the sufficiency and effectiveness of the testing.

[0004] To achieve the above objectives, embodiments of the present invention provide a testing system, comprising:

[0005] The agent management module is used to generate at least one simulated object that interacts with the IoT platform based on configuration parameters.

[0006] Protocol components are used to define the communication protocol for at least one interface in the IoT platform;

[0007] The transmission management module is used to establish a communication link with each interface and a communication channel with each simulated object, and to forward messages through the communication link and the communication channel.

[0008] As an improvement to the above solution, the transmission management module includes:

[0009] The message distribution center is used to look up the corresponding communication channel in a preset mapping table when it receives downlink data sent by the IoT platform; it is also used to look up the corresponding communication link in the mapping table when it receives uplink data sent by the simulated object.

[0010] A communication channel is used to send the downlink data to the corresponding simulated object, and to send the uplink data sent by the simulated object to the message distribution center.

[0011] As an improvement to the above scheme, the message distribution center is used for:

[0012] When receiving downlink data sent by the IoT platform, the destination address in the downlink data is obtained, and the target communication channel corresponding to the destination address is found in the mapping table, so as to send the downlink data to the corresponding simulated object through the target communication channel;

[0013] Upon receiving uplink data sent by the simulated object, the target interface corresponding to the simulated object is obtained, and the target communication link corresponding to the target interface is searched in the mapping table so as to send the uplink data to the IoT platform through the target communication link.

[0014] As an improvement to the above scheme, the communication channel is a Channel.

[0015] As an improvement to the above scheme, each communication channel is associated with a linear communication model; wherein, the linear communication model has several Handlers, and when the communication channel transmits data, the Handlers perform data processing.

[0016] As an improvement to the above solution, the testing system further includes:

[0017] A protocol encoder is used to serialize the message object sent by the transmission management module, so as to encode the message object into a byte sequence;

[0018] A protocol decoder is used to deserialize the byte sequence received by the transmission management module to convert the byte sequence into a message object.

[0019] As an improvement to the above scheme, the configuration parameters include device parameters, IP parameters, port parameters, and protocol type.

[0020] To achieve the above objectives, embodiments of the present invention also provide a testing method, comprising:

[0021] Generate at least one simulated object that interacts with the IoT platform based on the configuration parameters;

[0022] Define the communication protocol for at least one interface in the IoT platform;

[0023] A communication link is established with each interface, and a communication channel is established with each simulated object, and messages are forwarded through the communication link and the communication channel.

[0024] To achieve the above objectives, embodiments of the present invention also provide a testing device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the testing method as described in the above embodiments.

[0025] To achieve the above objectives, embodiments of the present invention also provide a computer-readable storage medium, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the test method as described in the above embodiments.

[0026] To achieve the above objectives, embodiments of the present invention also provide a computer program product, including a computer program / instructions, which, when executed by a processor, implement the testing method as described in the above embodiments.

[0027] Compared to existing technologies, the testing system, method, device, storage medium, and computer program product disclosed in this invention generate at least one simulated object that interacts with an IoT platform based on configuration parameters, and define the communication protocol for at least one interface in the IoT platform; establishes a communication link with each interface and a communication channel with each simulated object through a transmission management module, uses the transmission management module to uniformly maintain the connection of the communication links, and realizes bidirectional forwarding of data packets according to the mapping relationship between communication links and communication channels. By controlling the information interaction process between the simulated object and the IoT platform, it is possible to simulate the data transmission and reception of multiple clients on the same computer, satisfying the abnormal testing of various interfaces of the IoT platform and improving the sufficiency and effectiveness of the test. Attached Figure Description

[0028] Figure 1 This is a structural block diagram of a testing system provided in an embodiment of the present invention;

[0029] Figure 2 This is a schematic diagram showing the connection between the testing system and the Internet of Things platform provided in an embodiment of the present invention;

[0030] Figure 3 This is another connection diagram of the testing system and the Internet of Things platform provided in this embodiment of the invention;

[0031] Figure 4 This is a schematic diagram of the framework of the linear communication model provided in an embodiment of the present invention;

[0032] Figure 5 This is a structural block diagram of another testing system provided in an embodiment of the present invention;

[0033] Figure 6 This is a flowchart of a testing method provided in an embodiment of the present invention;

[0034] Figure 7 This is a structural block diagram of a testing device provided in an embodiment of the present invention. Detailed Implementation

[0035] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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 are within the scope of protection of the present invention.

[0036] See Figure 1 , Figure 1 This is a structural block diagram of a testing system 100 provided in an embodiment of the present invention. The testing system 100 includes:

[0037] Agent management module 11 is used to generate at least one simulated object that interacts with the IoT platform based on configuration parameters;

[0038] Protocol component 12 is used to define the communication protocol of at least one interface in the IoT platform;

[0039] The transmission management module 13 is used to establish a communication link with each interface and a communication channel with each simulated object, and to forward messages through the communication link and the communication channel.

[0040] For example, the test system 100 is used to test an IoT platform. It can independently test IoT platforms with multiple interfaces. The agent management module 11 generates at least one simulated object that interacts with the IoT platform according to configuration parameters. The protocol component 12 defines the communication protocol for at least one interface in the IoT platform. Finally, the transmission management module 13 establishes a communication link with each interface and a communication channel with each simulated object. The transmission management module 13 uniformly maintains the connection of the communication links and realizes bidirectional forwarding of data packets according to the mapping relationship between communication links and communication channels. Figure 2As shown, the test system 100 generates several simulated objects such as simulated terminals and business services through the agent management module 11. By controlling the information interaction process between the simulated objects and the Internet of Things platform, it can simulate the data transmission and reception of multiple clients on the same computer, meet the abnormal testing of various interfaces of the Internet of Things platform, quickly detect product problems, and improve the sufficiency and effectiveness of the test.

[0041] Specifically, the agent management module 11 is responsible for the generation, destruction, and business logic processing of the simulator. Simulated objects are generated according to configuration parameters. When the test script ends, the agent management module 11 destroys the simulated objects and releases resources. The simulated objects can then call other modules to perform business processing such as sending and receiving messages.

[0042] For example, the configuration parameters include device parameters, IP parameters, port parameters, and protocol type; wherein, the device parameters include device type and device ID, the IP parameters include local IP address and peer IP address, and the port parameters include local port number and peer port number. The data type of each configuration parameter can be found in Table 1.

[0043] Table 1 Data Types of Configuration Parameters

[0044] Configuration parameters Data types Equipment type String Device ID Integer Local IP address String Local port number Integer peer IP address String peer port number Integer Protocol type String

[0045] Specifically, the protocol component 12 supports adding communication protocols as needed to meet the testing requirements of supporting multiple protocol interfaces simultaneously. The protocol component 12 defines a unified protocol framework and general interfaces. Newly added protocols only need to implement the general interfaces Receive Handler (which is mainly used for asynchronous message processing) and Send Handler to be integrated into the test system 100. The specific business logic of each protocol is implemented in the general interfaces.

[0046] Specifically, the transmission management module 13 includes:

[0047] The message distribution center 131 is used to look up the corresponding communication channel in a preset mapping table when it receives downlink data sent by the IoT platform; it is also used to look up the corresponding communication link in the mapping table when it receives uplink data sent by the simulated object.

[0048] Communication channel 132 is used to send the downlink data to the corresponding simulated object, and to send the uplink data sent by the simulated object to the message distribution center.

[0049] For example, see Figure 3 , Figure 3This is another connection diagram of the test system and IoT platform provided in this embodiment of the invention. The message distribution center 131 is a Dispatcher module, through which all received messages are forwarded to other corresponding modules. The message distribution center 131 is connected to interfaces a to c of the IoT platform via three communication links. Different communication links can use different communication protocols, defined by the protocol component 12. The communication protocols include, but are not limited to, MQTT (Message Queuing Telemetry Transport), COAP (Constrained Application Protocol), and HTTP (Hypertext Transfer Protocol). For example, the communication link between interface a and the message distribution center 131 uses the MQTT protocol. The message distribution center 131 is connected to the simulated terminal 1, simulated terminal 2, and business service in the simulated object via three communication channels a to c. It is worth noting that... Figure 3 The number of communication links, protocols used, and number of communication channels shown are for illustrative purposes only. In practical applications, the number of communication links, protocols used, and number of communication channels can be set as needed based on the number of interfaces of the IoT platform.

[0050] Specifically, the communication channel is a Channel. A Channel is responsible for intercepting and processing I / O events or I / O operations. It can selectively intercept and process events of interest, and can also pass through or terminate event transmission. Based on the Channel Handler interface, users can easily customize business logic, such as logging, uniformly encapsulating exception information, performance statistics, and message encoding / decoding.

[0051] It is worth noting that this invention introduces the concept of a Channel, where data reading and writing are both performed through Channels. In existing technologies, a typical Channel implementation distinguishes multiple links by listening on different ports on the server side. When a message event is detected, the corresponding Handler registered on the Channel is called to process the message. However, as a client, only one Channel is maintained. When there are multiple protocol simulation objects, processing cannot be performed on the same Channel, thus this method does not support scenarios where multiple devices are simulated as clients on the same computer. To solve this problem, this invention no longer distinguishes between client-side and server-side Channels. A message distribution center 131 is added to uniformly establish link connections with the IoT platform and perform message routing and distribution. Instead of an IO Thread listening for Accept events (which indicate accepting a parameter and performing certain operations without a return value), the message distribution center 131 uniformly listens for message events, finds the corresponding communication link and communication channel based on the maintained mapping table of communication links and communication channels, and forwards the data.

[0052] Specifically, the message distribution center 131 is used for:

[0053] When receiving downlink data sent by the IoT platform, the destination address in the downlink data is obtained, and the target communication channel corresponding to the destination address is found in the mapping table, so as to send the downlink data to the corresponding simulated object through the target communication channel;

[0054] Upon receiving uplink data sent by the simulated object, the target interface corresponding to the simulated object is obtained, and the target communication link corresponding to the target interface is searched in the mapping table so as to send the uplink data to the IoT platform through the target communication link.

[0055] For example, the mapping table records the mapping relationship between different simulated objects and their corresponding communication channels, as well as the mapping relationship between different interfaces and their corresponding communication links, such as... Figure 3 As shown: "Simulated Terminal 1 - Communication Channel a", "Simulated Terminal 2 - Communication Channel b", "Service - Communication Channel c"; "Interface a - Communication Link 1 (MQTT Protocol)", "Interface b - Communication Link 2 (COAP Protocol)", "Interface c - Communication Link 3 (HTTP Protocol)".

[0056] For example, the connection between the IoT platform and the message distribution center 131 is handled by the ClientProcessor submodule (Client, IoT terminal device; processor, which processes the data transmitted by the Client). When receiving downlink data (such as Socket) sent by the IoT platform, the message distribution center 131 obtains the destination address in the downlink data and finds the target communication channel corresponding to the destination address through a mapping table. For example, if the destination address indicates that the data is sent to simulated terminal 1, the message distribution center 131 finds the communication channel a corresponding to simulated terminal 1 according to the mapping table and sends the uplink data to simulated terminal 1 through communication channel a. When the message distribution center 131 receives uplink data sent by a simulated object (such as simulated terminal 2), it queries the target interface corresponding to the simulated object and finds the target communication link corresponding to the target interface through a mapping table. For example, if the target interface corresponding to simulated terminal 2 is interface b, the message distribution center 131 finds the communication link 2 corresponding to interface b according to the mapping table and sends the uplink data to the IoT platform through communication link 2.

[0057] Specifically, each communication channel is associated with a linear communication model; wherein, the linear communication model has several Handlers, and when the communication channel transmits data, the Handlers perform data processing.

[0058] For example, see Figure 4 , Figure 4 This is a schematic diagram of the framework of the linear communication model provided in this embodiment of the invention. The linear communication model is a Pipeline, where each Channel is associated with a Pipeline. The defined Handlers are placed in the Pipeline using a doubly linked list. When there is data in the Channel, it is processed by the Handler. Figure 4 The pipeline contains four Handlers. Each Handler is responsible for processing and intercepting I / O operations and forwarding them to the next Handler in the pipeline. The Channel Pipeline acts like a conduit, processing inbound and outbound data and events. The effective orchestration and interaction of Channel Handlers through the Channel Pipeline forms the core of an application's data and event processing logic.

[0059] See Figure 5 , Figure 5This is a structural block diagram of another testing system 100 provided in an embodiment of the present invention, wherein the testing system 100 further includes:

[0060] Protocol encoder 14 is used to serialize the message object sent by the transmission management module 13, so as to encode the message object into a byte sequence;

[0061] Protocol decoder 15 is used to deserialize the byte sequence received by the transmission management module 13 to convert the byte sequence into a message object.

[0062] For example, serialization is the process of breaking down data (strings) into a byte stream for storage in a file or transmission over a network; deserialization is the process of opening the byte stream and reconstructing the object. The protocol encoder implements the Encode Handler interface to serialize the sent message object, encoding the message into a byte sequence. The protocol decoder implements the Decode Handler interface, responsible for converting the received message from serialized form into a defined message object. For the caller, a serialization Encode Handler needs to be added to the Pipeline to serialize the sent request, and a deserialization Decode Handler needs to be added to deserialize the call result. When sending a message in the test script, the transmission management module 13 calls the Send Handler interface to send the message to the protocol encoder-decoder's EncodeHandler for serialization, and then forwards it to the network through the message distribution center 131. After receiving the message, the transmission management module 13 and the message distribution center 131 distribute the message to the corresponding Channel, use the Decode Handler to deserialize the message, and then call the Receive Handler to process the message.

[0063] See Figure 5 , Figure 5 This is a structural block diagram of another testing system 100 provided in an embodiment of the present invention, wherein the testing system 100 further includes:

[0064] The configuration management module 16 is used to manage configurations in a unified manner, and saves configuration items (such as configuration parameters) in a file in the form of key-value pairs;

[0065] Message template 17 is used to define various messages in the protocol. Field names and value types are defined using a YAML or JSON file, and different messages are distinguished by type flags. The wrapper in message template 17 is used to read the format definition file and encapsulate the parameterized variable values ​​into protocol messages according to the defined format. The format definition file also defines the correspondence between sent and received messages to support scenarios where the sent and received messages have different type flags.

[0066] The test case execution engine 18 is used to initialize and generate corresponding instances based on user-specified test resources and configuration information, which are then provided to test cases, such as configuration. Figure 3 The three simulated objects shown are simulated terminal 1, simulated terminal 2, and business service, respectively. Any one of them can be selected to perform exception testing, such as controlling simulated terminal 1 to send and receive messages, thereby constructing scenarios such as message exception, response exception, and sending exception. The test case execution engine 18 manages the lifecycle of test cases, is responsible for the initialization, execution, and final cleanup of test cases, and can capture unhandled exceptions in test cases so that they do not affect the execution of other test cases.

[0067] The log reporting module 19 is used for centralized registration and management of logs, and unified output of log files. Test cases also need to be centrally registered for logs, recording the relevant modules used by the test cases and outputting the logs generated during the execution of the test cases. The test report uses a tree mapping method to record data such as test case number, test steps, and test results.

[0068] Data Management 20 is used to save test data in YAML format files, and supports writing and reading test data.

[0069] Compared to existing technologies, the test system 100 disclosed in this invention generates at least one simulated object that interacts with an IoT platform based on configuration parameters, and defines the communication protocol for at least one interface in the IoT platform. It establishes a communication link with each interface and a communication channel with each simulated object through a transmission management module. The transmission management module uniformly maintains the connection of the communication links, and realizes bidirectional forwarding of data packets based on the mapping relationship between the communication links and communication channels. By controlling the information interaction process between the simulated object and the IoT platform, it can simulate the data transmission and reception of multiple clients on the same computer, satisfying the anomaly testing of various interfaces of the IoT platform and improving the sufficiency and effectiveness of the testing. Furthermore, it maintains the read and write data of multiple links through a message distribution center and registers message processors (Handelers) using a doubly linked list, facilitating message processing during sending and receiving and reducing the complexity of developing custom protocols.

[0070] See Figure 6 , Figure 6 This is a flowchart of a testing method provided in an embodiment of the present invention, the testing method comprising:

[0071] S1. Generate at least one simulated object that interacts with the IoT platform based on the configuration parameters;

[0072] S2. Define the communication protocol for at least one interface in the IoT platform;

[0073] S3. Establish a communication link with each interface and a communication channel with each simulated object, and forward messages through the communication link and the communication channel.

[0074] Specifically, the forwarding of messages through the communication link and the communication channel includes:

[0075] When receiving downlink data sent by the IoT platform, the system searches for the corresponding communication channel in a preset mapping table, and then sends the downlink data to the corresponding simulated object through the communication channel.

[0076] When uplink data is received from the simulated object, the corresponding communication link is looked up in the mapping table so that the uplink data can be sent to the IoT platform through the communication link.

[0077] Specifically, the step of searching for the corresponding communication channel in a preset mapping table, and then sending the downlink data to the corresponding simulated object through the communication channel, includes:

[0078] Obtain the destination address from the downlink data, find the target communication channel corresponding to the destination address in the mapping table, and send the downlink data to the corresponding simulated object through the target communication channel.

[0079] Specifically, the step of searching for the corresponding communication link in the mapping table to send the uplink data to the IoT platform through the communication link includes:

[0080] Obtain the target interface corresponding to the simulated object, and find the target communication link corresponding to the target interface in the mapping table, so as to send the uplink data to the IoT platform through the target communication link.

[0081] Specifically, the communication channel is a Channel; each communication channel is associated with a linear communication model; wherein, the linear communication model has several Handlers, and when the communication channel transmits data, the Handlers perform data processing.

[0082] Specifically, when forwarding messages through the communication link and the communication channel, the method further includes:

[0083] The sent message object is serialized to encode the message object into a byte sequence;

[0084] The received byte sequence is deserialized to convert the byte sequence into a message object.

[0085] Specifically, the configuration parameters include device parameters, IP parameters, port parameters, and protocol type.

[0086] It is worth noting that the working process of the testing method described in the embodiments of the present invention can refer to the working process of the testing system described in the above embodiments, and will not be repeated here.

[0087] See Figure 7 , Figure 7 This is a structural block diagram of a testing device 200 provided in an embodiment of the present invention. The testing device 200 includes a processor 21, a memory 22, and a computer program stored in the memory 22 and executable on the processor 21. When the processor 21 executes the computer program, it implements the steps in the various testing method embodiments described above, such as steps S1 to S3.

[0088] For example, the computer program may be divided into one or more modules / units, which are stored in the memory 22 and executed by the processor 21 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the test device 200.

[0089] The test device 200 may include, but is not limited to, a processor 21 and a memory 22. Those skilled in the art will understand that the schematic diagram is merely an example of the test device 200 and does not constitute a limitation on the test device 200. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the test device 200 may also include input / output devices, network access devices, buses, etc.

[0090] The processor 21 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor 21 is the control center of the test equipment 200, connecting all parts of the test equipment 200 via various interfaces and lines.

[0091] The memory 22 can be used to store the computer programs and / or modules. The processor 21 implements various functions of the test device 200 by running or executing the computer programs and / or modules stored in the memory 22 and calling the data stored in the memory 22. The memory 22 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0092] If the modules / units integrated in the testing equipment 200 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by the processor 21, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0093] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A testing system, characterized in that, include: The agent management module is used to generate at least one simulated object that interacts with the IoT platform based on configuration parameters. Protocol components are used to define the communication protocol for at least one interface in the IoT platform; The transmission management module is used to establish communication links with each interface and communication channels with each simulated object, and to forward messages through the communication links and communication channels. Each communication channel is associated with a linear communication model. Each linear communication model has several Handlers. The communication channel is a Channel, and the linear communication model is a Pipeline. Each Channel is associated with a Pipeline. The defined Handlers are placed in the Pipeline through a doubly linked list. When there is data in the Channel, the Handler processes the data. The transmission management module includes: The message distribution center is used to look up the corresponding communication channel in a preset mapping table when it receives downlink data sent by the IoT platform; it is also used to look up the corresponding communication link in the mapping table when it receives uplink data sent by the simulated object. A communication channel is used to send the downlink data to the corresponding simulated object, and to send the uplink data sent by the simulated object to the message distribution center.

2. The testing system as described in claim 1, characterized in that, The message distribution center is used for: When receiving downlink data sent by the IoT platform, the destination address in the downlink data is obtained, and the target communication channel corresponding to the destination address is found in the mapping table, so as to send the downlink data to the corresponding simulated object through the target communication channel; Upon receiving uplink data sent by the simulated object, the target interface corresponding to the simulated object is obtained, and the target communication link corresponding to the target interface is searched in the mapping table so as to send the uplink data to the IoT platform through the target communication link.

3. The testing system as described in claim 1, characterized in that, The testing system also includes: A protocol encoder is used to serialize the message object sent by the transmission management module, so as to encode the message object into a byte sequence; A protocol decoder is used to deserialize the byte sequence received by the transmission management module to convert the byte sequence into a message object.

4. The testing system as described in claim 1, characterized in that, The configuration parameters include device parameters, IP parameters, port parameters, and protocol type.

5. A testing method, characterized in that, include: Generate at least one simulated object that interacts with the IoT platform based on the configuration parameters; Define the communication protocol for at least one interface in the IoT platform; A communication link is established with each interface, and a communication channel is established with each simulated object. Messages are forwarded through the communication link and the communication channel. Each communication channel is associated with a linear communication model. Each linear communication model has several Handlers. The communication channel is a Channel, and the linear communication model is a Pipeline. Each Channel is associated with a Pipeline. The defined Handlers are placed in the Pipeline using a doubly linked list. When there is data in the Channel, the Handler processes the data. The forwarding of messages through the communication link and the communication channel includes: When receiving downlink data sent by the IoT platform, the system searches for the corresponding communication channel in a preset mapping table, and then sends the downlink data to the corresponding simulated object through the communication channel. When uplink data is received from the simulated object, the corresponding communication link is looked up in the mapping table so that the uplink data can be sent to the IoT platform through the communication link.

6. A testing device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the test method as described in claim 5.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein the computer program, when executed, controls the device containing the computer-readable storage medium to perform the test method as described in claim 5.

8. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the test method as described in claim 5.

Citation Information

Patent Citations

  • Internet of Things testing method and system for simulating hardware equipment

    CN114928565A

  • Simulation platform and simulation method based on Internet of Things management system

    CN116192656A

  • Management protocol proxy communication system and method based on HTTP, and storage medium

    CN116506416A