[go: up one dir, main page]

CN115865725A - Stability testing method, system, equipment and storage medium of lighting IoT platform - Google Patents

Stability testing method, system, equipment and storage medium of lighting IoT platform Download PDF

Info

Publication number
CN115865725A
CN115865725A CN202211439423.4A CN202211439423A CN115865725A CN 115865725 A CN115865725 A CN 115865725A CN 202211439423 A CN202211439423 A CN 202211439423A CN 115865725 A CN115865725 A CN 115865725A
Authority
CN
China
Prior art keywords
thread
lighting
critical value
things 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.)
Pending
Application number
CN202211439423.4A
Other languages
Chinese (zh)
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.)
Foshan Electrical and Lighting Co Ltd
Original Assignee
Foshan Electrical and Lighting 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 Foshan Electrical and Lighting Co Ltd filed Critical Foshan Electrical and Lighting Co Ltd
Priority to CN202211439423.4A priority Critical patent/CN115865725A/en
Publication of CN115865725A publication Critical patent/CN115865725A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种照明物联网平台稳定性测试方法、系统、设备及存储介质,涉及照明技术领域,所述方法包括:通过数据网关构建照明物联网平台与目标设备之间的连接,以使照明物联网平台与目标设备联通;通过照明物联网平台获取目标设备的请求接口;根据请求接口、数据网关及目标设备构建测试方案;依次执行测试方案并调节线程延迟时间,以记录稳定临界值;根据稳定临界值生成测试报告。采用本发明,可通过对设备响应时间进行持续调度,从而量化照明物联网平台中所有与目标设备交互过程在不同环境下的稳定性情况,提升设备实地部署效率。

Figure 202211439423

The invention discloses a method, system, device and storage medium for testing the stability of a lighting Internet of Things platform, and relates to the field of lighting technology. The method includes: building a connection between the lighting Internet of Things platform and a target device through a data gateway, so that Connect the lighting IoT platform with the target device; obtain the request interface of the target device through the lighting IoT platform; build a test plan according to the request interface, data gateway and target device; execute the test plan in turn and adjust the thread delay time to record the stable critical value; Generate test reports based on stability thresholds. By adopting the present invention, the stability of all interaction processes with target devices in the lighting Internet of Things platform under different environments can be quantified by continuously scheduling the response time of the devices, and the efficiency of field deployment of devices can be improved.

Figure 202211439423

Description

照明物联网平台稳定性测试方法、系统、设备及存储介质Stability testing method, system, equipment and storage medium of lighting IoT platform

技术领域technical field

本发明涉及照明技术领域,尤其涉及一种照明物联网平台稳定性测试方法、系统、设备及存储介质。The invention relates to the field of lighting technology, in particular to a stability testing method, system, equipment and storage medium of a lighting Internet of Things platform.

背景技术Background technique

随着信息化技术的不断进步,物联网产品规模愈发强大,物联网技术亦不断提升,在产品研发的生命周期中,物联网平台与物联设备稳定性交互是产品核心要素。With the continuous advancement of information technology, the scale of Internet of Things products has become stronger and stronger, and the technology of Internet of Things has also been continuously improved. In the life cycle of product development, the stable interaction between the Internet of Things platform and IoT devices is the core element of the product.

在照明技术领域中,传统稳定性测试仅改变设备环境、网络、信号等因素判断用例是否通过,无法通过具体数据表明稳定性情况,在产品应用到实际场景时,各种多变的环境因素会导致测试结果存在较大误差,影响部署进度。In the field of lighting technology, the traditional stability test only changes the equipment environment, network, signal and other factors to judge whether the use case is passed, and cannot show the stability through specific data. When the product is applied to the actual scene, various environmental factors will change. This leads to large errors in the test results and affects the deployment progress.

发明内容Contents of the invention

本发明所要解决的技术问题在于,提供一种照明物联网平台稳定性测试方法、系统、设备及存储介质,可通过对设备响应时间进行持续调度,量化目标设备交互过程的稳定性情况,提升设备实地部署效率。The technical problem to be solved by the present invention is to provide a lighting IoT platform stability testing method, system, equipment and storage medium, which can continuously schedule the response time of the equipment, quantify the stability of the interaction process of the target equipment, and improve the stability of the equipment. Deployment efficiency in the field.

为了解决上述技术问题,本发明提供了一种照明物联网平台稳定性测试方法,包括:通过数据网关构建照明物联网平台与目标设备之间的连接,以使所述照明物联网平台与所述目标设备联通;通过所述照明物联网平台获取所述目标设备的请求接口;根据所述请求接口、数据网关及目标设备构建测试方案;依次执行所述测试方案并调节线程延迟时间,以记录稳定临界值;根据所述稳定临界值生成测试报告。In order to solve the above technical problems, the present invention provides a method for testing the stability of the lighting Internet of Things platform, including: establishing a connection between the lighting Internet of Things platform and the target device through a data gateway, so that the lighting Internet of Things platform and the The target device is connected; the request interface of the target device is obtained through the lighting Internet of Things platform; the test plan is constructed according to the request interface, data gateway and target device; the test plan is executed in sequence and the thread delay time is adjusted to record stable Threshold; generate a test report based on the stable threshold.

作为上述方案的改进,所述根据所述请求接口、数据网关及目标设备构建测试方案的步骤包括:根据所述请求接口及目标设备的执行方式,构建线程组;根据所述数据网关与目标设备,构建联接方式;对所述线程组及联接方式进行组合,以构建测试方案。As an improvement of the above solution, the step of constructing a test solution according to the request interface, data gateway and target device includes: constructing a thread group according to the execution mode of the request interface and target device; , constructing a connection mode; combining the thread group and the connection mode to construct a test scheme.

