Electromechanical software automatic testing method and system and storage medium
By using an automated testing framework and dynamic configuration management, the problems of long testing cycles and excessive manual intervention in electromechanical software testing are solved, achieving efficient and accurate test results and simplified configuration management, thus ensuring the stability and reliability of the software under different conditions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-03-10
AI Technical Summary
Traditional electromechanical software testing methods struggle to simultaneously verify the correctness of software logic, hardware compatibility, robustness to boundary conditions, and fault recovery capabilities. They also suffer from long testing cycles, excessive manual intervention, low efficiency of automated testing, hardware differences in existing automated testing systems that cannot cover various configuration combinations, susceptibility of test results to human error, complex configuration management, and high maintenance costs.
By defining electromechanical configuration information, developing Agent interaction services and lower-level control modules, orchestrating test workflows, and writing automated test scripts, automated testing of electromechanical software is achieved, including configuration detection, dynamic parameter loading and monitoring, and supporting the automatic execution of various test cases.
Significantly reduces testing time and manpower costs, improves testing efficiency and accuracy, reduces human error, ensures software stability and reliability under different conditions, simplifies configuration management, and enhances test coverage.
Smart Images

Figure CN121636347A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of software development, and relates to a mechatronic software automatic test method, system and storage medium. BACKGROUND
[0002] With the wide application of mechatronic systems in industrial control, aerospace, intelligent equipment and other fields, the complexity of embedded software of the mechatronic systems presents exponential growth. Modern mechatronic software usually needs to coordinate hardware driving, real-time control, network communication and human-computer interaction and the like, and the running environment covers harsh working conditions such as high and low temperature, electromagnetic interference, vibration and impact. Such systems have very high requirements for functional safety and real-time responsiveness. The traditional mechatronic software test method is difficult to verify the software logic correctness, hardware compatibility, boundary condition robustness and fault recovery capability synchronously; it cannot cope with the test pressure brought by short test period; and different types of equipment have hardware differences, and cannot cover hundreds of configuration combinations.
[0003] At present, more than 70% of the test time is occupied by repetitive manual testing, and a complete test cycle needs 5 man-days. Manual interpretation is easily affected by experience, for example, the waveform analysis error is ± 15%; and it is difficult to simulate extreme conditions during the test process, and the omission rate is high; paper recording leads to difficulty in problem reproduction, and the average time consumption for defect positioning is 8 hours.
[0004] Semi-automatic testing writes Python / Shell scripts to control test instruments, and automatically executes part of the test cases, but configuration management still needs manual intervention. If the device model or the like is changed, the script needs to be rewritten, the maintenance cost is high, the configuration cannot be switched in real time, the test interruption rate is more than 25%, there is a lack of real-time state feedback, the abnormality detection delay is minutes, and manual log sorting is required, and the report output efficiency is low. SUMMARY
[0005] The technical problem solved by the application: in the prior art, manual testing of on-board software requires a large amount of manpower, and the test results may be inaccurate due to fatigue, distraction and the like of the test personnel during execution of the test cases. The application provides a mechatronic software automatic test method, system and storage medium, realizes automatic testing of mechatronic software, can improve test efficiency and accuracy, reduce human errors, and ensure the stability and reliability of the software under various conditions. Through automatic testing, a large number of test cases can be quickly executed, and the time and labor cost required for testing can be significantly reduced.
[0006] Technical scheme of the application A mechatronic software automatic test method, comprising the following steps: (1) defining mechatronic configuration information, establishing a configuration attribute dictionary, and clearly defining the physical meaning, value range and associated hardware of each field; (2) Check whether the above electromechanical configuration information is correct; (3) Develop Agent interaction services and design interface protocols; (4) Develop a lower-level machine control and monitoring module to realize the loading of dynamic parameters and the starting of monitoring threads; (5) Arrange the test workflow; (6) Write automated test scripts based on the test workflow, and use the test workflow scripts directly for automated testing of electromechanical software.
[0007] Furthermore, in step (1), the electromechanical configuration information includes: equipment model, current threshold, temperature threshold, and voltage.
[0008] Furthermore, step (2) involves designing an electromechanical configuration loading module and defining a configuration detection algorithm to detect whether the electromechanical configuration information defined in step (1) is correct.
[0009] Furthermore, in step (3), the designed interface protocols include a test case receiving interface protocol, a status feedback interface protocol, and a report parsing interface protocol.
[0010] Furthermore, the test workflow arranged in step (5) includes a dynamic matching process for device models, a configuration detection process, a configuration loading process, an automatic test process, and a report generation process.
[0011] A system applied to the method, the system architecture comprising: Application platform: Used to schedule Agent interaction service modules; Agent Interaction Service Module: Receives test cases through the test case receiving interface and sends specified configuration models, test cases, and configuration update instructions to the application layer; monitors the test progress and results of electromechanical software in real time through the status feedback interface; and automatically generates test reports through the report parsing interface, analyzes test results, and provides visual feedback. Application layer: Used to receive specified configuration models, test cases, and configuration update instructions issued by the Agent interaction service module, output results, and realize interaction with the application platform; Business function layer: used for initializing electromechanical configuration information, detecting configuration information, updating configuration information, and communicating and interacting with the lower-level machine; Lower-level machine: Used to load the dynamic parameters and monitoring threads required by the lower-level machine according to the predefined configuration file, and to perform automated testing of electromechanical software.
[0012] Furthermore, the business function layer includes an electromechanical configuration module: The electromechanical configuration module is used for electromechanical configuration information creation, management, detection, software adaptation management, and updating, wherein: Electromechanical configuration information creation is achieved by manually creating electromechanical static configuration files. These static configuration files include all necessary configuration information, such as: equipment model, current threshold, temperature threshold, and voltage. Electromechanical configuration information management, that is, to centrally manage all configuration information using configuration model; Electromechanical configuration information detection: The electromechanical software checks whether the file definition loading information is correct according to the predefined configuration file content and outputs the results. Software adaptation management: dynamically load the corresponding configuration information based on different configuration models; Electromechanical configuration information updates, meaning that configuration information can be updated in real time during automated testing. Furthermore, the lower-level machine includes: Lower-level machine control and monitoring module: used to load the dynamic parameters and settings required by the lower-level machine, and to start the monitoring thread; Test workflow orchestration module: used to orchestrate automated test processes for electromechanical software; The automated testing module is used to create automated test scripts based on the test workflow. Electromechanical software can directly use these test workflow scripts for automated testing.
[0013] A computer storage medium having computer-executable instructions stored thereon, which, when executed by a processor, implement the method described thereon.
[0014] Beneficial effects This invention provides an automated testing method, system, and storage medium for electromechanical software, which can significantly save testing time and improve testing efficiency. By quickly executing predetermined test cases, it automatically determines whether the test is successful, reducing the need for manual inspection. Automated testing not only reduces the risk of human error but also promptly detects software defects, ensuring the stability and reliability of software under different conditions. Specifically, it has the following advantages: (1) Simplified configuration management: Centralized management of configuration information reduces the need for hard coding, making configuration modification and updates more convenient, reducing the possibility of errors, and achieving flexibility and scalability.
[0015] (2) Improve readability: The structured configuration file makes the configuration information clearer, easier to understand and use.
[0016] (3) Parameterized testing: It supports passing different parameters through configuration files, so that the same test case can be executed under different conditions, which enhances the coverage of the test.
[0017] In summary, the automated testing method for electromechanical software proposed in this invention has good scalability and is easy to use, and has broad application prospects. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of the architecture of an automated testing system; Figure 2 This is a schematic diagram of automated testing. Figure 3 This is a flowchart of the task scheduling process for the application platform. Detailed Implementation
[0019] The features and illustrative embodiments of various aspects of the present invention will now be described in detail. Numerous specific details are set forth in the following detailed description to provide a thorough understanding of the invention. However, it will be apparent to those skilled in the art that the invention may be practiced without requiring some of these specific details. The following description of embodiments is merely intended to provide a better understanding of the invention by illustrating examples of the invention. The invention is by no means limited to any specific setups and methods set forth below, but covers any improvements, substitutions, and modifications to structures, methods, and devices without departing from the spirit of the invention. Well-known structures and techniques are not shown in the drawings and the following description to avoid unnecessarily obscuring the invention.
[0020] It should be noted that, unless otherwise specified, the embodiments of the present invention and the features thereof can be combined with each other, and the various embodiments can be referenced and cited in each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0021] One embodiment of the present invention provides an automated testing method for electromechanical software, the specific steps of which are as follows: (1) Define electromechanical configuration information, including equipment model, current threshold, temperature threshold, voltage and other configurations, establish a configuration attribute dictionary, and clarify the physical meaning, value range and associated hardware of each field.
[0022] (2) Implement the electromechanical configuration loading module, define the configuration detection algorithm, and detect whether the above configuration information is within a reasonable range.
[0023] (3) Develop Agent interaction services and design interface protocols, including test case reception, status feedback and report parsing interfaces.
[0024] (4) Develop a lower-level machine control and monitoring module, including loading dynamic parameters and starting the monitoring thread.
[0025] (5) Arrange the test workflow, including dynamic matching of equipment models, configuration detection, configuration loading, automatic testing, report generation and other processes.
[0026] (6) Automated test scripts are arranged according to the test workflow, and electromechanical software can directly use the test workflow scripts for automated testing.
[0027] A second embodiment of the present invention provides a system applied to the electromechanical software automated testing method, the system architecture including: Application platform: Used to schedule Agent interaction service modules and connect the entire automation process; Agent Interaction Service Module: Receives test cases through the test case receiving interface and sends specified configuration models, test cases, and configuration update instructions to the application layer; monitors the test progress and results of electromechanical software in real time through the status feedback interface; and automatically generates test reports through the report parsing interface, analyzes test results, and provides visual feedback. Application layer: Used to receive the execution source code of the Agent interaction service module, that is, the specified configuration model, test cases, and configuration update instructions issued by the Agent interaction service module, output the results, and realize the interaction with the application platform; Business Function Layer: Used for initializing electromechanical configuration information, detecting configuration information, and updating configuration information. It mainly performs configuration detection and loading and communicates with the lower-level machine. Lower-level machine: Used to load the dynamic parameters and monitoring threads required by the lower-level machine according to the predefined configuration file, to ensure that it can run normally. After initialization, it performs status checks to ensure that all functions of the lower-level machine are normal, and then performs automated electromechanical software testing.
[0028] In this embodiment, the business function layer includes an electromechanical configuration module: The electromechanical configuration module is used for electromechanical configuration information creation, management, detection, software adaptation management, and updating, wherein: Electromechanical configuration information creation is achieved by manually creating electromechanical static configuration files. These static configuration files include all necessary configuration information, such as: equipment model, current threshold, temperature threshold, and voltage. Electromechanical configuration information management, that is, to centrally manage all configuration information using configuration model; Electromechanical configuration information detection: The electromechanical software checks whether the file definition loading information is correct according to the predefined configuration file content and outputs the results. Software adaptation management: dynamically load the corresponding configuration information based on different configuration models; Electromechanical configuration information updates, meaning that configuration information can be updated in real time during automated testing. In this embodiment, the lower-level machine includes: Lower-level machine control and monitoring module: used to load the dynamic parameters and settings required by the lower-level machine, and to start the monitoring thread; Test workflow orchestration module: used to orchestrate automated test processes for electromechanical software; The automated testing module is used to create automated test scripts based on the test workflow. Electromechanical software can directly use these test workflow scripts for automated testing.
[0029] The technical points used in this invention are as follows: Figure 2 As shown, it specifically includes: (1) This invention proposes an automated testing framework: an automated testing framework that supports multiple test cases and can flexibly respond to different testing needs.
[0030] (2) Dynamic configuration management of electromechanical configuration modules: By implementing a dynamic configuration loading mechanism, the system can automatically select and load the corresponding configuration files according to different environments and requirements during runtime. This approach not only improves the flexibility of the system but also reduces errors caused by manual configuration modifications.
[0031] (3) Error detection and logging of electromechanical configuration module: During the configuration loading process, the system automatically checks the integrity and correctness of the configuration file and generates detailed log records when errors are found. This helps to quickly locate problems and reduce troubleshooting time. (4) Agent interaction module status feedback mechanism: The test progress and results are monitored in real time through the status feedback interface to ensure the traceability of the test.
[0032] (5) Agent interaction module report parsing function: automatically generates test reports, analyzes test results and provides visual feedback to help developers quickly locate problems.
[0033] (6) (Automated testing phase) Interactive test execution: Enables interaction between the Agent and electromechanical software, and can adjust the test strategy and execution process according to real-time requirements.
[0034] A third embodiment of the present invention provides an automated testing method for a certain intelligent elevator control system, comprising: Step 1: Define the elevator control system configuration information, including elevator equipment model, elevator operating floor range, maximum elevator speed, maximum load, emergency braking response time, elevator door opening and closing time, etc.
[0035] Step 2: The development service automatically identifies the elevator model (by reading the controller model ID via the CAN bus). This service automatically reads the configuration file, loads the corresponding configuration, and checks the validity of the configuration file. If the check passes, the elevator software initialization is completed automatically. If the check fails, an error log is generated and the initialization is paused.
[0036] Step 3: Develop Agent interaction service, including elevator instruction receiving module (receive user button instructions, verify instruction validity, and store in task queue), elevator operation status feedback module (record elevator operation status and push elevator status in real time), and report parsing module (analyze key indicators and generate visual reports).
[0037] Step 4: Issue control commands to simulate scenarios, such as earthquake scenario testing, overload protection scenario testing, power outage emergency scenario testing, and normal operation scenario testing. For example, when testing "overload protection", send a simulated load signal of 1100kg (exceeding the 1000kg limit) to the elevator control system and observe whether it triggers the audible and visual alarm and prohibits operation.
[0038] Step 5: Start the lower-level machine and initialize the configuration, start the elevator main controller (based on Linux RTOS), and start control functions such as detecting key sensors, verifying memory, connecting motor drivers, and detecting display units.
[0039] Step 6: After initialization, perform a status check to check whether the communication between each controller is normal, whether the core functions such as the floor buttons are normal, and test the safety devices to ensure that all functions of the lower-level machine are normal.
[0040] Step 7: Deploy the configuration monitoring program to monitor changes to the configuration file in real time. Without restarting the elevator system, the monitoring program will automatically trigger the configuration reload mechanism and send an "update parameters" command to the lower-level machine through the Agent, ensuring that the new configuration takes effect within 30 seconds.
[0041] Step 8: Dynamically adjust the testing strategy and parameters based on the new configuration. For example, if the maximum speed limit is increased, test cases will automatically add stability tests during high-speed operation; if a nighttime energy-saving mode configuration is added, test cases will include steps to automatically reduce lighting brightness.
[0042] A fourth embodiment of the present invention provides a computer storage medium storing computer-executable instructions thereon, which, when executed by a processor, implement the aforementioned automated testing method for electromechanical software.
[0043] In summary, this invention can significantly save testing time and improve testing efficiency for electromechanical software. By rapidly executing predetermined test cases and automatically determining test success, the need for manual checks is reduced. Automated testing not only reduces the risk of human error but also promptly identifies software defects, ensuring the stability and reliability of software under various conditions.
[0044] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should be covered within the protection scope of the present invention.
Claims
1. A method of electromechanical software automated testing, characterized by, It comprises the following steps: (1) defining electromechanical configuration information, establishing configuration attribute dictionary, and making clear the physical meaning, value range and associated hardware of each field; (2) detecting whether the electromechanical configuration information is correct; (3) developing Agent interaction service and designing interface protocol; (4) developing lower machine control and monitoring module to realize dynamic parameter loading and monitoring thread starting; (5) arranging test workflow; (6) writing automatic test script according to test workflow, and directly using the test workflow script for automatic test by electromechanical software.
2. The electromechanical software automation testing method of claim 1, wherein, In step (1), the electromechanical configuration information comprises: device model, current threshold, temperature threshold and voltage.
3. The electromechanical software automation testing method of claim 2, wherein, Step (2) is to detect whether the electromechanical configuration information defined in step (1) is correct by designing electromechanical configuration loading module and defining configuration detection algorithm.
4. The electromechanical software automation testing method of claim 3, wherein, In step (3), the designed interface protocol comprises test case receiving interface protocol, state feedback interface protocol and report analysis interface protocol.
5. The electromechanical software automation testing method of claim 4, wherein, The test workflow arranged in step (5) comprises device model dynamic matching flow, configuration detection flow, configuration loading flow, automatic test flow and report generation flow.
6. A system for use in the method of claim 5, characterized in that The system architecture comprises: application platform: for scheduling Agent interaction service module; Agent interaction service module: receiving test cases through test case receiving interface, and issuing specified configuration model, test case and configuration update instruction to application layer; monitoring test progress and result of electromechanical software in real time through state feedback interface; automatically generating test report, analyzing test result and providing visual feedback through report analysis interface; application layer: for receiving specified configuration model, test case and configuration update instruction issued by Agent interaction service module, outputting result, and realizing interaction with application platform; business function layer: for initializing electromechanical configuration information, configuration information detection, configuration information update, and communicating with lower machine; lower machine: for loading dynamic parameters and monitoring threads required by lower machine according to predefined configuration file, and performing electromechanical software automatic test.
7. The system of claim 6, wherein, The business function layer comprises electromechanical configuration module: The electromechanical configuration module is used for electromechanical configuration information creation, electromechanical configuration information management, electromechanical configuration information detection, software adaptation management and electromechanical configuration information update, wherein: electromechanical configuration information creation is to manually create electromechanical static configuration file by personnel, and the electromechanical static configuration file comprises all necessary configuration information, and the necessary configuration information comprises device model, current threshold, temperature threshold and voltage; electromechanical configuration information management is to centrally manage all configuration information by using configuration model; electromechanical configuration information detection is to detect whether file definition loading information is correct according to predetermined configuration file content, and output result; software adaptation management is to select corresponding configuration information for dynamic loading according to different configuration models; electromechanical configuration information update is to update configuration information in real time during automatic test process.
8. The system of claim 6, wherein, The lower machine comprises: lower machine control and monitoring module: for realizing loading of dynamic parameters and settings required by lower machine, and starting monitoring thread; Test workflow orchestration module: used for orchestrating the mechanical and electrical software automatic test flow; Automatic test module: used for automatically testing the mechanical and electrical software according to the test workflow script.
9. A computer storage medium having computer-executable instructions stored therein, which, when executed by a processor, implement the method of any one of claims 1-5.