A power protection device HMI automation closed-loop test method and system
Patent Information
- Application Number
- CN202611073499.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-20
- Publication Date
- 2026-10-30
AI Technical Summary
[0008]本发明的目的在于克服现有技术中测试过程独立于开发流程、缺乏闭环机制、测试用例生成方式受限等问题,提供一种电力保护装置HMI自动化闭环测试方法及系统,实现了测试过程与开发迭代的直接联动,减少人工介入,提高缺陷修复效率,测试过程不依赖外部识别页面或事件注入,避免了识别误差,提升了页面状态获取的准确性和实时性,实现了测试用例的自组织和自由组合,增强了测试的适应性和扩展性,在测试效率和覆盖率上均有提升
[0056]1、通过在测试服务器中配置虚拟Git号,将测试结果和缺陷信息自动生成工单并上传至Git服务器,实现闭环测试流程,确保测试结果直接嵌入开发迭代过程,解决了现有技术的测试过程通常停留在脚本回放或控件操作层面,测试结果仅供人工分析,缺乏与版本管理系统的自动联动,测试结果无法形成闭环的问题;
Smart Images

Figure CN123011691A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of testing technology for secondary equipment in power systems, and particularly to an automated closed-loop testing method and system for power protection device HMI. Background Technology
[0002] The human-machine interface (HMI) program of power protection devices plays a crucial role in power system operation, performing key functions such as status display, parameter configuration, and log recording. Its reliability directly affects the safety of the power system. With increasing functional complexity, traditional manual testing methods are inefficient and lack sufficient coverage, failing to meet the power system's demands for high reliability and rapid iteration. Therefore, automated testing methods have gradually become a focus of research and application. Existing technologies mainly include coordinate recording and script playback methods, virtual device touch testing methods, control operation coverage methods, and coverage measurement and test case generation methods.
[0003] The coordinate recording and script playback class records user behavior based on coordinates, converts it into a virtual keyboard script, and replays it for execution to achieve regression testing. This method reduces the cost of script maintenance, but the testing process is independent of the development process and lacks closed-loop linkage with the version management system. The test results cannot directly drive defect fixing.
[0004] The virtual device touch test class achieves high-precision touch interface testing by creating virtual devices, encapsulating coordinate event data packets, and injecting them into the kernel. This method ensures the reproducibility of the test, but it is mainly for general touch devices. The test process relies on external event injection and cannot directly obtain the internal page state of the HMI program, thus limiting its efficiency and accuracy.
[0005] Control operation coverage classes achieve test coverage by executing the operations supported by each control one by one, avoiding omissions. This method improves test comprehensiveness, but the generation of test cases depends on a fixed set of controls and lacks the ability to flexibly combine them according to page elements, making it difficult to adapt to the complex menu tree structure of power protection device HMI programs.
[0006] Coverage measurement and test case generation classes generate scripts by recording manual operations and calculate coverage by combining code call relationship graphs. This method improves the return on investment of testing, but the testing process still remains at the level of external operation and fails to be embedded in the development process, lacking automatic feedback and work order generation mechanisms.
[0007] In summary, existing technologies have the following shortcomings: test results cannot be automatically fed back to the version management system, and there is a lack of automated processes for work order generation and iterative repair; the testing process is independent of program execution and relies on external identification of pages or controls, resulting in insufficient efficiency and accuracy; existing methods mostly rely on fixed scripts or control sets and lack the ability to self-organize and freely combine test cases based on page elements. Summary of the Invention
[0008] The purpose of this invention is to overcome the problems in existing technologies, such as the testing process being independent of the development process, lack of a closed-loop mechanism, and limited test case generation methods. It provides an automated closed-loop testing method and system for power protection device HMIs, achieving direct linkage between the testing process and development iterations, reducing manual intervention, improving defect repair efficiency, and avoiding identification errors by not relying on external identification pages or event injection. This improves the accuracy and real-time performance of page status acquisition, enables self-organization and free combination of test cases, enhances the adaptability and scalability of testing, and improves both testing efficiency and coverage.
[0009] To solve the above-mentioned technical problems, the present invention is implemented using the following technical solution:
[0010] In a first aspect, the present invention provides an automated closed-loop testing system for HMI of power protection devices, including the HMI device under test, a test server, a power tester, and a Git server;
[0011] The HMI device under test stores an HMI program; the HMI program is used to parse the built-in menu.json file in Debug mode to generate a menu tree and automatically create a test sub-thread; the test sub-thread acts as a UDP client, used to forward the operation instructions issued by the test server when performing the test to the UI display layer of the HMI program for execution, and to feed back the page status after execution and the test data generated based on the analog signal output by the power tester to the test server;
[0012] The test server, acting as a UDP server, is used to switch test modes based on development stage information provided by the Git server; request menu tree information from the test sub-thread to generate test cases; execute tests according to the test cases; generate test results based on the page status and test data fed back by the test sub-thread; generate a work order based on the test results and upload it to the Git server.
[0013] The power tester is used to output analog signals to the HMI device under test according to the output setting parameters issued by the test server when performing the test.
[0014] The Git server is used to provide the test server with information on the current development stage of the HMI program, and to form development tasks based on the work orders uploaded by the test server, thereby achieving closed-loop iteration.
[0015] Optionally, performing tests according to the test cases includes:
[0016] The test server generates test key-value instructions based on the test cases and sends them to the test sub-threads in sequence. The page status returned by the test sub-threads is compared with the expected page to verify the page positioning.
[0017] If the current test page is a viewing page, the test server generates a random number as an output setting parameter and sends it to the power tester. The test data fed back by the test sub-thread is compared with the random number to verify whether the display is within the error range.
[0018] If the current test page is a settings page, the test server requests the initial value / setup value of the current test page from the test sub-thread, generates a preset random number based on the initial value / setup value returned by the test sub-thread, generates a corresponding key-value sequence based on the difference between the preset random number and the initial value / setup value, and sends modification key-value operation commands to the test sub-thread in sequence, instructing the test sub-thread to modify the initial value / setup value to the preset random number; sends a confirmation key-value operation command to the test sub-thread for saving; and compares the test data returned by the test sub-thread with the preset random number to verify whether the display is consistent.
[0019] Optionally, the HMI program may further include a communication management layer, a LOOP layer, and a data management layer;
[0020] The communication management layer is used to establish a UDP communication connection with the test server;
[0021] The LOOP layer is used to interact with external hardware, including forwarding operation instructions from external buttons / touch drivers to the UI display layer, forwarding the buffer array that the UI display layer needs to display to the LCD screen, and forwarding data from the data management layer to the UI display layer.
[0022] The data management layer is used to store and manage the data in the HMI program.
[0023] Optionally, the test server includes an instruction generation module, a UDP server module, a test result generation module, a data generation module, a Git module, and an SSH communication module;
[0024] The UDP server module is used to establish a UDP communication connection with the test sub-thread.
[0025] The instruction generation module is used to generate test cases based on the menu tree information and the current test mode, and to generate operation instruction sequences based on the test cases;
[0026] The data generation module is used to generate random numbers / preset random numbers for use in executing tests;
[0027] The test result generation module is used to generate test results based on the comparison results;
[0028] The Git module is used to request the current development stage information of the HMI program from the Git server, receive the development stage information returned by the Git server, and upload the work order to the Git server.
[0029] The SSH communication module is used to establish an SSH connection with the power tester.
[0030] Optionally, the test modes include robustness test mode, new feature test mode, and vulnerability repair test mode;
[0031] In robustness test mode, the interval between operation commands is shortened to 100ms, and all key values are randomly combined for stress testing until the HMI program generates a core dump file. Whether the program crashes is used as the basis for passing the test.
[0032] In the new feature testing mode, new pages or elements are located and new feature verification test cases are generated based on version difference information.
[0033] In vulnerability remediation testing mode, regression test cases are generated by locating the patched page elements based on the remediation records.
[0034] Optionally, the menu tree information includes menu structure, page type, page ID, page elements, and data index;
[0035] The page types include view types and settings types;
[0036] When the page type is viewable, the test case includes a combination of arrow key values and page jump keys;
[0037] When the page type is settings, the test case includes a combination of arrow key values, page jump keys, modification key values, and confirmation keys; wherein, the modification key value is used to modify the initial value / set value of the current page, and the confirmation key value is used to perform a save operation after the modification key value is issued.
[0038] Optionally, the output setting parameters include at least one of voltage setting value, current setting value, or switching state.
[0039] Optionally, the test server uploads the work order to the Git server using a virtual Git account.
[0040] Secondly, the present invention provides an automated closed-loop testing method for an HMI (Hybrid Management Interface) of a power protection device, applied to the automated closed-loop testing system for an HMI of a power protection device as described in any of the first aspects, wherein the execution entity is a test server, comprising:
[0041] Switch test modes based on the development stage information provided by the Git server;
[0042] Request menu tree information from the test sub-thread, and generate test cases based on the received menu tree information;
[0043] Execute tests based on test cases, including:
[0044] Test key-value instructions are generated based on test cases and sent to the test sub-threads in sequence. The page status returned by the test sub-threads is compared with the expected page to verify the page positioning.
[0045] If the current test page is a viewing page, a random number is generated as an output setting parameter and sent to the power tester. The test data fed back by the test sub-thread is compared with the random number to verify whether the display is within the error range.
[0046] If the current test page is a settings page, request the initial value / setup value of the current test page from the test sub-thread. Generate a preset random number based on the initial value / setup value returned by the test sub-thread. Generate a corresponding key-value sequence based on the difference between the preset random number and the initial value / setup value, and issue modification key-value operation commands to the test sub-thread in sequence, instructing the test sub-thread to modify the initial value / setup value to the preset random number. Issue a confirmation key-value operation command to the test sub-thread for saving. Compare the test data returned by the test sub-thread with the preset random number to verify whether the display is consistent.
[0047] Test results are generated based on the comparison results, and work order information is generated based on the test results;
[0048] The work order information is uploaded to the Git server.
[0049] Thirdly, the present invention provides an automated closed-loop testing method for an HMI (Hybrid Management Interface) of a power protection device, applied to the automated closed-loop testing system for an HMI of a power protection device as described in any of the first aspects, wherein the executing entity is the HMI device under test storing an HMI program, comprising:
[0050] In Debug mode, the built-in menu.json file of the HMI program is parsed to generate a menu tree and test sub-threads are automatically created;
[0051] Initiate a UDP communication connection request to the test server and establish a UDP communication connection with the test server;
[0052] Receive a menu tree information request sent by the test server, and return the menu tree information to the test server according to the request;
[0053] Receive the operation instructions issued by the test server when performing the test, forward the operation instructions to the UI display layer of the HMI program for execution, and feed back the current page status after execution to the test server;
[0054] The test data generated based on the analog signal output by the power tester is fed back to the test server.
[0055] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:
[0056] 1. By configuring virtual Git accounts in the test server, test results and defect information are automatically generated into work orders and uploaded to the Git server, realizing a closed-loop testing process. This ensures that test results are directly embedded in the development iteration process, solving the problem that the testing process of existing technologies usually stays at the level of script playback or control operation, and the test results are only available for manual analysis. There is a lack of automatic linkage with the version management system, and the test results cannot form a closed loop.
[0057] 2. Automatically create test sub-threads in the debug mode of the HMI program. These threads directly receive operation commands from the test server and provide feedback on the current page status and data. This is equivalent to establishing a test channel within the program, avoiding the uncertainty of external identification, improving the real-time performance and accuracy of the testing process, and solving the problem that existing technologies do not embed HMI program execution, rely on external page identification or event injection, and cannot directly obtain the internal state of the HMI program, resulting in insufficient efficiency and accuracy.
[0058] 3. By using the menu.json file of the HMI program, information such as the menu tree, page type, and page elements is parsed, and test cases are automatically generated based on the different attributes of the page elements. It supports three modes: robustness testing, new feature testing, and vulnerability repair testing. This enables test cases to be self-organized and freely combined according to page elements, improving test coverage and adaptability. It solves the problem that existing technologies often rely on fixed scripts or control sets, lack flexible combination capabilities, and have limited test case generation methods. Attached Figure Description
[0059] Figure 1 This is a schematic diagram of the structure of the HMI automated closed-loop test system for power protection devices provided in an embodiment of the present invention;
[0060] Figure 2 This is a schematic diagram of the HMI program structure provided in an embodiment of the present invention;
[0061] Figure 3 This is a schematic diagram of the menu.json page structure provided in an embodiment of the present invention;
[0062] Figure 4This is a schematic diagram of the test server program structure provided in an embodiment of the present invention;
[0063] Figure 5 Example diagram of message format provided in embodiments of the present invention;
[0064] Figure 6 This is a schematic diagram of the test process provided in an embodiment of the present invention. Detailed Implementation
[0065] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments and specific features in the embodiments are detailed descriptions of the technical solution of the present application, rather than limitations thereof. In the absence of conflict, the embodiments and technical features in the embodiments can be combined with each other.
[0066] It should be noted that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0067] Example 1
[0068] This invention discloses an automated closed-loop testing method for HMI (Hybrid Management Interface) of power protection devices, with reference to... Figure 1 As shown, it specifically includes the HMI device under test, the test server, the power tester, and the Git server.
[0069] The HMI device under test stores a reference. Figure 2 The HMI (Human Machine Interface) program shown is further divided into a communication management layer, a loop layer, and a data management layer. The communication management layer is used to establish a UDP communication connection with the test server. The loop layer is used to interact with external hardware, including forwarding operation commands from external buttons / touch drivers to the UI display layer, forwarding the buffer array that the UI display layer needs to display to the LCD screen, and forwarding data from the data management layer to the UI display layer. The data management layer is used to store and manage the data in the HMI program.
[0070] In Debug mode, the HMI program parses the built-in menu.json file to generate a menu tree and automatically creates test sub-threads. The page structure of the menu.json file is shown in the reference below. Figure 3As shown; including page name, page ID, page type, page elements, and data index; the page type includes view class and setting class; the page elements include tables, curves, and text; the data index includes voltage / current and switch quantity.
[0071] The test sub-thread, acting as a UDP client, forwards the operation commands issued by the test server during testing to the UI display layer of the HMI program for execution. Based on the request data packets sent by the test server, it also feeds back the page status after execution and the test data generated from the analog signals output by the power tester to the test server. The packet format is referenced below. Figure 5 As shown, it includes the message header, message type, message length, and data.
[0072] The test server, acting as a UDP server, establishes a UDP connection with the HMI device under test, and its structure is as follows: Figure 4 As shown, it includes an instruction generation module, a UDP server module, a test result generation module, a data generation module, a Git module, and an SSH communication module. The UDP server module is used to establish a UDP communication connection with the test sub-thread. The instruction generation module is used to generate test cases based on menu tree information and the current test mode, and generate operation instruction sequences based on the test cases. The data generation module is used to generate random numbers / preset random numbers for test execution. The test result generation module is used to generate test results based on comparison results. The Git module is used to request the current HMI program's development stage information from the Git server, receive the development stage information returned by the Git server, and upload work orders to the Git server. The SSH communication module is used to establish an SSH connection with the power tester.
[0073] The test server switches test modes based on the development stage information provided by the Git server. Test modes include robustness testing, new feature testing, and vulnerability patching testing. In robustness testing mode, the interval between operation commands is shortened to 100ms, and all key-value pairs are randomly combined for stress testing until the HMI program generates a core dump file. Whether the program crashes is used as the criterion for passing the test. In new feature testing mode, new pages or elements are located based on version difference information to generate functional verification test cases. In vulnerability patching testing mode, patched page elements are located based on patching records to generate regression test cases.
[0074] After obtaining the menu tree information, test cases are generated for each page. The menu tree information includes the menu structure, page type, page ID, page elements, and data index. The page type includes view and settings types. When the page type is view, the test case includes a combination of arrow key values and page jump keys. When the page type is settings, the test case includes a combination of arrow key values, page jump keys, edit key values, and confirmation keys. The edit key value is used to modify the initial / set value of the current page, and the confirmation key value is used to perform a save operation after the edit key value is issued.
[0075] The test server executes tests based on the test cases, including:
[0076] The test server generates test key-value instructions based on the test cases and sends them to the test sub-threads in sequence. The page status returned by the test sub-threads is compared with the expected page to verify the page positioning.
[0077] If the current test page is a viewing page, the test server generates a random number as an output setting parameter and sends it to the power tester. The test data fed back by the test sub-thread is compared with the random number to verify whether the display is within the error range. The output setting parameter includes at least one of voltage setting value, current setting value, or switch status.
[0078] If the current test page is a settings page, the test server requests the initial value / setup value of the current test page from the test sub-thread, generates a preset random number based on the initial value / setup value returned by the test sub-thread, generates a corresponding key-value sequence based on the difference between the preset random number and the initial value / setup value, and sequentially sends key-value modification operation commands to the test sub-thread, instructing the test sub-thread to modify the initial value / setup value to the preset random number; sends a confirmation key-value operation command to the test sub-thread for saving; and compares the test data returned by the test sub-thread with the preset random number to verify whether the display is consistent.
[0079] Test results are generated based on the comparison results, and a work order is generated based on the test results and uploaded to the Git server through a virtual Git account.
[0080] The power tester is used to output analog signals to the HMI device under test according to the output setting parameters issued by the test server when performing the test.
[0081] The Git server provides the test server with information on the current development stage of the HMI program, and forms development tasks based on the work orders uploaded by the test server to achieve closed-loop iteration.
[0082] refer to Figure 6As shown, the system testing based on this embodiment includes an initialization phase, an information collection phase, a test case generation phase, an execution and feedback phase, and a closed-loop feedback phase.
[0083] During the initialization phase, in Debug mode, after parsing the menu.json file built into the HMI program to generate a menu tree, a test sub-thread UDP client is automatically created, which establishes a UDP communication connection with the subsequent test server and waits to receive test information uploaded by the UDP server.
[0084] During the information collection phase, the test server requests menu tree information from the client. The menu tree structure is as follows: Figure 3 As shown, it includes menu structure, page type, page ID, page elements, and data index.
[0085] During the test case generation phase, the test server requests the current development stage of the HMI program from the Git server to switch between different test modes. In robustness test mode, all pages are traversed, the command interval is shortened to 100ms, and all key-value pairs are randomly combined for stress testing until the HMI program generates a core dump file. The test stops only when the program crashes. Whether the program crashes or not is used as the criterion for whether the test passes. In new feature test mode, test cases are generated for newly added pages or elements to verify the functionality. In vulnerability patching test mode, regression test cases are generated for patched page elements.
[0086] During the execution and feedback phase, the test server issues test key-value instructions based on the menu structure. The HMI program's test sub-thread locates the required page, defines the range of the key-value pool based on page attributes, organizes corresponding test cases, and issues them sequentially. The test sub-thread executes the instructions and provides feedback on the current page status and data. If the current page is a viewable page, a random number is generated and sent to the tester. A data acquisition type message is sent to the client. The data returned by the client is compared with the generated random number. If the data is within the error range, the test is considered passed; otherwise, the test fails and is recorded. If the current page is a settings page, the initial / set value of the current page is first obtained. Based on this, a preset random number is generated. The corresponding key-value sequence is generated according to the difference and sent sequentially to the client. Finally, a confirmation key-value is sent for saving. Then, a data acquisition type message is sent to the client. The data returned by the client is compared with the preset random number. If they match, the test passes; otherwise, the test fails and is recorded.
[0087] During the closed-loop feedback phase, the test server automatically generates a work order based on the test results. The work order is uploaded to the Git server via a virtual Git account, forming a new development task. After developers fix the defects, the tests are retried, achieving a closed-loop iteration.
[0088] Example 2
[0089] This invention discloses an automated closed-loop testing method for HMI (Hybrid Management Interface) of power protection devices, applied to the automated closed-loop testing system for HMI of power protection devices described in Embodiment 1. The execution entity is a test server, comprising:
[0090] Switch test modes based on the development stage information provided by the Git server;
[0091] Request menu tree information from the test sub-thread, and generate test cases based on the received menu tree information;
[0092] Execute tests based on test cases, including:
[0093] Test key-value instructions are generated based on test cases and sent to the test sub-threads in sequence. The page status returned by the test sub-threads is compared with the expected page to verify the page positioning.
[0094] If the current test page is a viewing page, a random number is generated as an output setting parameter and sent to the power tester. The test data fed back by the test sub-thread is compared with the random number to verify whether the display is within the error range.
[0095] If the current test page is a settings page, request the initial value / setup value of the current test page from the test sub-thread. Generate a preset random number based on the initial value / setup value returned by the test sub-thread. Generate a corresponding key-value sequence based on the difference between the preset random number and the initial value / setup value, and issue modification key-value operation commands to the test sub-thread in sequence, instructing the test sub-thread to modify the initial value / setup value to the preset random number. Issue a confirmation key-value operation command to the test sub-thread for saving. Compare the test data returned by the test sub-thread with the preset random number to verify whether the display is consistent.
[0096] Test results are generated based on the comparison results, and work order information is generated based on the test results;
[0097] The work order information is uploaded to the Git server.
[0098] Example 3
[0099] This invention discloses an automated closed-loop testing method for HMI (Hybrid Management Interface) of a power protection device, applied to the automated closed-loop testing system for HMI of a power protection device described in Embodiment 1. The executing entity is the HMI device under test storing the HMI program, including:
[0100] In Debug mode, the built-in menu.json file of the HMI program is parsed to generate a menu tree and test sub-threads are automatically created;
[0101] Initiate a UDP communication connection request to the test server and establish a UDP communication connection with the test server;
[0102] Receive a menu tree information request sent by the test server, and return the menu tree information to the test server according to the request;
[0103] Receive the operation instructions issued by the test server when performing the test, forward the operation instructions to the UI display layer of the HMI program for execution, and feed back the current page status after execution to the test server;
[0104] The test data generated based on the analog signal output by the power tester is fed back to the test server.
[0105] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0106] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 Methods that specify the functionality in one or more boxes.
[0107] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction methods implemented in a process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0108] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0109] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
Claims
1. An automated closed-loop testing system for an HMI (Hybrid Management Interface) of a power protection device, characterized in that, This includes the HMI device under test, the test server, the power tester, and the Git server; The HMI device under test stores an HMI program; the HMI program is used to parse the built-in menu.json file in Debug mode to generate a menu tree and automatically create a test sub-thread; the test sub-thread acts as a UDP client, used to forward the operation instructions issued by the test server when performing the test to the UI display layer of the HMI program for execution, and to feed back the page status after execution and the test data generated based on the analog signal output by the power tester to the test server; The test server, acting as a UDP server, is used to switch test modes based on the development stage information provided by the Git server. Request menu tree information from the test sub-thread to generate test cases; The test is executed according to the test cases, and the test results are generated based on the page status and test data fed back by the test sub-thread. A work order is generated based on the test results and uploaded to the Git server. The power tester is used to output analog signals to the HMI device under test according to the output setting parameters issued by the test server when performing the test. The Git server is used to provide the test server with information on the current development stage of the HMI program, and to form development tasks based on the work orders uploaded by the test server, thereby achieving closed-loop iteration.
2. The automated closed-loop test system for power protection device HMI according to claim 1, characterized in that, The step of executing tests according to the test cases includes: The test server generates test key-value instructions based on the test cases and sends them to the test sub-threads in sequence. The page status returned by the test sub-threads is compared with the expected page to verify the page positioning. If the current test page is a viewing page, the test server generates a random number as an output setting parameter and sends it to the power tester. The test data fed back by the test sub-thread is compared with the random number to verify whether the display is within the error range. If the current test page is a settings page, the test server requests the initial value / setup value of the current test page from the test sub-thread, generates a preset random number based on the initial value / setup value returned by the test sub-thread, generates a corresponding key-value sequence based on the difference between the preset random number and the initial value / setup value, and sends modification key-value operation commands to the test sub-thread in sequence, instructing the test sub-thread to modify the initial value / setup value to the preset random number; sends a confirmation key-value operation command to the test sub-thread for saving; and compares the test data returned by the test sub-thread with the preset random number to verify whether the display is consistent.
3. The automated closed-loop testing system for power protection device HMI according to claim 1, characterized in that, The HMI program also includes a communication management layer, a LOOP layer, and a data management layer; The communication management layer is used to establish a UDP communication connection with the test server; The LOOP layer is used to interact with external hardware, including forwarding operation instructions from external buttons / touch drivers to the UI display layer, forwarding the buffer array that the UI display layer needs to display to the LCD screen, and forwarding data from the data management layer to the UI display layer. The data management layer is used to store and manage the data in the HMI program.
4. The automated closed-loop test system for power protection device HMI according to claim 1, characterized in that, The test server includes an instruction generation module, a UDP server module, a test result generation module, a data generation module, a Git module, and an SSH communication module; The UDP server module is used to establish a UDP communication connection with the test sub-thread. The instruction generation module is used to generate test cases based on the menu tree information and the current test mode, and to generate operation instruction sequences based on the test cases; The data generation module is used to generate random numbers / preset random numbers for use in executing tests; The test result generation module is used to generate test results based on the comparison results; The Git module is used to request the current development stage information of the HMI program from the Git server, receive the development stage information returned by the Git server, and upload the work order to the Git server. The SSH communication module is used to establish an SSH connection with the power tester.
5. The automated closed-loop test system for power protection device HMI according to claim 1, characterized in that, The testing modes include robustness testing mode, new feature testing mode, and vulnerability repair testing mode. In robustness test mode, the interval between operation commands is shortened to 100ms, and all key values are randomly combined for stress testing until the HMI program generates a core dump file. Whether the program crashes is used as the basis for passing the test. In the new feature testing mode, new pages or elements are located and new feature verification test cases are generated based on version difference information. In vulnerability remediation testing mode, regression test cases are generated by locating the patched page elements based on the remediation records.
6. The automated closed-loop testing system for power protection device HMI according to claim 1, characterized in that, The menu tree information includes menu structure, page type, page ID, page elements, and data index; The page types include view types and settings types; When the page type is viewable, the test case includes a combination of arrow key values and page jump keys; When the page type is settings, the test case includes a combination of arrow key values, page jump keys, modification key values, and confirmation keys; wherein, the modification key value is used to modify the initial value / set value of the current page, and the confirmation key value is used to perform a save operation after the modification key value is issued.
7. The automated closed-loop testing system for power protection device HMI according to claim 1, characterized in that, The output setting parameters include at least one of voltage setting value, current setting value, or switching status.
8. The automated closed-loop testing system for power protection device HMI according to claim 1, characterized in that, The test server uploads the work order to the Git server using a virtual Git account.
9. A closed-loop automated testing method for an HMI (Hybrid Management Interface) of a power protection device, characterized in that, The HMI automated closed-loop test system for power protection devices according to any one of claims 1-8, wherein the execution entity is a test server, includes: Switch test modes based on the development stage information provided by the Git server; Request menu tree information from the test sub-thread, and generate test cases based on the received menu tree information; Execute tests based on test cases, including: Test key-value instructions are generated based on test cases and sent to the test sub-threads in sequence. The page status returned by the test sub-threads is compared with the expected page to verify the page positioning. If the current test page is a viewing page, a random number is generated as an output setting parameter and sent to the power tester. The test data fed back by the test sub-thread is compared with the random number to verify whether the display is within the error range. If the current test page is a settings page, request the initial value / setup value of the current test page from the test sub-thread. Generate a preset random number based on the initial value / setup value returned by the test sub-thread. Generate a corresponding key-value sequence based on the difference between the preset random number and the initial value / setup value, and issue modification key-value operation commands to the test sub-thread in sequence, instructing the test sub-thread to modify the initial value / setup value to the preset random number. Issue a confirmation key-value operation command to the test sub-thread for saving. Compare the test data returned by the test sub-thread with the preset random number to verify whether the display is consistent. Test results are generated based on the comparison results, and work order information is generated based on the test results; The work order information is uploaded to the Git server.
10. A closed-loop automated testing method for an HMI (Hybrid Management Interface) of a power protection device, characterized in that, The power protection device HMI automated closed-loop test system according to any one of claims 1-8, wherein the executing entity is the HMI device under test, includes: In Debug mode, the built-in menu.json file of the HMI program is parsed to generate a menu tree and test sub-threads are automatically created; Initiate a UDP communication connection request to the test server and establish a UDP communication connection with the test server; Receive a menu tree information request sent by the test server, and return the menu tree information to the test server according to the request; Receive the operation instructions issued by the test server when performing the test, forward the operation instructions to the UI display layer of the HMI program for execution, and feed back the current page status after execution to the test server; The test data generated based on the analog signal output by the power tester is fed back to the test server.