作为上述方案的改进,所述线程组包括单一线程组及独立线程组;在所述单一线程组中,所述目标设备均置于同一线程组中并按照通道依次发送指令;在所述独立线程组中,一个所述目标设备对应一个线程组并按照通道依次发送指令。As an improvement of the above scheme, the thread group includes a single thread group and an independent thread group; in the single thread group, the target devices are placed in the same thread group and send instructions sequentially according to the channels; in the independent thread In the group, one target device corresponds to one thread group and sends instructions sequentially according to the channel.

作为上述方案的改进,所述联接方式包括单一总线方式及独立总线方式;在所述单一总线方式中,所述目标设备均通过同一总线并联至所述数据网关;在所述独立总线方式中,一个所述目标设备对应一条总线且每一目标设备均通过对应的总线连接至所述数据网关。As an improvement of the above solution, the connection mode includes a single bus mode and an independent bus mode; in the single bus mode, the target devices are connected to the data gateway in parallel through the same bus; in the independent bus mode, One target device corresponds to one bus and each target device is connected to the data gateway through the corresponding bus.

作为上述方案的改进,所述依次执行所述测试方案并调节线程延迟时间,以记录稳定临界值的步骤包括:S1,按照当前测试方案的联接方式连接所述目标设备;S2,修改线程延迟时间;S3,执行当前测试方案的线程组;S4,判断是否存在稳定临界值,判断为是时,记录稳定临界值并执行下一测试方案,判断为否时,返回步骤S1。As an improvement of the above scheme, the step of executing the test scheme in sequence and adjusting the thread delay time to record the stable critical value includes: S1, connecting the target device according to the connection mode of the current test scheme; S2, modifying the thread delay time ; S3, the thread group executing the current test plan; S4, judging whether there is a stable critical value, if it is judged to be yes, record the stable critical value and execute the next test plan, if it is judged to be no, return to step S1.

作为上述方案的改进,所述判断是否存在稳定临界值的步骤包括:判断所述目标设备是否无法正常执行逻辑跳动;判断为是时,则表示存在稳定临界值,并将上一次正常执行的线程延迟时间作为所述照明物联网平台与目标设备交互过程的稳定临界值;判断为否时,则表示不存在稳定临界值。As an improvement of the above solution, the step of judging whether there is a stable critical value includes: judging whether the target device cannot normally perform logical jumping; The delay time is used as a stable critical value in the interaction process between the lighting Internet of Things platform and the target device; when the judgment is negative, it means that there is no stable critical value.

作为上述方案的改进,执行同一测试方案时,根据公式N=n/M修改线程延迟时间,其中,N为修改后的线程延迟时间,n为上一次正常执行的线程延迟时间,M为大于1的正整数。As an improvement of the above scheme, when executing the same test scheme, modify the thread delay time according to the formula N=n/M, where N is the modified thread delay time, n is the last normal execution thread delay time, and M is greater than 1 positive integer of .

相应地,本发明还提供了一种照明物联网平台稳定性测试系统,包括:连接模块,用于通过数据网关构建照明物联网平台与目标设备之间的连接,以使所述照明物联网平台与所述目标设备联通;获取模块,用于通过所述照明物联网平台获取所述目标设备的请求接口;构建模块,用于根据所述请求接口、数据网关及目标设备构建测试方案;执行模块,用于依次执行所述测试方案并调节线程延迟时间,以记录稳定临界值;报告模块,用于根据所述稳定临界值生成测试报告。Correspondingly, the present invention also provides a stability test system for the lighting IoT platform, including: a connection module, configured to establish a connection between the lighting IoT platform and the target device through a data gateway, so that the lighting IoT platform Unicom with the target device; an acquisition module, used to obtain the request interface of the target device through the lighting IoT platform; a construction module, used to construct a test plan according to the request interface, data gateway and target device; an execution module , for sequentially executing the test scheme and adjusting the thread delay time, so as to record a stable critical value; a reporting module, used for generating a test report according to the stable critical value.

作为上述方案的改进,所述构建模块包括:线程构建单元,用于根据所述请求接口及目标设备的执行方式,构建线程组;联接构建单元,用于根据所述数据网关与目标设备,构建联接方式;方案组合单元,用于对所述线程组及联接方式进行组合,以构建测试方案。As an improvement of the above solution, the construction module includes: a thread construction unit, configured to construct a thread group according to the execution mode of the request interface and the target device; a connection construction unit, configured to construct a thread group according to the data gateway and the target device A connection mode; a program combination unit, configured to combine the thread group and the connection mode to construct a test program.

作为上述方案的改进,所述执行模块包括:联接执行单元,用于按照当前测试方案的联接方式连接所述目标设备;延迟设置单元,用于修改线程延迟时间;线程执行单元,用于执行当前测试方案的线程组;处理单元,用于判断是否存在稳定临界值,判断为是时,记录稳定临界值并驱动联接执行单元执行下一测试方案,判断为否时,重新驱动联接执行单元。As an improvement of the above solution, the execution module includes: a connection execution unit, used to connect the target device according to the connection mode of the current test solution; a delay setting unit, used to modify the thread delay time; a thread execution unit, used to execute the current test program. The thread group of the test scheme; the processing unit is used to judge whether there is a stable critical value, and if it is judged to be yes, record the stable critical value and drive the connection execution unit to execute the next test scheme; if it is judged to be no, it will re-drive the connection execution unit.

相应地,本发明还提供了一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其中,所述处理器执行所述计算机程序时实现上述照明物联网平台稳定性测试方法的步骤。Correspondingly, the present invention also provides a computer device, including a memory and a processor, the memory stores a computer program, wherein, when the processor executes the computer program, the above method for testing the stability of the lighting Internet of Things platform is realized. step.

相应地,本发明还提供了一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时实现上述照明物联网平台稳定性测试方法的步骤。Correspondingly, the present invention also provides a computer-readable storage medium, on which a computer program is stored, wherein, when the computer program is executed by a processor, the steps of the above-mentioned method for testing the stability of the lighting Internet of Things platform are realized.

