CN111786939B - Method, device and system for testing management platform of Internet of things - Google Patents

Method, device and system for testing management platform of Internet of things Download PDF

Info

Publication number
CN111786939B
CN111786939B CN202010182502.6A CN202010182502A CN111786939B CN 111786939 B CN111786939 B CN 111786939B CN 202010182502 A CN202010182502 A CN 202010182502A CN 111786939 B CN111786939 B CN 111786939B
Authority
CN
China
Prior art keywords
transmission protocol
data based
calling
management platform
internet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010182502.6A
Other languages
Chinese (zh)
Other versions
CN111786939A (en
Inventor
刘然
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202010182502.6A priority Critical patent/CN111786939B/en
Publication of CN111786939A publication Critical patent/CN111786939A/en
Application granted granted Critical
Publication of CN111786939B publication Critical patent/CN111786939B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method, a device and a system for testing an Internet of things management platform, and relates to the technical field of computers. One embodiment of the method comprises: constructing control data based on a first transport protocol; converting the control data based on the first transmission protocol into control data based on a second transmission protocol and then sending the control data to an equipment terminal SDK (software development kit) so that the equipment terminal SDK executes a control behavior corresponding to the control data based on the second transmission protocol and sends output data after the control behavior is executed to an Internet of things management platform; and acquiring the output data from the Internet of things management platform, and checking the correctness of the output data according to the control data. According to the embodiment, the test process does not depend on real equipment or manual operation, the test case is automatically accessed to the communication process of the management platform of the Internet of things and the equipment end, and the full-link test of the management platform of the Internet of things is realized.

Description

Method, device and system for testing management platform of Internet of things
Technical Field
The invention relates to the technical field of computers, in particular to a method, a device and a system for testing an Internet of things management platform.
Background
The internet of things management platform is a management platform serving the internet of things industry, provides an internet of things solution for equipment manufacturers and engineers, and realizes remote management of various hardware equipment and management of equipment data. In the prior art, when the management platform of the internet of things is tested, the SDK code of the equipment is installed in an operating system, the manually input data is received in a command line mode after the SDK code is started, and the data issued by the management platform of the internet of things is output, so that the interactive process of the equipment and the management platform of the internet of things is simulated to test the management platform of the internet of things.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
manual participation is needed for inputting data and checking output data, and each iteration of the function of the internet of things management platform needs manual regression testing, which is not beneficial to improving the function iteration frequency of products.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, and a system for testing an internet of things management platform, so that a test process does not depend on real equipment nor manual operation, a test case is automatically accessed to a communication process between the internet of things management platform and an equipment side, and a full link test on the internet of things management platform is implemented.
In order to achieve the above object, according to an aspect of the embodiments of the present invention, there is provided a method for testing an internet of things management platform, including:
constructing control data based on a first transport protocol;
converting the control data based on the first transmission protocol into control data based on a second transmission protocol and then sending the control data to an equipment terminal SDK (software development kit), so that the equipment terminal SDK executes a control action corresponding to the control data based on the second transmission protocol, and sending output data after executing the control action to an Internet of things management platform;
and acquiring the output data from the Internet of things management platform, and checking the correctness of the output data according to the control data.
Optionally, the step of converting the control data based on the first transmission protocol into control data based on the second transmission protocol and sending the control data to the device side SDK includes:
storing control data based on a first transmission protocol to a message sending queue through the first transmission protocol;
and taking out the control data in the message sending queue, converting the control data into control data based on a second transmission protocol, and sending the control data to the SDK (device side software development kit) through the second transmission protocol.
Optionally, the method of the embodiment of the present invention further includes:
calling a service interface of the Internet of things management platform so that the Internet of things management platform responds to calling operation to generate calling data and sends the calling data to the device side SDK;
receiving calling data based on a second transmission protocol sent by the SDK of the device end, and converting the calling data based on the second transmission protocol into calling data based on a first transmission protocol;
acquiring calling data based on a first transmission protocol, and checking the correctness of the calling data according to the calling operation.
Optionally, receiving the invocation data based on the second transmission protocol sent by the device side SDK, and converting the invocation data based on the second transmission protocol into the invocation data based on the first transmission protocol includes:
storing the calling data based on the second transmission protocol and sent by the SDK of the device end to a received message queue;
and taking out the calling data in the received message queue and converting the calling data into calling data based on a first transmission protocol.
Optionally, the first transmission protocol is an HTTP protocol, and the second transmission protocol is a Socket protocol.
Optionally, data is sent between the device side SDK and the internet of things management platform through an MQTT protocol.
According to a second aspect of the embodiments of the present invention, there is provided an apparatus for testing an internet of things management platform, including: the device comprises an equipment simulation module, a test case module and an agent module; wherein the content of the first and second substances,
the test case module constructs control data based on a first transmission protocol;
the agent module converts the control data based on the first transmission protocol into control data based on the second transmission protocol and then sends the control data to the equipment end SDK of the equipment simulation module;
the device side SDK executes a control action corresponding to the control data based on the second transmission protocol, and sends output data after the control action is executed to an Internet of things management platform;
the test case module acquires the output data from the Internet of things management platform and carries out correctness verification on the output data according to the control data.
Optionally, the step of the proxy module converting the control data based on the first transmission protocol into control data based on the second transmission protocol and sending the control data to the device side SDK includes:
storing control data based on a first transmission protocol to a message sending queue through the first transmission protocol;
and taking out the control data in the message sending queue, converting the control data into control data based on a second transmission protocol, and sending the control data to the SDK (device side software development kit) through the second transmission protocol.
Optionally, the test case module is further configured to: calling a service interface of the Internet of things management platform to enable the Internet of things management platform to respond to calling operation to generate calling data and send the calling data to the device side SDK;
the device side SDK is further configured to: converting the calling data into calling data based on a second transmission protocol, and then sending the calling data to the agent module;
the agent module is further configured to: receiving calling data based on a second transmission protocol sent by the SDK of the equipment terminal, converting the calling data based on the second transmission protocol into calling data based on a first transmission protocol, and then sending the calling data to the test case module;
the test case module is further configured to: acquiring calling data based on a first transmission protocol, and checking the correctness of the calling data according to the calling operation.
Optionally, the receiving, by the proxy module, the call data based on the second transmission protocol sent by the device side SDK, converting the call data based on the second transmission protocol into the call data based on the first transmission protocol, and then sending the call data to the test case module includes:
storing the calling data based on the second transmission protocol and sent by the SDK of the device end to a received message queue;
and taking out the calling data in the received message queue, converting the calling data into calling data based on a first transmission protocol, and then sending the calling data to the test case module.
Optionally, the first transport protocol is an HTTP protocol, and the second transport protocol is a Socket protocol.
Optionally, data is sent between the device side SDK and the internet of things management platform through an MQTT protocol.
According to a third aspect of the embodiments of the present invention, there is provided a system for testing an internet of things management platform, including: the device for testing the management platform of the internet of things and the management platform of the internet of things provided by the second aspect of the embodiment of the invention; the device of thing networking management platform test includes: the device comprises an equipment simulation module, a test case module and an agent module; wherein the content of the first and second substances,
the test case module constructs control data based on a first transmission protocol;
the agent module converts the control data based on the first transmission protocol into control data based on the second transmission protocol and then sends the control data to the equipment end SDK of the equipment simulation module;
the device side SDK executes a control action corresponding to the control data based on the second transmission protocol, and sends output data after the control action is executed to the Internet of things management platform;
the test case module acquires the output data from the Internet of things management platform and carries out correctness verification on the output data according to the control data.
Optionally, the step of converting, by the proxy module, the control data based on the first transmission protocol into control data based on the second transmission protocol and sending the control data to the device side SDK includes:
storing control data based on a first transmission protocol to a message sending queue through the first transmission protocol;
and taking out the control data in the message sending queue, converting the control data into control data based on a second transmission protocol, and sending the control data to the SDK (device side software development kit) through the second transmission protocol.
Optionally, the test case module is further configured to: calling a service interface of the Internet of things management platform so that the Internet of things management platform responds to calling operation to generate calling data and sends the calling data to the device side SDK;
the device side SDK is further configured to: converting the calling data into calling data based on a second transmission protocol, and then sending the calling data to the agent module;
the agent module is further configured to: receiving calling data based on a second transmission protocol sent by the SDK of the equipment terminal, converting the calling data based on the second transmission protocol into calling data based on a first transmission protocol, and then sending the calling data to the test case module;
the test case module is further configured to: acquiring calling data based on a first transmission protocol, and checking the correctness of the calling data according to the calling operation.
Optionally, the receiving, by the proxy module, the call data based on the second transmission protocol sent by the device side SDK, converting the call data based on the second transmission protocol into the call data based on the first transmission protocol, and then sending the call data to the test case module includes:
storing the calling data which is sent by the SDK at the equipment end and is based on the second transmission protocol to a message receiving queue;
and taking out the calling data in the received message queue, converting the calling data into calling data based on a first transmission protocol, and then sending the calling data to the test case module.
Optionally, the first transport protocol is an HTTP protocol, and the second transport protocol is a Socket protocol.
Optionally, data is sent between the device side SDK and the internet of things management platform through an MQTT protocol.
According to a fourth aspect of the embodiments of the present invention, there is provided an electronic device for testing an internet of things management platform, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method provided by the first aspect of the embodiments of the present invention.
According to a fifth aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method provided by the first aspect of embodiments of the present invention.
One embodiment of the above invention has the following advantages or benefits: by adopting the device end SDK, the testing process can be independent of real devices; the control data based on the first transmission protocol is converted into the control data based on the second transmission protocol and then sent to the device terminal SDK or the calling data based on the second transmission protocol and sent by the device terminal SDK is converted into the calling data based on the first transmission protocol, so that the testing process does not depend on manual operation, the test case can be automatically accessed into the communication process of the management platform and the device terminal of the Internet of things, and the full-link test of the management platform of the Internet of things is realized.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of a main flow of a method for testing an internet of things management platform according to an embodiment of the present invention;
fig. 2 is a schematic diagram of main modules of an internet of things management platform testing device according to an embodiment of the invention;
FIG. 3 is a schematic diagram of an agent module in an alternative embodiment of the invention;
FIG. 4 is a schematic diagram of a method for testing an IOT management platform in an alternative embodiment of the invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 6 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The embodiment of the invention provides a method, a device and a system for testing an Internet of things management platform.
Fig. 1 is a schematic diagram of a main flow of a method for testing an internet of things management platform according to an embodiment of the present invention. Fig. 2 is a schematic diagram of main modules of an apparatus 200 for testing an internet of things management platform, which implements the method described above, and includes an equipment simulation module 201, an agent module 202, and a test case module 203. Fig. 3 is a schematic diagram of an agent module in an alternative embodiment of the present invention, and fig. 4 is a schematic diagram of a method for testing an internet of things management platform in an alternative embodiment of the present invention.
As shown in fig. 1, the method for testing an internet of things management platform according to the embodiment of the present invention includes:
step S101, constructing control data based on a first transmission protocol;
step S102, converting the control data based on the first transmission protocol into control data based on a second transmission protocol and then sending the control data to an equipment terminal SDK (software development kit) so that the equipment terminal SDK executes a control action corresponding to the control data based on the second transmission protocol and sends output data after executing the control action to an Internet of things management platform;
step S103, the output data are obtained from the Internet of things management platform, and correctness verification is carried out on the output data according to the control data.
When constructing control data, it is often desirable to obtain specific output data. And when the output data acquired from the Internet of things management platform is not in accordance with the expectation, judging that the Internet of things platform is abnormal. At this time, the code with the exception can be located in a code review or log adding mode, and then exception repair is carried out. The embodiment realizes the test of the Internet of things management platform in the data uplink process.
The device side SDK (software development kit) is a section of packaged software code, and can be used for simulating interaction between a real device and an internet of things platform. By adopting the device side SDK, the test process can be independent of real devices.
The test case module refers to an execution module for constructing a test case, and step S101 and step S103 are implemented by the test case module shown in fig. 3. The proxy module is a module for converting control data based on the first transmission protocol into control data based on the second transmission protocol and then sending the control data to the device side SDK, or converting call data based on the second transmission protocol and sent by the device side SDK into call data based on the first transmission protocol. Step S102 is implemented by the agent module shown in fig. 3.
If the test case module and the device side SDK communicate directly, they need to follow the transmission protocol of the system, which increases the complexity of the test framework. Meanwhile, because the automatic test cases are generally a collection of dozens to hundreds of independent individuals, and each individual test case is responsible for verifying a specific function, each test case needs to be connected with the device side SDK, however, frequent connection establishment causes additional overhead. According to the embodiment of the invention, the agent module is arranged between the test case module and the equipment simulation module (the equipment end SDK is arranged in the equipment simulation module), so that the control data based on the first transmission protocol can be converted into the control data based on the second transmission protocol and then sent to the equipment end SDK, the data uplink test process does not depend on manual operation, the test case can be automatically accessed into the communication process of the Internet of things management platform and the equipment end, the full link test of the Internet of things management platform is realized, and the network overhead is reduced.
Optionally, the step of converting the control data based on the first transmission protocol into control data based on the second transmission protocol and sending the control data to the device side SDK includes: storing control data based on a first transmission protocol to a message sending queue through the first transmission protocol; and taking out the control data in the message sending queue, converting the control data into control data based on a second transmission protocol, and sending the control data to the SDK (device side software development kit) through the second transmission protocol. As shown in fig. 2, the test case module stores the control data transmitted to the device simulation module in a transmission message queue of the agent layer.
The sending message queue is adopted to manage the control data to be sent to the SDK of the equipment terminal, so that the sending of the control data and the conversion of the transmission protocol can be executed in a distributed mode, and the testing efficiency is improved.
Optionally, the method of the embodiment of the present invention further includes: calling a service interface of the Internet of things management platform so that the Internet of things management platform responds to calling operation to generate calling data and sends the calling data to the device side SDK; receiving calling data based on a second transmission protocol sent by the SDK of the device end, and converting the calling data based on the second transmission protocol into calling data based on a first transmission protocol; acquiring calling data based on a first transmission protocol, and checking the correctness of the calling data according to the calling operation.
The embodiment realizes the test of the Internet of things management platform in the data downlink process. When a service interface of the internet of things management platform is called, the internet of things management platform is expected to issue specific calling data. And when the calling data acquired from the Internet of things management platform is not in accordance with the expectation, judging that the Internet of things platform is abnormal. At this time, the code with the exception can be located in a code review or log adding mode, and then exception repair is carried out.
According to the embodiment of the invention, the proxy module is arranged between the test case module and the equipment simulation module (the equipment terminal SDK is arranged in the equipment simulation module), so that the calling data based on the second transmission protocol and sent by the equipment terminal SDK can be converted into the calling data based on the first transmission protocol, the data downlink test process does not depend on manual operation, the test case can be automatically accessed into the communication process of the Internet of things management platform and the equipment terminal, the full link test of the Internet of things management platform is realized, and the network overhead is reduced.
Optionally, receiving the invocation data based on the second transmission protocol sent by the device side SDK, and converting the invocation data based on the second transmission protocol into the invocation data based on the first transmission protocol includes: storing the calling data based on the second transmission protocol and sent by the SDK of the device end to a received message queue; and taking out the calling data in the received message queue and converting the calling data into calling data based on a first transmission protocol.
As shown in fig. 2, the test case module stores the call data, which is sent by the device simulation module and received from the internet of things management platform, in a receive message queue of the agent layer. The method and the device have the advantages that the calling data received by the SDK at the message queue management device end are received, so that the calling data acquisition and the transmission protocol conversion can be executed in a distributed mode, and the testing efficiency is improved.
The first Transport Protocol and the second Transport Protocol are used to refer to two different Transport protocols, for example, the first Transport Protocol is HTTP (Hyper Text Transport Protocol), and the second Transport Protocol is Socket (Socket) Protocol.
And a data transmission protocol between the SDK at the equipment end and the management platform of the Internet of things can be selectively set according to actual conditions. Optionally, data is sent between the device side SDK and the internet of things management platform through an MQTT protocol (Message Queuing Telemetry Transport).
The method of the embodiment of the present invention is exemplified below with reference to fig. 2 and 3. In this example, the device simulation module is a module for installing the device SDK, the agent module is a module for converting control data based on the first transmission protocol into control data based on the second transmission protocol and then sending the control data to the device SDK or converting call data based on the second transmission protocol and sent by the device SDK into call data based on the first transmission protocol, the test case module is a module for constructing control data based on the first transmission protocol, obtaining output data from the internet of things management platform, and checking correctness of the output data according to the control data, and a module for calling a service interface of the management platform of the internet of things to enable the management platform of the internet of things to respond to the calling operation to generate calling data and send the calling data to the device side SDK, acquiring the calling data based on the first transmission protocol, and checking the correctness of the calling data according to the calling operation.
In general, the internet of things management platform exposes a service interface to the outside through an HTTP protocol. The test case module can directly initiate an HTTP request to the Internet of things management platform based on an HTTP protocol, and can obtain a return result of the Internet of things management platform in real time, so that data receiving and sending are achieved. Further, the test case module may use the obtained return result for correctness verification.
And the SDK exposes a service interface through a Socket protocol. If the test case module directly interacts with the device side SDK through the Socket protocol, the complexity of the test framework is increased. Meanwhile, because the automatic test cases are generally a collection of dozens to hundreds of independent individuals, and each individual test case is responsible for verifying a specific function, each test case needs to be connected with equipment. The Socket protocol is a long link protocol, and frequent connection establishment causes additional overhead. The embodiment adopts the proxy module as a conversion layer of the HTTP protocol and the Socket protocol. In the process from the test case to the equipment side, the proxy module converts the HTTP protocol into the Socket protocol. In the flow from the equipment side to the test case, the proxy module converts the Socket protocol into the HTTP protocol. The test case module only needs to be dedicated to HTTP protocol interaction.
The agent module is started independently as an independent service. When the system is started, Socket connection with the SDK of the equipment end is established, and a message sending queue and a message receiving queue are initialized. The data interaction mode of the agent module and the equipment side is as follows: and the data stored in the message sending queue is transmitted to the equipment end through the output stream of the Socket connection. And the device side receives data from the cloud side through an MQTT protocol and stores the data in a message receiving queue. Meanwhile, when the proxy module is started, the proxy module is used as a server side in a RESTFul (design style of an Internet application program based on an HTTP protocol), and provides data-related HTTP services for the test case module. The data interaction mode of the agent module and the test case module is as follows: the test case module sends control data through the HTTP interface, and the data are placed in a sending message queue of the agent module. The device executes a behavior agreed in advance in accordance with the control data when receiving the control data. And the test case module inquires and receives data in the message queue through the HTTP interface, and acquires data issued to the equipment terminal by the Internet of things management platform for verification. The internal implementation of the agent module enables each test case to send and receive data of the equipment end in a simple mode for correctness verification.
The test target of the internet of things management platform is to ensure the correctness of input and output data of each module under various scenes. For example, an uplink scenario of data in a full link test scenario needs to include that a device can correctly report the data to a platform under an active or passive condition, and the platform can correctly store and display the data. According to the embodiment of the invention, the SDK at the equipment end is adopted, so that the test process does not depend on real equipment; the control data based on the first transmission protocol is converted into the control data based on the second transmission protocol and then sent to the device end SDK or the calling data based on the second transmission protocol and sent by the device end SDK is converted into the calling data based on the first transmission protocol, so that the testing process does not depend on manual operation, the test case can be automatically accessed into the communication process of the management platform and the device end of the Internet of things, and the full-link test of the management platform of the Internet of things is realized.
According to a second aspect of the embodiments of the present invention, an apparatus for implementing the above method is provided.
As shown in fig. 2, an apparatus 200 for testing an internet of things management platform according to an embodiment of the present invention includes: the device simulation module 201, the test case module 203 and the agent module 202; wherein the content of the first and second substances,
the test case module 203 constructs control data based on the first transmission protocol;
the agent module 202 converts the control data based on the first transmission protocol into control data based on the second transmission protocol and sends the control data to the device side SDK of the device simulation module 201;
the device side SDK executes a control action corresponding to the control data based on the second transmission protocol, and sends output data after the control action is executed to an Internet of things management platform;
the test case module 203 acquires the output data from the internet of things management platform, and performs correctness check on the output data according to the control data.
Optionally, the step of converting, by the proxy module, the control data based on the first transmission protocol into control data based on the second transmission protocol and sending the control data to the device side SDK includes:
storing control data based on a first transmission protocol to a message sending queue through the first transmission protocol;
and taking out the control data in the message sending queue, converting the control data into control data based on a second transmission protocol, and sending the control data to the SDK (device side software development kit) through the second transmission protocol.
Optionally, the test case module is further configured to: calling a service interface of the Internet of things management platform so that the Internet of things management platform responds to calling operation to generate calling data and sends the calling data to the device side SDK;
the device side SDK is further configured to: converting the calling data into calling data based on a second transmission protocol, and then sending the calling data to the agent module;
the agent module is further configured to: receiving calling data based on a second transmission protocol sent by the SDK of the equipment terminal, converting the calling data based on the second transmission protocol into calling data based on a first transmission protocol, and then sending the calling data to the test case module;
the test case module is further configured to: acquiring calling data based on a first transmission protocol, and checking the correctness of the calling data according to the calling operation.
Optionally, the receiving, by the proxy module, the call data based on the second transmission protocol sent by the device side SDK, converting the call data based on the second transmission protocol into the call data based on the first transmission protocol, and then sending the call data to the test case module includes:
storing the calling data which is sent by the SDK at the equipment end and is based on the second transmission protocol to a message receiving queue;
and taking out the calling data in the received message queue, converting the calling data into calling data based on a first transmission protocol, and then sending the calling data to the test case module.
Optionally, the first transmission protocol is an HTTP protocol, and the second transmission protocol is a Socket protocol.
Optionally, data is sent between the device side SDK and the internet of things management platform through an MQTT protocol.
According to a third aspect of the embodiments of the present invention, there is provided a system for testing an internet of things management platform, including: the device for testing the management platform of the internet of things and the management platform of the internet of things provided by the second aspect of the embodiment of the invention; the device of thing networking management platform test includes: the device comprises an equipment simulation module, a test case module and an agent module; wherein the content of the first and second substances,
the test case module constructs control data based on a first transmission protocol;
the agent module converts the control data based on the first transmission protocol into control data based on the second transmission protocol and then sends the control data to the equipment end SDK of the equipment simulation module;
the device side SDK executes a control action corresponding to the control data based on the second transmission protocol, and sends output data after the control action is executed to the Internet of things management platform;
and the test case module acquires the output data from the Internet of things management platform and carries out correctness verification on the output data according to the control data.
Optionally, the step of converting, by the proxy module, the control data based on the first transmission protocol into control data based on the second transmission protocol and sending the control data to the device side SDK includes:
storing control data based on a first transmission protocol to a message sending queue through the first transmission protocol;
and taking out the control data in the message sending queue, converting the control data into control data based on a second transmission protocol, and sending the control data to the SDK (device side software development kit) through the second transmission protocol.
Optionally, the test case module is further configured to: calling a service interface of the Internet of things management platform so that the Internet of things management platform responds to calling operation to generate calling data and sends the calling data to the device side SDK;
the device side SDK is further configured to: converting the calling data into calling data based on a second transmission protocol, and then sending the calling data to the agent module;
the agent module is further configured to: receiving calling data based on a second transmission protocol sent by the SDK of the equipment terminal, converting the calling data based on the second transmission protocol into calling data based on a first transmission protocol, and then sending the calling data to the test case module;
the test case module is further configured to: acquiring calling data based on a first transmission protocol, and checking the correctness of the calling data according to the calling operation.
Optionally, the receiving, by the proxy module, the call data based on the second transmission protocol sent by the device side SDK, converting the call data based on the second transmission protocol into the call data based on the first transmission protocol, and then sending the call data to the test case module includes:
storing the calling data which is sent by the SDK at the equipment end and is based on the second transmission protocol to a message receiving queue;
and taking out the calling data in the received message queue, converting the calling data into calling data based on a first transmission protocol, and then sending the calling data to the test case module.
Optionally, the first transmission protocol is an HTTP protocol, and the second transmission protocol is a Socket protocol.
Optionally, data is sent between the device side SDK and the internet of things management platform through an MQTT protocol.
According to a fourth aspect of the embodiments of the present invention, there is provided an electronic device for testing an internet of things management platform, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method provided by the first aspect of the embodiments of the present invention.
According to a fifth aspect of embodiments of the present invention, there is provided a computer-readable medium, on which a computer program is stored, which when executed by a processor, performs the method provided by the first aspect of embodiments of the present invention.
Fig. 5 illustrates an exemplary system architecture 500 of a method for testing an internet of things management platform or an apparatus for testing an internet of things management platform, to which embodiments of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 501, 502, 503. The background management server can respond to data such as the received internet of things management platform test request to test the internet of things management platform, and feed back a test result (for example, the internet of things management platform is abnormal-only an example) to the terminal device.
It should be noted that, the method for testing the management platform of the internet of things provided by the embodiment of the present invention is generally executed by the server 505, and accordingly, the apparatus for testing the management platform of the internet of things is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use with a terminal device implementing embodiments of the present invention is shown. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the use range of the embodiment of the present invention.
As shown in fig. 6, the computer system 600 includes a central processing module (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the central processing module (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present invention, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprising: the device simulation module, the device simulation module and the agent module; the test case module constructs control data based on a first transmission protocol; the agent module converts the control data based on the first transmission protocol into control data based on the second transmission protocol and then sends the control data to the device end SDK of the device simulation module; the device side SDK executes a control behavior corresponding to the control data based on the second transmission protocol, and sends output data after the control behavior is executed to an Internet of things management platform; the test case module acquires the output data from the Internet of things management platform and carries out correctness verification on the output data according to the control data. Where the names of these modules do not in some cases constitute a limitation on the module itself, for example, a plant simulation module may also be described as a "module that performs a control action corresponding to the control data".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: constructing control data based on a first transport protocol; converting the control data based on the first transmission protocol into control data based on the second transmission protocol, and then sending the control data to an equipment terminal SDK (software development kit) so as to enable the equipment terminal SDK to execute a control behavior corresponding to the control data, and sending output data after the control behavior is executed to an Internet of things management platform; and acquiring the output data from the Internet of things management platform, and checking the correctness of the output data according to the control data.
According to the technical scheme of the embodiment of the invention, the test process does not depend on real equipment by adopting the equipment side SDK; the control data based on the first transmission protocol is converted into the control data based on the second transmission protocol and then sent to the device end SDK or the calling data based on the second transmission protocol and sent by the device end SDK is converted into the calling data based on the first transmission protocol, so that the testing process does not depend on manual operation, the test case can be automatically accessed into the communication process of the management platform and the device end of the Internet of things, and the full-link test of the management platform of the Internet of things is realized.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (9)

1. A method for testing an Internet of things management platform is characterized by comprising the following steps:
constructing control data based on a first transport protocol;
converting the control data based on the first transmission protocol into control data based on a second transmission protocol and then sending the control data to an equipment terminal SDK (software development kit), so that the equipment terminal SDK executes a control action corresponding to the control data based on the second transmission protocol, and sending output data after executing the control action to an Internet of things management platform;
acquiring the output data from the Internet of things management platform, and checking the correctness of the output data according to the control data;
the method further comprises the following steps: calling a service interface of the Internet of things management platform so that the Internet of things management platform responds to calling operation to generate calling data and sends the calling data to the device side SDK; receiving calling data based on a second transmission protocol sent by the SDK of the equipment end, and converting the calling data based on the second transmission protocol into calling data based on a first transmission protocol; acquiring calling data based on a first transmission protocol, and checking the correctness of the calling data based on the first transmission protocol according to the calling operation.
2. The method of claim 1, wherein converting the control data based on the first transmission protocol into control data based on the second transmission protocol and sending the control data to the device side SDK comprises:
storing control data based on a first transmission protocol to a message sending queue through the first transmission protocol;
and taking out the control data in the message sending queue, converting the control data into control data based on a second transmission protocol, and sending the control data to the device end SDK through the second transmission protocol.
3. The method of claim 1, wherein receiving invocation data based on a second transmission protocol sent by the device side SDK, and converting the invocation data based on the second transmission protocol into invocation data based on a first transmission protocol comprises:
storing the calling data which is sent by the SDK at the equipment end and is based on the second transmission protocol to a message receiving queue;
and taking out the calling data in the received message queue and converting the calling data into calling data based on a first transmission protocol.
4. The method of claim 1, wherein the first transport protocol is an HTTP protocol and the second transport protocol is a Socket protocol.
5. The method of claim 1, wherein the device side SDK and the internet of things management platform send data via MQTT protocol.
6. The utility model provides a device of thing networking management platform test which characterized in that includes: the device comprises an equipment simulation module, a test case module and an agent module; wherein the content of the first and second substances,
the test case module constructs control data based on a first transmission protocol;
the agent module converts the control data based on the first transmission protocol into control data based on the second transmission protocol and then sends the control data to the equipment end SDK of the equipment simulation module;
the device side SDK executes a control behavior corresponding to the control data based on the second transmission protocol, and sends output data after the control behavior is executed to an Internet of things management platform;
the test case module acquires the output data from the Internet of things management platform and carries out correctness verification on the output data according to the control data;
the test case module is further configured to: calling a service interface of the Internet of things management platform so that the Internet of things management platform responds to calling operation to generate calling data and sends the calling data to the device side SDK; the device side SDK is further configured to: converting the calling data into calling data based on a second transmission protocol, and then sending the calling data to the agent module; the agent module is further configured to: receiving calling data based on a second transmission protocol sent by the SDK, converting the calling data based on the second transmission protocol into calling data based on a first transmission protocol, and sending the calling data to the test case module; the test case module is further configured to: acquiring calling data based on a first transmission protocol, and checking the correctness of the calling data based on the first transmission protocol according to the calling operation.
7. A system for testing an Internet of things management platform is characterized by comprising: the device for testing the internet of things management platform of claim 6, and the internet of things management platform; the device of thing networking management platform test includes: the device comprises an equipment simulation module, a test case module and an agent module; wherein the content of the first and second substances,
the test case module constructs control data based on a first transmission protocol;
the agent module converts the control data based on the first transmission protocol into control data based on the second transmission protocol and then sends the control data to the device end SDK of the device simulation module;
the device side SDK executes a control action corresponding to the control data based on the second transmission protocol, and sends output data after the control action is executed to the Internet of things management platform;
the test case module acquires the output data from the Internet of things management platform and carries out correctness verification on the output data according to the control data;
the test case module is further configured to: calling a service interface of the Internet of things management platform so that the Internet of things management platform responds to calling operation to generate calling data and sends the calling data to the device side SDK; the device side SDK is further configured to: converting the calling data into calling data based on a second transmission protocol, and then sending the calling data to the agent module; the agent module is further configured to: receiving calling data based on a second transmission protocol sent by the SDK of the equipment terminal, converting the calling data based on the second transmission protocol into calling data based on a first transmission protocol, and then sending the calling data to the test case module; the test case module is further configured to: acquiring calling data based on a first transmission protocol, and checking the correctness of the calling data based on the first transmission protocol according to the calling operation.
8. The utility model provides an electronic equipment of thing networking management platform test which characterized in that includes:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
9. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN202010182502.6A 2020-03-16 2020-03-16 Method, device and system for testing management platform of Internet of things Active CN111786939B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010182502.6A CN111786939B (en) 2020-03-16 2020-03-16 Method, device and system for testing management platform of Internet of things

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010182502.6A CN111786939B (en) 2020-03-16 2020-03-16 Method, device and system for testing management platform of Internet of things

Publications (2)

Publication Number Publication Date
CN111786939A CN111786939A (en) 2020-10-16
CN111786939B true CN111786939B (en) 2022-09-30

Family

ID=72753173

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010182502.6A Active CN111786939B (en) 2020-03-16 2020-03-16 Method, device and system for testing management platform of Internet of things

Country Status (1)

Country Link
CN (1) CN111786939B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112422372B (en) * 2020-12-04 2022-10-04 重庆忽米网络科技有限公司 MQTT protocol industrial equipment data simulation method based on reflection mechanism
CN114911690A (en) * 2021-02-09 2022-08-16 阿里巴巴集团控股有限公司 Test method, system and computer program product
CN115174458B (en) * 2022-06-29 2024-04-19 北京天融信网络安全技术有限公司 Test method and device for simulating Internet of things gateway online
CN115208791B (en) * 2022-09-16 2022-12-13 江苏橙智云信息技术有限公司 Method for testing functions of Internet of things equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104053164A (en) * 2013-03-14 2014-09-17 深圳先进技术研究院 Internet-of-things gateway testing system and method
CN109791727A (en) * 2017-07-06 2019-05-21 韩国电力公社 Measurement data acquisition system, method and the recording medium for storing it
CN109960644A (en) * 2017-12-22 2019-07-02 北京奇虎科技有限公司 A kind of test method and system of SDK

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9292416B2 (en) * 2012-10-12 2016-03-22 Vmware, Inc. Software development kit testing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104053164A (en) * 2013-03-14 2014-09-17 深圳先进技术研究院 Internet-of-things gateway testing system and method
CN109791727A (en) * 2017-07-06 2019-05-21 韩国电力公社 Measurement data acquisition system, method and the recording medium for storing it
CN109960644A (en) * 2017-12-22 2019-07-02 北京奇虎科技有限公司 A kind of test method and system of SDK

Also Published As

Publication number Publication date
CN111786939A (en) 2020-10-16

Similar Documents

Publication Publication Date Title
CN111786939B (en) Method, device and system for testing management platform of Internet of things
CN110442524B (en) Method and device for testing web service interface with authentication authorization
CN109815107B (en) Method and device for automatic testing
CN109873863B (en) Asynchronous calling method and device of service
CN114979295B (en) Gateway management method and device
CN112084042B (en) Message processing method and device
CN110888639A (en) Business code compiling and packaging method and device
CN109218041B (en) Request processing method and device for server system
CN112015383A (en) Login method and device
CN113778499B (en) Method, apparatus, device and computer readable medium for publishing services
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN113127335A (en) System testing method and device
CN112131095B (en) Pressure testing method and device
CN109462491B (en) System, method and apparatus for testing server functionality
CN111488268A (en) Dispatching method and dispatching device for automatic test
CN114500481A (en) Service request processing method, system and device
CN112579447A (en) Browser testing method and device
CN113778844A (en) Automatic performance testing method and device
CN113485902B (en) Method, device, equipment and computer readable medium for testing service platform
CN112559001A (en) Method and device for updating application
CN113760715A (en) Method and device for testing system
CN113779018A (en) Data processing method and device
CN110728009A (en) Simulation method, device and system
CN113342633B (en) Performance test method and device
CN112783753B (en) Testing method and device for stream data processing system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant