An interactive test method, device, equipment and readable storage medium
By automatically generating test data through imported object models and databases, and combining it with an automated testing system, the problems of low efficiency and incomplete coverage in IoT terminal data interaction testing are solved, enabling fast and accurate data interaction detection.
Patent Information
- Application Number
- CN202311824518.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2043-12-27
AI Technical Summary
Current data interaction testing for IoT terminals mainly relies on manual testing, which suffers from low testing efficiency and incomplete coverage.
By importing object models and pre-configured information databases, test data is automatically generated, and the interaction between IoT terminals and business platforms is automatically controlled through the test system to achieve automatic data detection.
It enables rapid and effective detection of errors in the data interaction process between IoT terminals and business platforms, improving testing efficiency and coverage, and ensuring the accuracy of data interaction.
Smart Images

Figure CN118827441B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of Internet of Things, and particularly relates to an interaction test method and device, equipment and a readable storage medium. BACKGROUND
[0002] In the test of an Internet of Things service system, data interaction test between a service platform and an Internet of Things terminal is an important link, which includes whether data reported by the Internet of Things terminal can be normally stored and displayed on the service platform and whether data issued by the service platform conforms to a protocol specification and is normally issued to the Internet of Things terminal.
[0003] The existing data interaction test of the Internet of Things terminal mainly adopts a manual test mode, and uses a real terminal or a simulated terminal to test the interaction between the Internet of Things terminal and the service platform.
[0004] However, the manual test of the data interaction between the Internet of Things terminal and the service platform has the defects of low test efficiency and incomplete coverage. SUMMARY
[0005] The present application provides an interaction test method, device, equipment and readable storage medium, which can quickly and effectively automatically detect whether there is an error in the data interaction process between the Internet of Things terminal and the service platform.
[0006] In a first aspect, the present application provides an interaction test method applied to a test system, which includes: importing a thing model; generating first test data according to the thing model and a pre-configured information base; sending the first test data to a first target end and sending the first test data to a second target end through the first target end, the first target end including one of an Internet of Things terminal and a service platform, and the second target end including the other of the Internet of Things terminal and the service platform; obtaining second test data received by the second target end; and judging whether the first test data is consistent with the second test data to obtain a judgment result of the first test data and the second test data.
[0007] According to the embodiment of the first aspect of the present application, before obtaining the second test data received by the second target end, the interaction test method further includes: configuring interface information of the service platform; and obtaining the second test data received by the second target end, including: calling a corresponding service platform interface according to the interface information; and obtaining the second test data through the service platform interface.
[0008] According to the foregoing embodiment of the first aspect of the application, the first target end comprises an Internet of Things terminal, the second target end comprises a service platform, the interface information of the service platform comprises service query interface information, and the service platform interface comprises a service query interface. Configuring the interface information of the service platform comprises configuring the service query interface information. According to the interface information, the corresponding service platform interface is called, which comprises calling the service query interface according to the service query interface information. The second test data is obtained through the service platform interface, which comprises obtaining the second test data through the service query interface.
[0009] According to any one of the foregoing embodiments of the first aspect of the application, the first target end comprises a service platform, the second target end comprises an Internet of Things terminal, the interface information of the service platform comprises service delivery interface information, and the service platform interface comprises a service delivery interface. Configuring the interface information of the service platform comprises configuring the service delivery interface information. According to the interface information, the corresponding service platform interface is called, which comprises calling the service delivery interface according to the service delivery interface information. The second test data is obtained through the service platform interface, which comprises obtaining the second test data through the service delivery interface.
[0010] According to any one of the foregoing embodiments of the first aspect of the application, before judging whether the first test data and the second test data are consistent, the interactive test method further comprises: associating the physical model field information and the field information returned by the service platform interface; judging whether the first test data and the second test data are consistent comprises: comparing all the physical model field information and all the field information returned by the service platform interface; when the comparison result is consistent, it is determined that the first test data and the second test data are consistent; when the comparison result is inconsistent, it is determined that the first test data and the second test data are inconsistent.
[0011] According to any one of the foregoing embodiments of the first aspect of the application, the interactive test method further comprises: when the comparison result of all the physical model field information and all the field information returned by the service platform interface is inconsistent, obtaining and outputting the inconsistent physical model field information; judging whether the first test data and the second test data are consistent to obtain the judgment result of the first test data and the second test data comprises: judging whether the first test data and the second test data are consistent, and in the case of inconsistent judgment result, outputting the judgment result that the first test data and the second test data are inconsistent and the inconsistent physical model field information.
[0012] According to any one of the foregoing embodiments of the first aspect of the application, before sending the first test data to the first target end and sending the first test data to the second target end through the first target end, the interactive method further comprises: generating a simulated Internet of Things terminal; the Internet of Things terminal comprises the simulated Internet of Things terminal.
[0013] According to any one of the foregoing embodiments of the first aspect of the application, the object model comprises data attributes and object model field information corresponding to the data attributes, and the object model field information comprises a data type, a value range, a step size, and a unit; and the first test data is generated according to the object model and the preconfigured information base, including: generating the first test data according to the data attributes and the data type, the value range of the data attributes, the step size of the data attributes, the unit of the data attributes, and the preconfigured information base.
[0014] In a second aspect, the embodiments of the application provide an interactive testing device, which comprises: an import module configured to import an object model; a generation module configured to generate first test data according to the object model and a preconfigured information base; a sending module configured to send the first test data to a first target end and send the first test data to a second target end through the first target end, the first target end comprising one of an Internet of Things terminal and a business platform, and the second target end comprising the other of the Internet of Things terminal and the business platform; an acquisition module configured to acquire second test data received by the second target end; and a judgment module configured to judge whether the first test data and the second test data are consistent, and obtain a judgment result of the first test data and the second test data.
[0015] In a third aspect, the embodiments of the application provide an electronic device, which comprises a processor and a memory storing computer program instructions; and the processor implements the interactive testing method of any one of the embodiments of the first aspect when executing the computer program instructions.
[0016] In a fourth aspect, a computer readable storage medium stores computer program instructions, and the computer program instructions are executed by a processor to implement the interactive testing method of any one of the embodiments of the first aspect.
[0017] The interactive testing method, device, equipment, and readable storage medium provided by the embodiments of the application can automatically generate test data by importing an object model and a preconfigured information base, automatically control an Internet of Things terminal and a business platform to use the test data for interaction through a testing system, and automatically detect an interactive testing result, thereby quickly and effectively detecting whether a data interaction process of the Internet of Things terminal and the business platform is correct. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiments of the application. Those skilled in the art can obtain other drawings according to these drawings without any creative effort.
[0019] Figure 1 is a flowchart of the interactive testing method provided by the embodiments of the application;
[0020] Figure 2 is a functional schematic diagram of a test system provided by an embodiment of the present application;
[0021] Figure 3 is a structural schematic diagram of an interactive test device provided by an embodiment of the present application;
[0022] Figure 4 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0023] The features and exemplary embodiments of various aspects of the present application will be described below in detail, in order to make the purposes, technical solutions and advantages of the present application more clear and apparent, the present application will be further described in detail below in combination with the drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, but not to limit the present application. The present application can be implemented without some of these specific details by those skilled in the art. The following description of the embodiments is only to provide a better understanding of the present application by showing examples of the present application.
[0024] The acquisition, storage, use, processing, etc. of data in the technical solutions of the present application all comply with the relevant provisions of national laws and regulations.
[0025] It should be noted that, in this document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises... a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the listed element.
[0026] It should be understood that the term "and / or" used herein is only to describe the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the three cases of A alone, A and B together, and B alone. In addition, the character " / " in this document generally represents an "or" relationship between the front and rear associated objects.
[0027] Various modifications and variations can be made to this application without departing from its spirit or scope, which will be apparent to those skilled in the art. Therefore, this application is intended to cover modifications and variations falling within the scope of the corresponding claims (the claimed technical solutions) and their equivalents. It should be noted that the embodiments provided in this application can be combined with each other without contradiction.
[0028] Before describing the technical solutions provided in the embodiments of this application, in order to facilitate understanding of the embodiments of this application, this application first specifically explains the problems existing in the related technologies:
[0029] Current IoT terminal data interaction testing primarily employs manual testing methods, using either real or simulated terminals to test the interaction between the terminal and the business platform. This type of testing mainly consists of data reporting tests and data distribution tests. In data reporting tests, data is manually modified on the terminal or simulated terminal, then manually uploaded to the gateway and business platform, and finally manually checked for correct data upload on the business platform. In data distribution tests, fields are manually modified on the business platform before data is distributed to the gateway and terminal, and finally manually checked for correct data distribution on the terminal.
[0030] Taking the reporting of data from an IoT terminal to a business platform as an example, the test engineer inputs the corresponding attribute data (e.g., voltage 220.12V) through the IoT terminal or a simulated terminal. After the data is reported, it reaches the IoT gateway, which forwards the data to the IoT platform. Finally, the test engineer logs into the business platform to check whether the device voltage displayed on the page is 220.12V.
[0031] Taking the data transmission from the business platform to the IoT terminal as an example, the test engineer sets the corresponding device attribute data (e.g., voltage 220.12V) through the IoT business platform. After the data is set, it is transmitted to the IoT gateway, which then forwards the data to the IoT terminal or a simulated terminal. The test engineer checks whether the received data on the simulated terminal is consistent with that of the business platform.
[0032] During the interaction testing between IoT terminals and business platforms, manual testing of data upload and download is required for all interaction fields to verify whether the business system displays the data correctly after upload and whether the terminal receives the data correctly after download. This testing is primarily used to identify defects caused by incorrect data format, out-of-bounds boundary values, data truncation, and data loss. However, this method has the following problems:
[0033] 1. Based on the interaction protocol (object model), a large number of fields and values need to be manually tested, which results in a large workload and low testing efficiency.
[0034] 2、According to the interaction protocol (object model), the full test field and the value need a lot of time and manpower, in practice, often because of limited resources to take the way of sampling inspection, and sampling inspection test can lead to incomplete test coverage, test effect is not good, thus leading to business system defects.
[0035] To solve the above technical problems, the embodiment of the application provides an interactive test method, device, equipment and readable storage medium. First of all, the interactive test method provided by the embodiment of the application is introduced in detail.
[0036] Figure 1 is a flowchart of the interactive test method provided by the embodiment of the application, as Figure 1 shown, the interactive test method 100 is applied to a test system, the test system includes information library definition, data generation, terminal simulation, data verification and other functions, which will be described later.
[0037] The interactive test method 100 can include S101-S105.
[0038] S101, import object model.
[0039] Among them, the object model refers to defining the function of the terminal product, abstracting and summarizing the functions of terminal products of different brands and different categories, including attributes, methods and events. The parameters of the method and the event are attributes. For example: the water level and voltage parameters of a certain water level meter can be summarized as an object model.
[0040] S101 mainly imports the object model in json format into the test system, and stores it in the database. The object model will be used for subsequent field association and first test data generation.
[0041] S102, generating first test data according to the object model and the preconfigured information library.
[0042] In some embodiments, the object model includes data attributes and object model field information corresponding to the data attributes, and the object model field information includes data type, value range, step and unit; S102 can specifically include step one.
[0043] Step one, generating first test data according to the data attributes and the data type corresponding to the data attributes, the value range of the data attributes, the step of the data attributes, the unit of the data attributes and the preconfigured information library.
[0044] The information base is used to maintain the device attribute data generation information in the thing model, that is, "thing model field + corresponding information = test data". The thing model field can be understood as a business parameter that may be used in the business interaction process between the Internet of Things terminal and the business platform. The information corresponding to each business parameter includes information name, field type, state, information description, etc. Users can query, add, delete, modify, enable, and disable information through the information base. When the information is enabled, the automatic test system will generate test data according to the information during subsequent reporting and issuing of tests.
[0045] For example, the imported thing model voltage attribute (voltage) has the following information: data type: double; read-write type: read-write; value range: 100-300; step: 0.01. This is the information of the thing model field corresponding to the voltage.
[0046] The pre-configured double-type data information base can include:
[0047] Information 1: minimum value of the value range.
[0048] According to the value range in the thing model field information of the thing model and information 1 in the pre-configured information base, the test data 100 is generated. Similarly:
[0049] Information 2: maximum value of the value range, test data 300 is generated
[0050] Information 3: minimum value of the value range + step, test data 300.01 is generated
[0051] Information N: user-extended information, test data M is generated.
[0052] For example, the rain gauge-thing model-rainfall attribute thing model:
[0053] Data type: int32; value range: 1-10000; step: 1, unit: mm
[0054] Information 1, information 2, and information 3 of the int32 data type in the information base are enabled.
[0055] According to information 1, test data 1 is generated
[0056] According to information 2, test data 10000 is generated
[0057] According to information 3, test data 2 is generated.
[0058] S103, send the first test data to the first target end, and send the first test data to the second target end through the first target end.
[0059] The first target end comprises one of an Internet of Things terminal and a business platform, and the second target end comprises the other of the Internet of Things terminal and the business platform.
[0060] The Internet of Things business platform refers to a customer-oriented application platform. The customer can view the Internet of Things device, check the device data, configure data alarm rules, and issue device operation commands through the business platform, for example, a certain reservoir monitoring platform. The Internet of Things terminal refers to a device that collects data and sends data to the network layer, for example, a certain water level meter. The Internet of Things terminal and the business platform interact through the Internet of Things gateway. The Internet of Things gateway is between the Internet of Things terminal and the Internet of Things business platform and is a software platform for data forwarding, for example, OneNet and Ali Cloud Internet of Things platform.
[0061] S103 means that the test system can control the Internet of Things terminal to send first test data to the business platform or control the business platform to send first test data to the Internet of Things terminal.
[0062] In some embodiments, before S103, the first test data is sent to the first target end, and the first test data is sent to the second target end through the first target end, the interaction test method further comprises: generating a simulated Internet of Things terminal; and the Internet of Things terminal can comprise the simulated Internet of Things terminal. The simulated Internet of Things terminal is a software system that uses a thing model as a protocol specification and uses simulated data for uploading and receiving functions. The user starts a simulated Internet of Things terminal by configuring the Internet of Things gateway and device information. After the simulated Internet of Things terminal is started, it will support data sending and receiving, and subscribe to the topic configured in the previous link. The system simulates the terminal mainly for the Message Queuing Telemetry Transport (MQTT) protocol, Costrained Application Protocal (CoAP protocol), and Lightweight M2M (LwM2M) protocol. The simulated Internet of Things terminal can be extended in a similar way. The simulated test terminal is developed using paho-mqtt and includes message sending, information subscription, and message receiving functions.
[0063] S104, acquiring second test data received by the second target end.
[0064] S105, judging whether the first test data and the second test data are consistent, obtaining a judgment result of the first test data and the second test data.
[0065] Continuing to refer to the example of generating test data in step one above, taking the example of reporting test data from the Internet of Things terminal to the business platform, the voltage attribute voltage, according to information 1, automatically generates first test data voltage: 100V; the test system calls the Internet of Things terminal to automatically report the first test data voltage: 100V; the test system automatically calls the business system query interface to obtain interface second test data voltage*: 100V; the automated test system automatically compares voltage = voltage*, and determines that the test is passed.
[0066] In some embodiments, before determining whether the first test data and the second test data are consistent in S105, the interactive test method 100 can further include step two.
[0067] Step two, associate the field information of the object model with the field information returned by the business platform interface.
[0068] On the basis of step two, S105 can specifically include steps three to five.
[0069] Step three, compare all the field information of the object model with all the field information returned by the business platform interface;
[0070] Step four, when the comparison result is consistent, determine that the first test data and the second test data are consistent;
[0071] Step five, when the comparison result is inconsistent, determine that the first test data and the second test data are inconsistent.
[0072] That is, the test system compares the field information in the object model with the field information returned by the business platform interface, automatically associates the fields with the same key value (ignoring case) through the comparison of the key values in the json, and stores the association relationship in the database. The association will be used to automatically compare the value values, and output the verification result.
[0073] In some embodiments, when the automatic association of the fields is not complete or there is an error, the key values of the object model and the interface returned fields can be associated through a manual association function, and the association result is stored in the database. The manually associated fields are a supplement to the automatically associated fields.
[0074] Through the manual association of the fields and the automatic association of the fields, all fields covered in the object model can be fully covered in the interactive test between the Internet of Things terminal and the business platform. And each field can be covered to its boundary value, normal value, decimal place, etc. according to the new rule, so that the test range of the test system is more extensive.
[0075] In some embodiments, the interactive test method can further include step six.
[0076] Step six, when there is inconsistency between all the physical model field information and all the business platform interface returned field information, obtaining and outputting the inconsistent physical model field information;
[0077] On the basis of step five, step six can be specifically: judging whether the first test data and the second test data are consistent, and outputting the judgment result that the first test data and the second test data are inconsistent and the inconsistent physical model field information in the case of inconsistent judgment result.
[0078] Through the above test, it can be judged whether the logic of the business system for receiving, analyzing, storing, presenting and sending interactive data is correct, for example, the data type in the physical model field information is associated with the data type of the business platform interface. The first test data voltage: 100.01V is sent from the Internet of Things terminal to the business platform, the first test data supports the step size of two decimal places, if the data type of the business platform interface is int, the data storage and receiving value is 100, at this time, 100! = 100.01 is automatically checked, and the checking result is error, so this defect is found. The first test data and the second test data are outputted as inconsistent, and the data types are outputted as different, so as to facilitate manual checking.
[0079] In general, in the result verification stage, the test system will automatically verify the reported data and the business interface data, output the verification result by comparing whether the value of the associated field is consistent. If the result is consistent, it indicates that the data specification of the Internet of Things terminal and the business platform is matched, and through this test, the Internet of Things terminal and the business platform can meet the corresponding data specification when they perform business interaction, thereby improving the business accuracy. The system will output the execution results of the first test data for N times respectively, and the test passes if the execution result verification passes, otherwise fails. The system will display the fields in the reported data that are not associated, the fields in the interface query that are not associated, the fields that have been associated and the verification result is passed, and the fields that have been associated but the verification result fails through the comparison of the text color, for manual checking by the user.
[0080] The interactive test method of the embodiment of the application realizes automatic generation of test data by importing the physical model and the pre-configured information library, automatically controls the Internet of Things terminal and the business platform to use the test data for interaction through the test system, and automatically detects the interactive test result, thereby realizing rapid and effective detection of whether the data interaction process of the Internet of Things terminal and the business platform exists error.
[0081] In some embodiments, before S104, obtaining the second test data received by the second target terminal, the interactive test method can further include: step six.
[0082] Step six, configuring the interface information of the business platform.
[0083] The service platform interface includes a service query interface and a service delivery interface; and the service platform interface information includes service query interface information and service delivery interface information.
[0084] Step six is mainly to configure the service query interface to the test system and store it in the database. The interface needs to include interface address, authentication information, calling method, and calling parameters. When the interface configuration is completed, the system will automatically call the service query interface once, display the information returned by the service query interface, and store it in the database.
[0085] Step six can also be to configure the service delivery interface to the test system and store it in the database. The interface needs to include interface address, authentication information, calling method, and calling parameters. The difference from the service query interface is that the service delivery interface uses the fields in the calling parameters to associate with the physical model fields.
[0086] In some embodiments, after the data is reported or delivered, the test system will call the service platform interface according to the service platform interface information defined in the previous link to obtain the data displayed by the service platform. Considering the delay between data interaction and service platform display, the test system can support custom waiting time.
[0087] On the basis of step six, the S104, obtaining the second test data received by the second target end, can specifically be: calling the corresponding service platform interface according to the interface information; obtaining the second test data through the service platform interface.
[0088] Taking the first target end as an Internet of Things terminal and the second target end as a service platform as an example, the service query interface information should be configured, the service query interface is called according to the service query interface information, and the second test data is obtained through the service query interface.
[0089] Taking the first target end as a service platform and the second target end as an Internet of Things terminal as an example, the service delivery interface information should be configured, the service delivery interface is called according to the service delivery interface information, and the second test data is obtained through the service delivery interface.
[0090] In general, the interactive test method is divided into two stages:
[0091] The first stage is a task configuration stage, which includes a configuration information library, a new test task, an imported object model, a configured business query interface, automatic association and manual association fields. Through the task configuration stage, a data reporting test task from an Internet of Things terminal to a business platform or a data delivery test task from the business platform to the Internet of Things terminal can be generated. The new test task is mainly used to create a new task and query and modify an existing test task, and the task includes a task type, a task ID, a task name, a creator and the like. Meanwhile, the user needs to input basic configuration information in this function, and the configuration information includes a connection address of an Internet of Things gateway, authentication, a name of a device in the Internet of Things gateway and authentication, subject information of device communication and the like. The configuration details of other task configuration stages have been described above, and will not be repeated here.
[0092] The second stage is an execution automation test stage. After the task is created and configured in the previous stage, a test task and a test message are generated. It should be noted that the first test data generated in the data delivery process is consistent with the data reporting process, but there are differences in the generated message range and the generated message format. The difference in the generated message range is that the data delivery process only generates message data for the attributes in the device object model whose read-write type contains writing. The difference in the generated message format is that the generated message is a message for the business platform interface delivery. According to the fields associated in the previous link "object model-business platform interface", the fields that have been successfully associated generate data according to the rules enabled for this type of field, and the fields that have not been successfully associated use default values. The related data is stored in the database, and the user can modify it. In this stage, the user can select and execute the corresponding test task. This stage mainly includes executing an automated test, generating a simulated test terminal, generating reporting data according to rules and querying business interface data, which has been described above and will not be repeated here.
[0093] The application uses the python language to realize an interactive test method and a test system. The test system maintains a set of object model test data generation information library, and automatically generates a simulated Internet of Things terminal and N pieces of first test data according to the object model of the Internet of Things terminal and the information library. The system is divided into data reporting test and data delivery test. In the reporting test, the data reported by the test Internet of Things simulation test terminal and the data received and presented by the business platform are tested for consistency; in the delivery test, the data sent by the business platform and the data received by the Internet of Things simulation test terminal are tested for consistency.
[0094] In the proposal, whether the data specifications between the Internet of Things terminal and the business platform match can be verified through the interactive test, so as to improve the accuracy and effectiveness of the business executed by the Internet of Things terminal after accessing the business platform; and the test data corresponding to the requirements is generated according to the test task on the basis of the thing model and the corresponding rule library, so that the flexibility and diversity of the test data selection are improved, the full-amount business parameter test of the Internet of Things can be met, the coverage is comprehensive, and the data interaction test effect is improved.
[0095] In some embodiments, as shown in Figure 2 , Figure 2 is a functional schematic diagram of a test system provided by an embodiment of the application. The test system 200 can receive imported thing models, have a saved setting information library, perform field association, generate first test data, generate simulated Internet of Things terminals, perform data sending, data receiving, interface calling, data verification, and output test results, and can interact with a business platform to obtain interface information of the business platform, and interact with the business platform through an Internet of Things gateway to transmit the first test data.
[0096] Based on the same technical concept as the interactive test method provided in the above embodiment, the application further provides an interactive test device. See the following embodiments.
[0097] Figure 3 is a structural schematic diagram of an interactive test device provided by an embodiment of the application. As shown in Figure 3 , the interactive test device 300 can include an import module 301, a generation module 302, a sending module 303, an acquisition module 304, and a judgment module 305.
[0098] The import module 301 is configured to import thing models.
[0099] The generation module 302 is configured to generate first test data according to the thing models and a preconfigured information library.
[0100] The sending module 303 is configured to send the first test data to a first target end and send the first test data to a second target end through the first target end, the first target end including one of an Internet of Things terminal and a business platform, and the second target end including the other of the Internet of Things terminal and the business platform.
[0101] The acquisition module 304 is configured to acquire second test data received by the second target end.
[0102] The judgment module 305 is configured to judge whether the first test data and the second test data are consistent, and obtain a judgment result of the first test data and the second test data.
[0103] In some embodiments, the interaction testing apparatus comprises a configuration module configured to configure interface information of the service platform; the obtaining module 304 is specifically configured to call the corresponding service platform interface according to the interface information; and the second test data is obtained through the service platform interface.
[0104] In some embodiments, the first target end comprises an Internet of Things terminal, the second target end comprises a service platform, the interface information of the service platform comprises service query interface information, and the service platform interface comprises a service query interface; the configuration module is specifically configured to configure the service query interface information; the obtaining module 304 is specifically configured to call the service query interface according to the service query interface information; and the second test data is obtained through the service query interface.
[0105] In some embodiments, the first target end comprises a service platform, the second target end comprises an Internet of Things terminal, the interface information of the service platform comprises service delivery interface information, and the service platform interface comprises a service delivery interface; the configuration module is specifically configured to configure the service delivery interface information; the obtaining module 304 is specifically configured to call the service delivery interface according to the service delivery interface information; and the second test data is obtained through the service delivery interface.
[0106] In some embodiments, the interaction testing apparatus further comprises an association module, the judgment module 305 comprises a comparison sub-module, the association module is specifically configured to associate the physical model field information and the field information returned by the service platform interface; the comparison sub-module is specifically configured to compare all the physical model field information and all the field information returned by the service platform interface; when the comparison result is consistent, it is determined that the first test data is consistent with the second test data; and when the comparison result is inconsistent, it is determined that the first test data is inconsistent with the second test data.
[0107] In some embodiments, the judgment module is specifically configured to judge whether the first test data is consistent with the second test data, and in the case that the judgment result is inconsistent, the judgment result that the first test data is inconsistent with the second test data and the inconsistent physical model field information are outputted.
[0108] In some embodiments, the generation module 302 is further configured to generate a simulated Internet of Things terminal; and the Internet of Things terminal comprises the simulated Internet of Things terminal.
[0109] In some embodiments, the physical model comprises data attributes and physical model field information corresponding to the data attributes, the physical model field information comprises data types, value ranges, steps and units; and the generation module 202 is specifically configured to generate the first test data according to the data attributes and the data types corresponding to the data attributes, the value ranges of the data attributes, the steps of the data attributes, the units of the data attributes and the pre-configured information base.
[0110] The interactive test device of the embodiment of the application realizes automatic generation of test data by importing the object model and the pre-configured information base, and realizes automatic detection of the interactive test result by automatically controlling the Internet of Things terminal and the business platform to use the test data for interaction and by the test system, so that whether the data interaction process of the Internet of Things terminal and the business platform exists error is quickly and effectively detected.
[0111] Figure 4 An electronic device schematic diagram provided by the embodiment of the application is shown in FIG. 1. Figure 4 As shown in FIG. 1, the electronic device includes a processor 401 and a memory 402 storing computer program instructions.
[0112] Specifically, the processor 401 can include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or can be configured to implement one or more integrated circuits of the embodiment of the application.
[0113] The memory 402 can include a mass storage for data or instructions. By way of example and not limitation, the memory 402 can include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 402 can include removable or non-removable (or fixed) media. Where appropriate, the memory 402 can be internal or external to the electronic device. In certain embodiments, the memory 402 is a non-volatile solid-state memory.
[0114] The memory can include read-only memory (ROM), random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Thus, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions that, when executed (e.g., by one or more processors), are operable to perform the operations described with reference to the method according to the first aspect of the application.
[0115] The processor 401 realizes any one of the interactive test methods in the above embodiments by reading and executing the computer program instructions stored in the memory 402.
[0116] In one example, the electronic device can further include a communication interface 403 and a bus 410. Wherein, as shown in Figure 4 the processor 401, the memory 402, the communication interface 403 are connected through the bus 410 and complete the communication between each other.
[0117] The communication interface 403 is mainly used to realize the communication between each module, device, unit and / or equipment in the embodiments of the application.
[0118] The bus 410 includes hardware, software or both to couple the components of the terminal service device to each other. By way of example, and not limitation, the bus can include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Linear Predictive Coding (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (Peripheral Component Interconnect-X, PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VESA Local Bus, VLB) bus, or another suitable bus or combination of two or more of these. Where appropriate, the bus 410 can include one or more buses. Although the embodiments of the application describe and illustrate a particular bus, the application contemplates any suitable bus or interconnect.
[0119] The device can perform the interaction test method in the embodiments of the application based on each unit / component in the interaction test device, thereby realizing Figure 1 the interaction test method described.
[0120] In addition, in combination with the interactive test method in the above-mentioned embodiments, the embodiments of the present application can provide a computer readable storage medium for implementation. The computer readable storage medium has computer program instructions stored thereon; the computer program instructions are executed by a processor to implement any one of the interactive test methods in the above-mentioned embodiments.
[0121] It should be noted that the present application is not limited to the specific configurations and processes described above and shown in the drawings. For the sake of brevity, detailed descriptions of well-known methods are omitted. In the above-mentioned embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order of the steps, after understanding the spirit of the present application.
[0122] The functional blocks shown in the structural block diagrams described above can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional card, etc. When implemented in software, the elements of the present application are program or code segments used to perform the required tasks. The program or code segments can be stored in a machine readable medium or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. The "machine readable medium" can include any medium capable of storing or transmitting information. Examples of machine readable media include electronic circuits, semiconductor memory devices, read-only memory (ROM), flash memory, erasable read-only memory (EROM), floppy disks, compact discs (CD-ROM), optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segments can be downloaded via a computer network such as the Internet, an intranet, etc.
[0123] It should also be noted that the exemplary embodiments mentioned in the present application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above-mentioned steps, that is, the steps can be executed in the order mentioned in the embodiments, or in an order different from the embodiments, or several steps can be executed simultaneously.
[0124] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other processing device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other processing device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0125] The above only specifically describes the embodiments of the present application. For the convenience and brevity of description, the specific working processes of the above-described system, module and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described herein. It should be understood that the protection scope of the present application is not limited in this way. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed in the present application, and these modifications or replacements should be covered within the protection scope of the present application.
Claims
1. An interactive testing method, characterized by, The method is applied to a test system, and the method comprises: importing a model; generating first test data according to the model and a pre-configured information base; sending the first test data to a first target end and sending the first test data to a second target end through the first target end, the first target end comprising one of an Internet of Things terminal and a business platform, and the second target end comprising the other of the Internet of Things terminal and the business platform; obtaining second test data received by the second target end; judging whether the first test data and the second test data are consistent, to obtain a judgment result of the first test data and the second test data; before the obtaining of the second test data, the method further comprises: configuring interface information of the business platform; the obtaining of the second test data received by the second target end comprises: calling a corresponding business platform interface according to the interface information; obtaining the second test data through the business platform interface; before the judging of whether the first test data and the second test data are consistent, the method further comprises: associating model field information and field information returned by the business platform interface; the judging of whether the first test data and the second test data are consistent comprises: comparing all the model field information and all the field information returned by the business platform interface; when the comparison result is consistent, it is determined that the first test data and the second test data are consistent; when the comparison result is inconsistent, it is determined that the first test data and the second test data are inconsistent.
2. The interactive test method of claim 1, wherein, the first target end comprises the Internet of Things terminal, the second target end comprises the business platform, the interface information of the business platform comprises business query interface information, and the business platform interface comprises a business query interface; the configuring of the interface information of the business platform comprises: configuring the business query interface information; the calling of the corresponding business platform interface according to the interface information comprises: calling the business query interface according to the business query interface information; the obtaining of the second test data through the business platform interface comprises: obtaining the second test data through the business query interface.
3. The interactive test method of claim 1, wherein, the first target end comprises the business platform, the second target end comprises the Internet of Things terminal, the interface information of the business platform comprises business delivery interface information, and the business platform interface comprises a business delivery interface; the configuring of the interface information of the business platform comprises: configuring the business delivery interface information; the calling of the corresponding business platform interface according to the interface information comprises: calling the business delivery interface according to the business delivery interface information; the obtaining of the second test data through the business platform interface comprises: obtaining the second test data through the business delivery interface.
4. The method of interactive testing of claim 1, wherein, the method further comprises: when the comparison result of all the model field information and all the field information returned by the business platform interface is inconsistent, obtaining and outputting inconsistent model field information. The judging whether the first test data is consistent with the second test data comprises: judging whether the first test data is consistent with the second test data, and outputting a judging result that the first test data is inconsistent with the second test data and inconsistent model field information in a case where the judging result is inconsistent.
5. The method of interactive testing of claim 1, wherein, Before the first test data is sent to the first target end and sent to the second target end through the first target end, the method further comprises: generating a simulated Internet of Things terminal; The Internet of Things terminal comprises the simulated Internet of Things terminal.
6. The method of interactive testing of claim 1, wherein, The model comprises data attributes and model field information corresponding to the data attributes, and the model field information comprises data types, value ranges, step sizes and units; The first test data is generated according to the model and a preconfigured information base, comprising: The first test data is generated according to the data attributes, data types corresponding to the data attributes, value ranges of the data attributes, step sizes of the data attributes, units of the data attributes and the preconfigured information base.
7. An interactive testing device, characterized by comprising: an importing module configured to import a model; a generating module configured to generate first test data according to the model and a preconfigured information base; a sending module configured to send the first test data to a first target end and send the first test data to a second target end through the first target end, the first target end comprising one of an Internet of Things terminal and a business platform, and the second target end comprising the other of the Internet of Things terminal and the business platform; an acquiring module configured to acquire second test data received by the second target end; a judging module configured to judge whether the first test data is consistent with the second test data, and obtain a judging result of the first test data and the second test data; Before the acquiring module is configured to acquire the second test data received by the second target end, the apparatus further comprises a configuring module: The configuring module is configured to configure interface information of the business platform; The acquiring module is configured to acquire the second test data received by the second target end, and specifically configured to: invoke a corresponding business platform interface according to the interface information; acquire the second test data through the business platform interface; Before the judging module is configured to judge whether the first test data is consistent with the second test data, the apparatus further comprises an associating module: The associating module is configured to associate model field information and field information returned by the business platform interface; The judging module is configured to judge whether the first test data is consistent with the second test data, and specifically configured to: compare all the model field information with all the field information returned by the business platform interface; when the comparison result is consistent, determine that the first test data is consistent with the second test data; when the comparison result is inconsistent, determine that the first test data is inconsistent with the second test data.
8. An electronic device, comprising: The electronic device comprises a processor and a memory storing computer program instructions; The processor executes the computer program instructions to implement the interactive test method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer program instructions, and the computer program instructions are executed by the processor to implement the interactive test method according to any one of claims 1-6.
Citation Information
Patent Citations
Service test system and method, electronic equipment and storage medium
CN113923144A
Platform performance test method and device, electronic equipment and readable storage medium
CN114003503A