实施本发明,具有如下有益效果:Implement the present invention, have following beneficial effect:

本发明在原有的产品稳定性测试过程中引入性能自动化测试技术,并通过对设备响应时间进行持续调度,得出照明物联网平台在大多数情况的稳定性参数,从而量化照明物联网平台中所有与目标设备交互过程在不同环境下的稳定性情况,使“平台-设备”交互过程稳定性持续可控,提升设备实地部署效率。The present invention introduces performance automation testing technology into the original product stability testing process, and obtains the stability parameters of the lighting IoT platform in most cases by continuously scheduling the response time of the equipment, thereby quantifying all lighting IoT platform The stability of the interaction process with the target device in different environments makes the "platform-device" interaction process stable and controllable, and improves the efficiency of field deployment of equipment.

附图说明Description of drawings

图1是本发明照明物联网平台稳定性测试方法的实施例流程图;Fig. 1 is the flow chart of an embodiment of the method for testing the stability of the lighting Internet of Things platform of the present invention;

图2是本发明中网络交互协议关系示意图;Fig. 2 is a schematic diagram of the network interaction protocol relationship in the present invention;

图3是本发明中单一线程组的示意图;Fig. 3 is a schematic diagram of a single thread group in the present invention;

图4是本发明中独立线程组的示意图;Fig. 4 is the schematic diagram of independent thread group among the present invention;

图5是本发明中单一总线方式的示意图;Fig. 5 is a schematic diagram of a single bus mode in the present invention;

图6是本发明中独立总线方式的示意图;Fig. 6 is the schematic diagram of independent bus mode among the present invention;

图7是本发明中依次执行测试方案并调节线程延迟时间,以记录稳定临界值的实施例流程图;Fig. 7 is a flow chart of an embodiment of sequentially executing a test scheme and adjusting a thread delay time in the present invention to record a stable critical value;

图8是本发明照明物联网平台稳定性测试系统的结构示意图;Fig. 8 is a structural schematic diagram of the stability test system of the lighting Internet of Things platform of the present invention;

图9是本发明照明物联网平台稳定性测试系统中构建模块的结构示意图;Fig. 9 is a schematic structural diagram of the building blocks in the lighting Internet of Things platform stability testing system of the present invention;

图10是本发明照明物联网平台稳定性测试系统中执行模块的结构示意图。Fig. 10 is a schematic structural diagram of the execution module in the stability test system of the lighting Internet of Things platform of the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings.

参见图1,图1显示了本发明照明物联网平台稳定性测试方法的实施例流程图,其包括:Referring to Fig. 1, Fig. 1 shows the flow chart of an embodiment of the method for testing the stability of the lighting Internet of Things platform of the present invention, which includes:

S101,通过数据网关构建照明物联网平台与目标设备之间的连接,以使照明物联网平台与目标设备联通;S101, constructing a connection between the lighting IoT platform and the target device through the data gateway, so that the lighting IoT platform and the target device are connected;

优选地,目标设备可以为Da l i继电器,但不以此为限制。Preferably, the target device may be a Dali relay, but not limited thereto.

如图2所示,将所有目标设备连接至同一数据网关,并通过数据网关将目标设备通过局域网形式连接至已部署照明物联网平台的WEB服务器,从而确保照明物联网平台与目标设备联通。As shown in Figure 2, all target devices are connected to the same data gateway, and the target devices are connected to the WEB server of the deployed lighting IoT platform through the data gateway through the LAN, so as to ensure the communication between the lighting IoT platform and the target devices.

S102,通过照明物联网平台获取目标设备的请求接口;S102, obtaining the request interface of the target device through the lighting Internet of Things platform;

通过浏览器、Postman工具,从照明物联网平台的人机操作界面获取指令发送的请求接口;Obtain the request interface for command sending from the man-machine operation interface of the lighting IoT platform through browsers and Postman tools;

例如,请求接口为:[POST]/devi ce/contro l ForAddressEndpoi ntFor example, the request interface is: [POST]/device/control l ForAddressEndpoi nt

请求接口中的请求参数如下表1所示:The request parameters in the request interface are shown in Table 1 below:

表1Table 1

序号serial number 名称name 类型type 含义meaning 11 control_channelcontrol_channel IntInt 继电器开关通道(1/2/3/4)Relay switch channel (1/2/3/4) 22 control_typecontrol_type IntInt 设备类型(继电器开关为7)Device type (relay switch is 7) 33 device_dbindexdevice_dbindex StrStr 设备(继电器)标识Device (relay) identification 44 device_endpointdevice_endpoint IntInt 设备(继电器)标识相关Device (relay) identification related 55 device_leveldevice_level IntInt 操作命令(0-关闭/254-开启)Operation command (0-off/254-on) 88 device_nwkaddressdevice_nwkaddress IntInt 设备地图标识(256)Equipment map identification(256) 99 device_onoff1device_onoff1 IntInt 当前通道1状态(0/1)Current channel 1 status (0/1) 1010 device_onoff2device_onoff2 IntInt 当前通道2状态(0/1)Current channel 2 status (0/1) 1111 device_onoff3device_onoff3 IntInt 当前通道3状态(0/1)Current channel 3 status (0/1) 1212 device_onoff4device_onoff4 IntInt 当前通道4状态(0/1)Current channel 4 status (0/1)

S103,根据请求接口、数据网关及目标设备构建测试方案;S103, constructing a test plan according to the request interface, the data gateway and the target device;

需要说明的是,测试方案包括线程组及联接方式,具体地,根据请求接口、数据网关及目标设备构建测试方案的步骤包括:It should be noted that the test plan includes thread groups and connection methods. Specifically, the steps of constructing the test plan according to the request interface, data gateway and target device include:

(1)根据请求接口及目标设备的执行方式,构建线程组;(1) Construct a thread group according to the request interface and the execution mode of the target device;

线程组包括单一线程组及独立线程组;在单一线程组中,目标设备均置于同一线程组中并按照通道依次发送指令;在独立线程组中,一个目标设备对应一个线程组并按照通道依次发送指令。Thread groups include single thread groups and independent thread groups; in a single thread group, target devices are placed in the same thread group and send instructions sequentially according to the channel; in an independent thread group, a target device corresponds to a thread group and are sequentially sent according to the channel Send instructions.

如图3所示,在单一线程组中,设备Da l i-1-01、设备Da l i-2-01同时置于同一线程组,按照通道依次发送指令;As shown in Figure 3, in a single thread group, the device Da l i-1-01 and the device Da l i-2-01 are placed in the same thread group at the same time, and instructions are sent sequentially according to the channel;

如图4所示,在独立线程组中,设备Da l i-1-01、设备Da l i-2-01分别置于不同线程组,按照通道依次发送指令。As shown in Figure 4, in the independent thread group, the device Dali-1-01 and the device Dali-2-01 are respectively placed in different thread groups, and instructions are sent sequentially according to the channels.

(2)根据数据网关与目标设备,构建联接方式;(2) According to the data gateway and the target device, construct the connection mode;

联接方式包括单一总线方式及独立总线方式;在单一总线方式中,目标设备均通过同一总线并联至数据网关;在独立总线方式中,一个目标设备对应一条总线且每一目标设备均通过对应的总线连接至数据网关。The connection methods include single bus mode and independent bus mode; in the single bus mode, the target devices are connected to the data gateway in parallel through the same bus; in the independent bus mode, one target device corresponds to a bus and each target device passes through the corresponding bus Connect to the data gateway.

如图5所示,在单一总线方式中,使用单一总线1将Da l i继电器1及Da l i继电器2并联至数据网关;As shown in Figure 5, in the single bus mode, use a single bus 1 to connect Dali relay 1 and Dali relay 2 to the data gateway in parallel;

如图6所示,在独立总线方式中,数据网关使用总线1、总线2分别连接至Da l i继电器1、Da l i继电器2。As shown in Figure 6, in the independent bus mode, the data gateway uses bus 1 and bus 2 to connect to Dali relay 1 and Dali relay 2 respectively.

(3)对线程组及联接方式进行组合,以构建测试方案。(3) Combining thread groups and connection methods to build test solutions.

结合图3-图6所示,根据不同的线程组和联接方式可组合出以下四个测试方案:Combined with Figure 3-Figure 6, the following four test schemes can be combined according to different thread groups and connection methods:

方案A:单一线程组+单一总线方式Solution A: Single thread group + single bus mode

方案B:单一线程组+独立总线方式Option B: Single thread group + independent bus mode

方案C:独立线程组+单一总线方式Solution C: independent thread group + single bus mode

方案D:独立线程组+独立总线方式Solution D: independent thread group + independent bus mode

因此,通过对不同的线程组和联接方式的组合,可覆盖所有的测试情况,避免遗漏。Therefore, through the combination of different thread groups and connection methods, all test situations can be covered and omissions can be avoided.

S104,依次执行测试方案并调节线程延迟时间,以记录稳定临界值;S104, execute the test plan in sequence and adjust the thread delay time, so as to record the stable critical value;

需要说明的是,可在各个测试方案的事务控制器中单独添加固定定时器,并通过调节固定定时器的线程延迟时间,记录交互稳定的稳定临界值。It should be noted that a fixed timer can be added separately in the transaction controller of each test plan, and the stable critical value of interaction stability can be recorded by adjusting the thread delay time of the fixed timer.

具体地,依次执行所述测试方案并调节线程延迟时间,以记录稳定临界值的步骤包括:Specifically, the steps of sequentially executing the test scheme and adjusting the thread delay time to record a stable critical value include:

(1)按照当前测试方案的联接方式连接目标设备;(1) Connect the target device according to the connection method of the current test plan;

(2)修改线程延迟时间;(2) Modify the thread delay time;

一般情况下,可为每个线程组设置线程数为1,每次执行时间为1分钟,初始线程延迟时间为3000ms;In general, the number of threads can be set to 1 for each thread group, each execution time is 1 minute, and the initial thread delay time is 3000ms;

进一步,执行同一测试方案时,根据公式N=n/M修改线程延迟时间,其中,N为修改后的线程延迟时间,n为上一次正常执行的线程延迟时间,M为大于1的正整数;执行不同的测试方案时,线程延迟时间由初始值开始重新设置。Further, when executing the same test scheme, modify the thread delay time according to the formula N=n/M, wherein, N is the modified thread delay time, n is the thread delay time of the last normal execution, and M is a positive integer greater than 1; When executing different test scenarios, the thread delay time is reset from the initial value.

例如,当M取值为2时,执行同一测试方案时,采用折中取值法的方式实现线程延迟时间的修改,从而保证线程延迟时间在0-3000ms之间取值。For example, when the value of M is 2, when the same test plan is executed, the modification of the thread delay time is realized by adopting a compromise value method, so as to ensure that the thread delay time takes a value between 0-3000ms.

(3)执行当前测试方案的线程组;(3) Execute the thread group of the current test plan;

(4)判断是否存在稳定临界值,判断为是时,记录稳定临界值并执行下一测试方案,判断为否时,返回步骤S1。(4) Judging whether there is a stable critical value, if it is judged to be yes, record the stable critical value and execute the next test plan, if it is judged to be no, return to step S1.

进一步,判断是否存在稳定临界值的步骤包括:Further, the steps of judging whether there is a stable critical value include:

(4.1)判断目标设备是否无法正常执行逻辑跳动;(4.1) Determine whether the target device cannot perform logical jumping normally;

(4.2)判断为是时,则表示存在稳定临界值,并将上一次正常执行的线程延迟时间作为照明物联网平台与目标设备交互过程的稳定临界值;(4.2) When it is judged to be yes, it means that there is a stable critical value, and the thread delay time of the last normal execution is used as the stable critical value of the interaction process between the lighting IoT platform and the target device;

(4.3)判断为否时,则表示不存在稳定临界值。(4.3) When the judgment is no, it means that there is no stable critical value.

也就是说,当判断出不存在稳定临界值时,重复执行步骤(1)-步骤(4),直至执行至目标设备无法按照脚本执行逻辑跳动为止,记录上一次正常执行的线程延迟时间,并将其作为照明物联网平台与目标设备交互过程的稳定临界值。That is to say, when it is judged that there is no stable critical value, repeat steps (1)-step (4) until the target device cannot jump according to the script execution logic, record the thread delay time of the last normal execution, and Take it as a stable threshold for the interaction process between the lighting IoT platform and the target device.

S105,根据稳定临界值生成测试报告。S105. Generate a test report according to the stability threshold.

下面结合图7对S104做进一步的详细描述:S104 is further described in detail in conjunction with FIG. 7 below:

如图7所示的实施例中,根据不同的线程组和联接方式可组合出以下四个测试方案:In the embodiment shown in Figure 7, the following four test schemes can be combined according to different thread groups and connection modes:

方案A:单一线程组+单一总线方式Solution A: Single thread group + single bus mode

方案B:单一线程组+独立总线方式Option B: Single thread group + independent bus mode

方案C:独立线程组+单一总线方式Solution C: independent thread group + single bus mode

方案D:独立线程组+独立总线方式Solution D: independent thread group + independent bus mode

步骤一:按照单一总线方式连接设备,修改线程延迟时间,执行单一线程组;Step 1: Connect the device according to a single bus, modify the thread delay time, and execute a single thread group;

步骤二:判断是否存在稳定临界值,判断为是时,进入步骤三并输出方案A的稳定临界值,判断为否时,返回步骤一;Step 2: Determine whether there is a stable critical value, if it is judged to be yes, enter step 3 and output the stable critical value of scheme A, if judged to be no, return to step 1;

步骤三:按照单一总线方式连接设备,修改线程延迟时间,执行独立线程组;Step 3: Connect the device according to a single bus, modify the thread delay time, and execute an independent thread group;

步骤四:判断是否存在稳定临界值,判断为是时,进入步骤五并输出方案B的稳定临界值,判断为否时,返回步骤三;Step 4: Judging whether there is a stable critical value, if it is judged to be yes, enter step 5 and output the stable critical value of scheme B, if it is judged to be no, return to step 3;

步骤五:按照独立总线方式连接设备,修改线程延迟时间,执行单一线程组;Step 5: Connect the device according to the independent bus, modify the thread delay time, and execute a single thread group;

步骤六:判断是否存在稳定临界值,判断为是时,进入步骤七并输出方案C的稳定临界值,判断为否时,返回步骤五;Step 6: Determine whether there is a stable critical value, if it is judged to be yes, go to step 7 and output the stable critical value of scheme C, if it is judged to be no, return to step 5;

步骤七:按照独立总线方式连接设备,修改线程延迟时间,执行独立线程组;Step 7: Connect the device according to the independent bus, modify the thread delay time, and execute the independent thread group;

步骤八:判断是否存在稳定临界值,判断为是时,输出方案D的稳定临界值,判断为否时,返回步骤七。Step 8: Determine whether there is a stable critical value, if it is judged yes, output the stable critical value of scheme D, if judged no, return to step 7.

因此,本发明引入性能自动化测试技术,并通过对设备响应时间进行持续调度,得出照明物联网平台在大多数情况的稳定性参数,从而量化照明物联网平台中所有与目标设备交互过程在不同环境下的稳定性情况,使“平台-设备”交互过程稳定性持续可控,提升设备实地部署效率。Therefore, the present invention introduces performance automation testing technology, and through continuous scheduling of device response time, the stability parameters of the lighting IoT platform in most cases are obtained, thereby quantifying all interaction processes between the lighting IoT platform and the target device in different The stability of the environment makes the "platform-device" interaction process stable and controllable, and improves the efficiency of field deployment of devices.

参见图8,图8显示了本发明照明物联网平台稳定性测试系统100的具体结构,其包括连接模块1、获取模块2、构建模块3、执行模块4及报告模块5,具体地:Referring to Fig. 8, Fig. 8 shows the specific structure of the lighting Internet of Things platform stability test system 100 of the present invention, which includes a connection module 1, an acquisition module 2, a construction module 3, an execution module 4 and a report module 5, specifically:

连接模块1用于通过数据网关构建照明物联网平台与目标设备之间的连接,以使照明物联网平台与目标设备联通;优选地,目标设备可以为Da l i继电器,但不以此为限制。如图2所示,连接模块1可将所有目标设备连接至同一数据网关,并通过数据网关将目标设备通过局域网形式连接至已部署照明物联网平台的WEB服务器,从而确保照明物联网平台与目标设备联通。The connection module 1 is used to construct the connection between the lighting IoT platform and the target device through the data gateway, so that the lighting IoT platform can communicate with the target device; preferably, the target device can be a Dali relay, but not limited thereto. As shown in Figure 2, the connection module 1 can connect all target devices to the same data gateway, and through the data gateway, the target devices can be connected to the WEB server of the deployed lighting IoT platform through a local area network, thus ensuring that the lighting IoT platform is compatible with the target Device connectivity.

获取模块2用于通过照明物联网平台获取目标设备的请求接口;具体地,获取模块2通过浏览器、Postman工具,从照明物联网平台的人机操作界面获取指令发送的请求接口;优选地,请求接口中的请求参数包括:继电器开关通道、设备类型、设备标识、设备标识相关、操作命令、设备地图标识及当前通道状态等,但不以此为限制。The acquisition module 2 is used to obtain the request interface of the target device through the lighting Internet of Things platform; specifically, the acquisition module 2 obtains the request interface for instruction transmission from the man-machine operation interface of the lighting Internet of Things platform through a browser and a Postman tool; preferably, The request parameters in the request interface include: relay switch channel, device type, device ID, device ID correlation, operation command, device map ID, and current channel status, etc., but not limited to this.

构建模块3用于根据请求接口、数据网关及目标设备构建测试方案;其中,测试方案包括线程组及联接方式。The construction module 3 is used to construct a test plan according to the request interface, the data gateway and the target device; wherein, the test plan includes a thread group and a connection mode.

执行模块4用于依次执行测试方案并调节线程延迟时间,以记录稳定临界值;需要说明的是,可在各个测试方案的事务控制器中单独添加固定定时器,并通过调节固定定时器的线程延迟时间,记录交互稳定的稳定临界值。The execution module 4 is used to execute the test schemes in turn and adjust the thread delay time to record the stable critical value; it should be noted that a fixed timer can be added separately in the transaction controller of each test scheme, and by adjusting the thread Delay time, the stability threshold at which the recording interaction is stable.

报告模块5用于根据稳定临界值生成测试报告。The report module 5 is used to generate a test report according to the stable critical value.

如图9所示,构建模块3包括线程构建单元31、联接构建单元32及方案组合单元33,其中:As shown in Figure 9, the construction module 3 includes a thread construction unit 31, a connection construction unit 32 and a scheme combination unit 33, wherein:

线程构建单元31用于根据请求接口及目标设备的执行方式,构建线程组;The thread construction unit 31 is used to construct a thread group according to the execution mode of the request interface and the target device;

联接构建单元32用于根据数据网关与目标设备,构建联接方式;The connection construction unit 32 is used to construct a connection method according to the data gateway and the target device;

方案组合单元33用于对线程组及联接方式进行组合,以构建测试方案。The scheme combination unit 33 is used to combine thread groups and connection modes to construct test schemes.

线程组包括单一线程组及独立线程组;在单一线程组中,目标设备均置于同一线程组中并按照通道依次发送指令;在独立线程组中,一个目标设备对应一个线程组并按照通道依次发送指令。如图3所示,在单一线程组中,设备Da l i-1-01、设备Da l i-2-01同时置于同一线程组,按照通道依次发送指令;如图4所示,在独立线程组中,设备Da l i-1-01、设备Da l i-2-01分别置于不同线程组,按照通道依次发送指令。Thread groups include single thread groups and independent thread groups; in a single thread group, target devices are placed in the same thread group and send instructions sequentially according to the channel; in an independent thread group, a target device corresponds to a thread group and are sequentially sent according to the channel Send instructions. As shown in Figure 3, in a single thread group, the device Da l i-1-01 and the device Da l i-2-01 are placed in the same thread group at the same time, and the instructions are sent sequentially according to the channel; as shown in Figure 4, in the independent In the thread group, the device Da l i-1-01 and the device Da l i-2-01 are respectively placed in different thread groups, and instructions are sent sequentially according to the channels.

联接方式包括单一总线方式及独立总线方式;在单一总线方式中,目标设备均通过同一总线并联至数据网关;在独立总线方式中,一个目标设备对应一条总线且每一目标设备均通过对应的总线连接至数据网关。如图5所示,在单一总线方式中,使用单一总线1将Da l i继电器1及Da l i继电器2并联至数据网关;如图6所示,在独立总线方式中,数据网关使用总线1、总线2分别连接至Da l i继电器1、Da l i继电器2。The connection methods include single bus mode and independent bus mode; in the single bus mode, the target devices are connected to the data gateway in parallel through the same bus; in the independent bus mode, a target device corresponds to a bus and each target device passes through the corresponding bus Connect to the data gateway. As shown in Figure 5, in the single bus mode, use a single bus 1 to connect Dali relay 1 and Dali relay 2 to the data gateway in parallel; as shown in Figure 6, in the independent bus mode, the data gateway uses bus 1, bus 2 are connected to Dali relay 1 and Dali relay 2 respectively.

结合图3-图6所示,根据不同的线程组和联接方式可组合出以下四个测试方案:方案A:单一线程组+单一总线方式;方案B:单一线程组+独立总线方式;方案C:独立线程组+单一总线方式;方案D:独立线程组+独立总线方式。Combined with Figure 3-Figure 6, the following four test schemes can be combined according to different thread groups and connection methods: Scheme A: single thread group + single bus mode; scheme B: single thread group + independent bus mode; scheme C : Independent thread group + single bus mode; Scheme D: Independent thread group + independent bus mode.

如图10所示,执行模块4包括联接执行单元41、延迟设置单元42、线程执行单元43及处理单元44,具体他:As shown in Figure 10, the execution module 4 includes a connection execution unit 41, a delay setting unit 42, a thread execution unit 43 and a processing unit 44, specifically he:

联接执行单元41用于按照当前测试方案的联接方式连接目标设备;The connection execution unit 41 is used to connect the target device according to the connection mode of the current test scheme;

延迟设置单元42用于修改线程延迟时间;一般情况下,可为每个线程组设置线程数为1,每次执行时间为1分钟,初始线程延迟时间为3000ms。The delay setting unit 42 is used to modify the thread delay time; generally, the number of threads can be set to 1 for each thread group, each execution time is 1 minute, and the initial thread delay time is 3000ms.

线程执行单元43用于执行当前测试方案的线程组;The thread execution unit 43 is used to execute the thread group of the current test scheme;

处理单元44用于判断是否存在稳定临界值,判断为是时,记录稳定临界值并驱动联接执行单元执行下一测试方案,判断为否时,重新驱动联接执行单元。The processing unit 44 is used to judge whether there is a stable critical value. If it is judged to be yes, it will record the stable critical value and drive the connection execution unit to execute the next test scheme. If it is judged to be no, it will re-drive the connection execution unit.

进一步,执行同一测试方案时,根据公式N=n/M修改线程延迟时间,其中,N为修改后的线程延迟时间,n为上一次正常执行的线程延迟时间,M为大于1的正整数;执行不同的测试方案时,线程延迟时间由初始值开始重新设置。例如,当M取值为2时,执行同一测试方案时,采用折中取值法的方式实现线程延迟时间的修改,从而保证线程延迟时间在0-3000ms之间取值。Further, when executing the same test scheme, modify the thread delay time according to the formula N=n/M, wherein, N is the modified thread delay time, n is the thread delay time of the last normal execution, and M is a positive integer greater than 1; When executing different test scenarios, the thread delay time is reset from the initial value. For example, when the value of M is 2, when the same test plan is executed, the modification of the thread delay time is realized by adopting a compromise value method, so as to ensure that the thread delay time takes a value between 0-3000ms.

更佳地,处理单元44判断是否存在稳定临界值的步骤包括:判断目标设备是否无法正常执行逻辑跳动;判断为是时,则表示存在稳定临界值,并将上一次正常执行的线程延迟时间作为照明物联网平台与目标设备交互过程的稳定临界值;判断为否时,则表示不存在稳定临界值。也就是说,当判断出不存在稳定临界值时,重复启动联接执行单元41、延迟设置单元42及线程执行单元43,直至执行至目标设备无法按照脚本执行逻辑跳动为止,记录上一次正常执行的线程延迟时间,并将其作为照明物联网平台与目标设备交互过程的稳定临界值。Preferably, the step of processing unit 44 judging whether there is a stable critical value includes: judging whether the target device cannot normally perform logical jumping; The stable critical value of the interaction process between the lighting IoT platform and the target device; if the judgment is no, it means that there is no stable critical value. That is to say, when it is judged that there is no stable critical value, the connection execution unit 41, the delay setting unit 42 and the thread execution unit 43 are repeatedly started until the target device cannot jump according to the script execution logic, and the last normal execution is recorded. The thread delay time is used as the stable critical value of the interaction process between the lighting IoT platform and the target device.

相应地,本发明还公开了一种计算机设备,包括存储器和处理器,存储器存储有计算机程序,其中,处理器执行计算机程序时实现上述照明物联网平台稳定性测试方法的步骤。同时,本发明还公开了一种计算机可读存储介质,其上存储有计算机程序,其中,计算机程序被处理器执行时实现上述照明物联网平台稳定性测试方法的步骤。Correspondingly, the present invention also discloses a computer device, including a memory and a processor, and the memory stores a computer program, wherein, when the processor executes the computer program, the steps of the above method for testing the stability of the lighting Internet of Things platform are realized. At the same time, the present invention also discloses a computer-readable storage medium, on which a computer program is stored, wherein, when the computer program is executed by a processor, the steps of the above method for testing the stability of the lighting Internet of Things platform are realized.

由上可知,本发明引入性能自动化测试技术,并通过对设备响应时间进行持续调度,得出照明物联网平台在大多数情况的稳定性参数,从而量化照明物联网平台中所有与目标设备交互过程在不同环境下的稳定性情况,使“平台-设备”交互过程稳定性持续可控,提升设备实地部署效率。It can be seen from the above that the present invention introduces performance automation testing technology, and through continuous scheduling of equipment response time, the stability parameters of the lighting IoT platform in most cases are obtained, thereby quantifying all interaction processes with the target equipment in the lighting IoT platform The stability in different environments makes the "platform-device" interaction process stable and controllable, and improves the efficiency of field deployment of devices.

以上所述是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也视为本发明的保护范围。The above description is a preferred embodiment of the present invention, and it should be pointed out that for those skilled in the art, without departing from the principle of the present invention, some improvements and modifications can also be made, and these improvements and modifications are also considered Be the protection scope of the present invention.

Claims (12)

1. A method for testing stability of an illumination Internet of things platform is characterized by comprising the following steps:
establishing connection between an illumination Internet of things platform and target equipment through a data gateway so as to enable the illumination Internet of things platform to be communicated with the target equipment;
acquiring a request interface of the target equipment through the lighting Internet of things platform;
constructing a test scheme according to the request interface, the data gateway and the target equipment;
sequentially executing the test scheme and adjusting thread delay time to record a stable critical value;
and generating a test report according to the stable critical value.
2. The lighting internet of things platform stability testing method of claim 1, wherein the step of constructing a testing scheme according to the request interface, the data gateway and the target device comprises:
constructing a thread group according to the request interface and the execution mode of the target equipment;
constructing a connection mode according to the data gateway and the target equipment;
and combining the thread groups and the connection modes to construct a test scheme.
3. The lighting internet of things platform stability testing method of claim 2, wherein the thread group comprises a single thread group and an independent thread group;
in the single thread group, the target devices are all arranged in the same thread group and send instructions in sequence according to channels;
in the independent thread groups, one target device corresponds to one thread group and sequentially sends instructions according to channels.
4. The lighting internet of things platform stability testing method of claim 2, wherein the connection mode comprises a single bus mode and an independent bus mode;
in the single bus mode, the target devices are connected in parallel to the data gateway through the same bus;
in the independent bus mode, one target device corresponds to one bus and each target device is connected to the data gateway through the corresponding bus.
5. The lighting internet of things platform stability testing method of claim 2, wherein the step of sequentially executing the test scheme and adjusting thread delay time to record a stability threshold comprises:
s1, connecting the target equipment according to the connection mode of the current test scheme;
s2, modifying thread delay time;
s3, executing the thread group of the current test scheme;
and S4, judging whether a stable critical value exists or not, recording the stable critical value and executing the next test scheme if the stable critical value exists, and returning to the step S1 if the stable critical value does not exist.
6. The lighting internet of things platform stability testing method of claim 5, wherein the step of determining whether a stability threshold exists comprises:
judging whether the target equipment can not normally execute logic jumping or not;
if so, indicating that a stable critical value exists, and taking the thread delay time of the last normal execution as the stable critical value of the interaction process of the lighting Internet of things platform and the target equipment;
and if not, indicating that no stable critical value exists.
7. The lighting internet of things platform stability testing method according to claim 5, wherein when the same testing scheme is executed, the thread delay time is modified according to a formula N = N/M, where N is the modified thread delay time, N is the thread delay time of the last normal execution, and M is a positive integer greater than 1.
8. The utility model provides a lighting thing networking platform stability test system which characterized in that includes:
the connection module is used for establishing connection between the lighting Internet of things platform and target equipment through a data gateway so as to enable the lighting Internet of things platform to be communicated with the target equipment;
the acquisition module is used for acquiring a request interface of the target equipment through the lighting Internet of things platform;
the construction module is used for constructing a test scheme according to the request interface, the data gateway and the target equipment;
the execution module is used for sequentially executing the test scheme and adjusting thread delay time so as to record a stable critical value;
and the report module is used for generating a test report according to the stable critical value.
9. The lighting internet of things platform stability testing system of claim 8, wherein the building module comprises:
the thread constructing unit is used for constructing a thread group according to the request interface and the execution mode of the target equipment;
the connection construction unit is used for constructing a connection mode according to the data gateway and the target equipment;
and the scheme combination unit is used for combining the thread groups and the connection modes to construct a test scheme.
10. The lighting internet of things platform stability testing system of claim 8, wherein the execution module comprises:
the connection execution unit is used for connecting the target equipment according to the connection mode of the current test scheme;
the delay setting unit is used for modifying the thread delay time;
the thread execution unit is used for executing the thread group of the current test scheme;
and the processing unit is used for judging whether the stable critical value exists or not, recording the stable critical value and driving the connection execution unit to execute the next test scheme if the stable critical value exists, and re-driving the connection execution unit if the stable critical value does not exist.
11. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
12. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202211439423.4A 2022-11-17 2022-11-17 Stability testing method, system, equipment and storage medium of lighting IoT platform Pending CN115865725A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211439423.4A CN115865725A (en) 2022-11-17 2022-11-17 Stability testing method, system, equipment and storage medium of lighting IoT platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211439423.4A CN115865725A (en) 2022-11-17 2022-11-17 Stability testing method, system, equipment and storage medium of lighting IoT platform

Publications (1)

Publication Number Publication Date
CN115865725A true CN115865725A (en) 2023-03-28

Family

ID=85663898

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211439423.4A Pending CN115865725A (en) 2022-11-17 2022-11-17 Stability testing method, system, equipment and storage medium of lighting IoT platform

Country Status (1)

Country Link
CN (1) CN115865725A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160188441A1 (en) * 2013-08-28 2016-06-30 Bo Chen Testing multi-threaded applications
CN111597019A (en) * 2020-04-22 2020-08-28 深圳中兴网信科技有限公司 Call request processing method, device, terminal and computer readable storage medium
CN112749020A (en) * 2020-12-31 2021-05-04 普华基础软件股份有限公司 Microkernel optimization method of Internet of things operating system
CN114880240A (en) * 2022-05-31 2022-08-09 成都秦川物联网科技股份有限公司 Automatic testing system and method for Internet of things equipment, storage medium and equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160188441A1 (en) * 2013-08-28 2016-06-30 Bo Chen Testing multi-threaded applications
CN111597019A (en) * 2020-04-22 2020-08-28 深圳中兴网信科技有限公司 Call request processing method, device, terminal and computer readable storage medium
CN112749020A (en) * 2020-12-31 2021-05-04 普华基础软件股份有限公司 Microkernel optimization method of Internet of things operating system
CN114880240A (en) * 2022-05-31 2022-08-09 成都秦川物联网科技股份有限公司 Automatic testing system and method for Internet of things equipment, storage medium and equipment

Similar Documents

Publication Publication Date Title
CN107197475A (en) A multithread-based sensor node identifier resolution test method and system
CN111104272A (en) CAN bus controller testing method based on RX and TX
CN109597733B (en) Multifunctional efficient dynamic chip verification simulation method and equipment
CN114124767A (en) Automatic testing method and device for gateway network management strategy
CN110519374A (en) The edge calculations method and its fringe node of ZigBee-network chemical industry control system
Ekaireb et al. ns3-fl: Simulating Federated Learning with ns-3
CN111581043A (en) Monitoring method, device and server for server power consumption
CN113518012B (en) Distributed cooperative flow simulation environment construction method and system
CN108199940B (en) A verification method and system for a robot joint communication system model
CN115865725A (en) Stability testing method, system, equipment and storage medium of lighting IoT platform
CN111861012A (en) A test task execution time prediction method and optimal execution node selection method
CN114019921B (en) Production line equipment control method, device, equipment and medium based on combined model
CN109597389A (en) A kind of test macro of embedded control system
Seno et al. A simulation approach to a Real-Time Ethernet protocol: EtherCAT
CN102736019A (en) Flexibility detection system and method of circuit board
CN110908296A (en) A method and system for automatic testing of a virtual power plant control system
CN118732658A (en) Functional testing system, method and device for vehicle domain controller
CN118534879A (en) Test method, electronic device and storage medium
CN105930285A (en) 485 bus based driving device monitoring method and system
CN113204332B (en) Smart home device control program generation system and method
CN116346765A (en) A virtual machine IP allocation method, system, device and storage medium
CN113872820B (en) Internet of things service simulation method, system and related equipment
CN103380609A (en) Communication device
CN114691493A (en) A lithium battery testing method and system
CN116523057A (en) Quantum control system and quantum computer 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20230328