Template test system and method for multi-model fire alarm controllers

By automating the testing process of fire alarm controllers through a template-based testing system, the problems of large model differences, complicated testing steps, and difficulty in determining the timing of actions have been solved, achieving efficient, reliable test results and consistent quality.

CN121680356APending Publication Date: 2026-03-17JIANGSU QIFENG TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610015690.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-07
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing fire alarm controller production and testing suffers from problems such as large model differences, complicated testing procedures, frequent manual plugging and unplugging of terminals, difficulty in determining the timing of actions, and complex sound and light linkage logic, resulting in low testing efficiency and difficulty in ensuring quality consistency.

Method used

A template-based testing system is adopted, in which test items and parameters are defined by a template generation unit, signal path is parsed by a template parsing unit, input-output closed-loop is realized by a signal closed-loop unit, results are automatically determined by a self-determination algorithm unit, and test data is recorded by a report generation and traceability unit, thus realizing an automated and standardized testing process.

Benefits of technology

It significantly improves the testing efficiency and consistency of fire alarm controllers, avoids human error, is compatible with multiple controller models, meets CCCF certification requirements, and generates standardized reports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121680356A_ABST
    Figure CN121680356A_ABST
Patent Text Reader

Abstract

The invention provides a template test system and method for multi-model fire alarm controllers. The system comprises a template generation unit, a template management unit, a template analysis unit, a signal closed loop unit, a test execution unit, a self-judgment algorithm unit and a report generation and tracing unit. The use method of the system comprises the steps that a template file is generated through an upper computer of the template generation unit and imported into a USB flash disk, then a test instruction set is generated through an HMI analysis module of the template management unit, the output end of the signal closed loop unit automatically feeds back the input end to form a closed loop, and then the test execution unit controls execution and collects feedback signals. The self-judgment algorithm unit automatically analyzes, judges and compensates an algorithm, and finally the report generation and tracing unit automatically generates and uploads a report, so that the problems of large model difference, complicated test steps, multiple manual plugging terminals, difficulty in judgment of an action time sequence, complicated acousto-optic linkage logic and the like in the production test of the existing fire alarm controller are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of fire safety system technology, specifically to a templated testing system and method for multiple types of fire alarm controllers. Background Technology

[0002] As a core component of fire protection systems, fire alarm controllers primarily function to process fire alarm signals, detect faults, activate audible and visual signals, trigger linkages, and monitor status. Due to significant differences in models, configurations, number of loops, board structures, and communication protocols among various fire alarm control systems, production testing typically requires extensive customized input / output verification for different models. Currently, production testing is still mainly manual, requiring testers to frequently plug and unplug terminals, switch different input signals, verify the output status of multiple relays, and observe LED indicators and audible / visual activation actions. However, as controller functionality and the number of interfaces continue to increase, this manual testing method has significant limitations. Firstly, different models and hardware versions of controllers have inconsistent numbers of input / output ports and vastly different business logic, making it impossible to standardize testing procedures and increasing the complexity of manual testing. Secondly, multi-line inputs and multi-line... Output signals for fire alarms, faults, and monitoring often have millisecond-level timing requirements. Manual methods cannot accurately determine the sequence of actions and response times, leading to inefficiency and a high risk of misjudgments and omissions. Furthermore, the audio-visual actuation and linkage control logic typically involves multiple action chains; for example, LED lighting → buzzer sound → relay activation, with strict timing relationships between different events. Existing manual testing methods rely solely on visual observation and manual timer recording, failing to achieve complete and accurate verification of complex action chains and unable to meet the efficiency requirements of large-scale mass production. On the other hand, fire alarm controllers typically need to meet mandatory certification requirements such as CCCF, requiring complete test records during production. Existing manual testing methods generally use manually filled-out forms or semi-automatic recording methods, with data derived from manual observation of LED status, relay operation, and audio-visual actuation status; these manual recording methods have significant drawbacks.

[0003] In summary, existing fire alarm controller production testing suffers from problems such as cumbersome testing processes, low efficiency, reliance on manual experience, difficulty in adapting to different models, inability to accurately determine action timing, and difficulty in ensuring quality consistency. To address these issues, the applicant proposes a templated testing system and method for multiple fire alarm controller models. This intelligent production testing system and method can automatically perform input / output verification, automatically determine the timing chain of multiple events, adapt to multiple models, and automatically generate test reports. Summary of the Invention

[0004] To address the aforementioned technical issues, this invention proposes a template-based testing system and method for multiple fire alarm controller models. The system uses test templates as its core, abstractly describing the functional characteristics, hardware structure, input / output port configurations, and business logic rules of different controller models. This enables standardized, structured, and automated execution of the testing process, eliminating human error, reducing repetitive operations, and significantly improving testing efficiency and consistency. The template-based testing system defines test content in a data-driven manner, transforming traditional test steps relying on human experience and manual recording into parsable and executable structured template files. The templates include not only the triggering conditions, action steps, and expected responses for each test item, but also key production testing elements such as input / output signal mapping relationships, multi-event timing links, closed-loop path definitions, judgment rules, and threshold parameters. By abstracting test behaviors into template parameters, the system can automatically adapt to different models, versions, and numbers of loops of fire alarm controllers, achieving the goal of testing multiple models with a single system.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0006] A template-based testing system and method for multiple fire alarm controller models is characterized by the following: the template-based testing system for multiple fire alarm controller models includes a template generation unit, a template management unit, a template parsing unit, a signal closed-loop unit, a test execution unit, a self-judgment algorithm unit, and a report generation and traceability unit; the template generation unit is provided by a host computer software interface, which allows selection of test items, port mapping and parameter configuration, test timing and logic configuration, thresholds and judgments, and finally generates a structured template file in JSON or XML format; the template management unit is used to automatically load the corresponding test template file, which contains test items, test port mappings, signal states, judgment conditions, etc.; the test template is imported into the HMI controller via a USB flash drive; the HMI controller template parsing unit of the template parsing unit is responsible for parsing the template file content and generating an internal test instruction set; after parsing, a test step table is formed, including the trigger signal source, receiving signal source, trigger signal state, sampling period, and judgment conditions for each step; the signal closed-loop unit consists of a multi-line input board, a multi-line output board, and a PLC. The system comprises an input expansion board and a PLC output expansion board. The template parsing unit sends control commands to the MCU and PLC controllers of the multi-line input board and multi-line output board respectively, based on the generated test instruction set. Under software control, the MCU and PLC controllers of the signal closed-loop unit automatically feed back the output ports to the input ports, achieving test signal closed-loop. The system can dynamically configure the closed-loop path. The HMI controller of the test execution unit sends test instructions to the MCU and PLC controllers via an RS485 communication interface. The MCU and PLC controllers execute the test instructions sequentially. The test execution unit automatically runs each test task according to the template definition order to perform input simulation and monitor controller output. The self-judgment algorithm unit determines whether the result matches the template definition and jumps to the next process point based on the logical node. The report generation and traceability unit automatically records the execution steps and judgment results of each test through the HMI controller, generates a standardized test report, and uploads it to the production management system to achieve batch traceability.

[0007] Furthermore, the algorithm steps of the template generation unit of the templated testing system for multiple types of fire alarm controllers are as follows:

[0008] Step 1: Model Capability Reading; The host computer reads the characteristic information of the target fire alarm controller from the model database, including: number of input loops, number of output loops, supported business functions, sound and light drive configuration, and communication capabilities;

[0009] Step 2: Port mapping configuration; Production operators map the logical ports in the template to physical port numbers. The system checks the port mapping and automatically prompts for correction if the number of ports is insufficient or duplicated.

[0010] Step 3: Test Item Configuration; Operator options include: fire alarm detection test, fault detection test, monitoring detection test, sound and light drive test, relay action test, communication message test, and circuit short circuit and open circuit simulation test; each test item generates a structured step object;

[0011] Step 4: Timing Link Configuration; The host computer allows users to configure complex service timing links, namely: fire alarm trigger → audible and visual activation → output action → alarm hold → reset → audible and visual stop; fault trigger → fault light illuminates → fault cleared → automatic reset;

[0012] Step 5: Configure the judgment parameters, including: maximum response time T_max, maximum stable jitter σ_max, sound and light start delay, relay activation and deactivation judgment values, communication message type code and address code / CRC check parameters;

[0013] Step 6: Template Export; The template generation unit writes the above content into a JSON / XML file, along with the template version number and generation time. The template is then imported into the HMI controller via USB drive for execution.

[0014] Furthermore, the parsing algorithm of the template parsing unit of the templated testing system for multiple fire alarm controller models is as follows: after the HMI controller system starts, it reads the template source JSON / XML file. The template defines the business process, namely, the point test steps, input signal triggering conditions, output control actions, expected sound and light performance, expected action sequence, power-off / reset, and other operation steps. The template parsing unit parses the template file into an executable structure within the system. The specific steps are as follows:

[0015] Step 1: Parse the template file; parse the key fields in the file: step_name - step name, trigger_signal - input trigger, trigger_status - simulates open circuit / short circuit / high level / low level, action - action to be performed, expected_response - expected result, timing - response time requirement, sequence_prev / sequence_next - timing sequence, loop_config - closed loop path;

[0016] Step 2: Port mapping validity check; check the template input data, and immediately report an error if the model does not have the required port;

[0017] Step 3: Timing Link Topology Check; Establish a directed graph of timing relationships between steps to check for circular dependencies, unreasonable timing delays, and disconnected links;

[0018] Step 4: Generate test instruction set; convert each step into internal objects, namely trigger action instruction set, closed-loop configuration instruction set, sampling instruction set, and judgment logic instruction set, jump logic pass / fail jump, and finally form a complete execution flowchart for the test execution unit to schedule.

[0019] Furthermore, the signal closed-loop establishment algorithm of the signal closed-loop unit of the templated test system for multiple fire alarm controllers is as follows: the HMI controller sends test tasks to the MCU and PLC respectively based on the template parsing results; the MCU controls the multi-line output board and PLC expansion output board to activate the output ports; the multi-line input board and PLC expansion input board synchronously activate the corresponding input ports; a closed-loop path of "output and input" is established through hardware and software linkage to ensure that the test signal automatically loops back; the specific steps are as follows:

[0020] Step 1: Read the loop configuration;

[0021] Step 2: Path planning; The system automatically finds a path from output to input using a hardware matrix.

[0022] Step 3: Configure the MCU / PLC to issue relay closing / opening, analog resistor selection, and analog short circuit / open circuit injection according to the path;

[0023] Step 4: Automatic Connectivity Verification; The system automatically outputs test pulses, and the connection is checked through the feedback port.

[0024] If the connection is not established, an error report will be generated.

[0025] Furthermore, the self-determination process of the self-determination algorithm unit of the templated testing system for multiple fire alarm controllers is as follows:

[0026] 1) The HMI controller sends control signals; the HMI controller issues action signals according to the test sequence defined in the template, namely fire alarm, fault, monitoring, audible and visual, communication commands and relay outputs, etc.

[0027] 2) Signal acquisition and closed-loop verification; acquire signals such as LED, buzzer, level, relay and self-test data through a closed-loop channel;

[0028] 3) Call the self-determination algorithm module; process the collected signal and compare it with the "expected determination conditions";

[0029] 4) Test recording and exception handling; write the results into the report and record any exceptions.

[0030] Furthermore, the self-judgment algorithm unit of the templated testing system for multiple fire alarm controllers first filters and extracts feature data from the collected feedback data through the sampling data preprocessing module, and then automatically compares the data using the self-judgment algorithm to automatically determine each test item based on the sampling results in a multi-dimensional judgment. Specifically:

[0031] 1) Timing determination; if T_resp≤T_max, the timing determination passes and meets the requirements; if it exceeds the upper limit, it is considered an "action timeout"; specifically:

[0032] Response time meets:

[0033] Judgment rules:

[0034]

[0035] 2) Steady-state determination; if σ ≤ σ_max within the stable window, the steady-state determination passes; otherwise, the stability is poor, and the determination fails; specifically:

[0036] The sampling sequence is ;

[0037] Average value within the steady-state window:

[0038] The formula for calculating jitter σ is:

[0039]

[0040] Judgment rules:

[0041] in: For a stable duration;

[0042] The minimum steady-state duration defined for the template;

[0043] 3) Business consistency determination; automatically determine whether fire alarm triggering activates audible and visual alarms, fault triggering illuminates fault lights, fault clearing automatically resets, monitoring status is correctly reflected, and relay normally open / normally closed contacts operate correctly; specifically:

[0044] Define the business logic decision function:

[0045]

[0046] Fire alarm services:

[0047]

[0048] Faulty services:

[0049]

[0050] 4) Communication message judgment; namely: address code, type code, status byte, data integrity, CRC check, and finally, the results of multiple items are merged to generate a single test report; specifically:

[0051] For message data Includes: Address: ,type: ,state: CRC check: ;

[0052] Message field consistency

[0053]

[0054] CRC check

[0055]

[0056] Message interval

[0057]

[0058] Overall message determination:

[0059]

[0060] Verify that the address, type code, and status code match the template expectations; verify that the CRC is correct; and check that the message sequence and time interval conform to the communication protocol.

[0061] Furthermore, the report generation and traceability algorithm of the report generation and traceability unit of the templated test system for multiple fire alarm controllers automatically generates a report after the test results are judged, namely: test item name, port number; measured value, threshold range; judgment result; execution time and operator number; the report is saved in a standard format and uploaded to the production management system, supporting traceability by batch and model.

[0062] Furthermore, the steps for using the templated testing system for multiple fire alarm controller models are as follows:

[0063] Step 1: Generate a template file through the host computer of the template generation unit and import it into a USB flash drive; the host computer software interface allows you to select test items, port mapping and parameter configuration, test timing and logic configuration, thresholds and judgments, and finally generate a structured template file in JSON or XML format; generate the template file and import it into a USB flash drive.

[0064] Step 2: Generate a test instruction set through the HMI parsing module of the template management unit; the template management unit automatically loads the corresponding test template file, which contains test items, test port mappings, signal status, judgment conditions, etc.; the test template is imported into the HMI controller via USB flash drive; after port mapping validity checks and timing link topology checks, the test instruction set is finally generated.

[0065] Step 3: The output of the signal closed-loop unit automatically feeds back to the input to form a closed loop; the HMI controller sends test tasks to the MCU and PLC respectively based on the template parsing results; the MCU controls the multi-line output board and PLC expansion output board to activate the output ports; the multi-line input board and PLC expansion input board synchronously activate the corresponding input ports; through hardware and software linkage, a closed-loop path of "output and input" is established to ensure that the test signal automatically returns to the loop.

[0066] Step 4: Test execution unit controls execution and collects feedback signals; The HMI controller sends test commands to the MCU and PLC controllers through the RS485 communication interface. The MCU and PLC controllers execute the test commands in sequence. The test execution unit automatically runs each test task in the order defined by the template to simulate the input and monitor the controller output.

[0067] Step 5: The self-judgment algorithm unit automatically analyzes, judges, and compensates the algorithm; the collected feedback data is first filtered and feature data extracted by the sampling data preprocessing module, and then automatically compared by the self-judgment algorithm to make an automatic judgment on each test item based on the multi-dimensional judgment of the sampling results.

[0068] Step Six: Report Generation and Traceability. The unit automatically generates and uploads reports; the HMI controller automatically records the execution steps and judgment results of each test, generates a standardized test report, and uploads it to the production management system to achieve batch traceability.

[0069] The benefits of this application are:

[0070] 1. A template-based testing system and method for multiple fire alarm controller models: Through an extensible template generation and adaptive parsing mechanism, the production testing of fire alarm controllers is transformed from manual dependence to a fully configurable, reusable, and automated execution mode, which significantly improves testing efficiency and the consistency of test results.

[0071] 2. The templated testing system and method for multiple fire alarm controllers adopts a closed-loop signal automatic verification and intelligent judgment algorithm with hardware and software collaboration, which effectively avoids problems such as manual wiring errors and misjudgments, ensuring stable and reliable test quality, and enabling rapid adaptation and mass production testing.

[0072] 3. Templated testing system and method for multiple fire alarm controllers: Based on the signal path defined in the template, the system automatically configures programmable switch matrix, PLCI / O or multi-line port board to realize automatic feedback of output signal to input terminal without manual wiring and plugging / unplugging;

[0073] 4. Templated testing system and method for multiple fire alarm controller models: The template defines the sequence of complex event chains and the maximum response time. The system automatically detects the timing of actions through a high-speed acquisition module to avoid errors from manual timing. The template predefines the correlation logic between business signals and equipment actions. The system automatically executes and compares the actual response to see if it meets the standard.

[0074] 5. Templated testing system and method for multiple fire alarm controller models: For models that support bus communication, the template defines the message format, address field, instruction code, and CRC check method. The system automatically parses and verifies the response message. Attached Figure Description

[0075] Figure 1 This is a schematic diagram of the method steps of the present invention. Detailed Implementation

[0076] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:

[0077] like Figure 1The diagram illustrates a template-based testing system and method for multiple fire alarm controller models. The template-based testing system includes a template generation unit, a template management unit, a template parsing unit, a signal closed-loop unit, a test execution unit, a self-judgment algorithm unit, and a report generation and traceability unit. The template generation unit, provided by a host computer software interface, allows selection of test items, port mappings and parameter configurations, test timing and logic configurations, thresholds and judgments, ultimately generating a structured template file in JSON or XML format. The template management unit automatically loads the corresponding test template file, which contains test items, test port mappings, signal states, and judgment conditions. The test template is imported into the HMI controller via a USB flash drive. The HMI controller template parsing unit of the template parsing unit parses the template file content and generates an internal test instruction set. After parsing, a test step table is formed, including the trigger signal source, receiving signal source, trigger signal state, sampling period, and judgment conditions for each step. The signal closed-loop unit consists of a multi-line input board, a multi-line output board, and a PLC. The system comprises an input expansion board and a PLC output expansion board. The template parsing unit sends control commands to the MCU and PLC controllers of the multi-line input board and multi-line output board, respectively, based on the generated test instruction set. The MCU and PLC controllers of the signal closed-loop unit automatically feed back the output ports to the input ports under software control, achieving test signal closed-loop. The system can dynamically configure the closed-loop path. The HMI controller of the test execution unit sends test instructions to the MCU and PLC controllers via an RS485 communication interface. The MCU and PLC controllers execute the test instructions sequentially. The test execution unit automatically runs each test task according to the template definition order to perform input simulation and monitor controller output. The self-judgment algorithm unit determines whether the result matches the template definition and jumps to the next process point based on the logic node. The report generation and traceability unit automatically records the execution steps and judgment results of each test through the HMI controller, generates a standardized test report, and uploads it to the production management system to achieve batch traceability.

[0078] The algorithm steps of the template generation unit in the templated test system for multiple fire alarm controller models shown are as follows:

[0079] Step 1: Model Capability Reading; The host computer reads the characteristic information of the target fire alarm controller from the model database, including: number of input loops, number of output loops, supported business functions, sound and light drive configuration, and communication capabilities;

[0080] Step 2: Port mapping configuration; Production operators map the logical ports in the template to physical port numbers. The system checks the port mapping and automatically prompts for correction if the number of ports is insufficient or duplicated.

[0081] Step 3: Test Item Configuration; Operator options include: fire alarm detection test, fault detection test, monitoring detection test, sound and light drive test, relay action test, communication message test, and circuit short circuit and open circuit simulation test; each test item generates a structured step object;

[0082] Step 4: Timing Link Configuration; The host computer allows users to configure complex service timing links, namely: fire alarm trigger → audible and visual activation → output action → alarm hold → reset → audible and visual stop; fault trigger → fault light illuminates → fault cleared → automatic reset;

[0083] Step 5: Configure the judgment parameters, including: maximum response time T_max, maximum stable jitter σ_max, sound and light start delay, relay activation and deactivation judgment values, communication message type code and address code / CRC check parameters;

[0084] Step 6: Template Export; The template generation unit writes the above content into a JSON / XML file, along with the template version number and generation time. The template is then imported into the HMI controller via USB drive for execution.

[0085] The key data structure is:

[0086] typedef struct {

[0087] char template_name

[64] ; / / Template name

[0088] char version

[16] ; / / Template version

[0089] char target_model

[32] ; / / The compatible device model

[0090] int step_count; / / Number of test steps

[0091] struct tTemplateStep steps

[256] ; / / Test step table

[0092] struct tGlobalParam global_param; / / Global decision parameters

[0093] } tTestTemplate.

[0094] The template parsing unit of the template-based testing system for multiple fire alarm controller models, as shown, uses the following parsing algorithm: After the HMI controller system starts, it reads the template source JSON / XML file. The template defines the business process, namely, point testing steps, input signal triggering conditions, output control actions, expected audio-visual performance, expected action sequence, power-off / reset operation steps, etc. The template parsing unit parses the template file into an executable structure within the system. The specific steps are as follows:

[0095] Step 1: Parse the template file; parse the key fields in the file: step_name - step name, trigger_signal - input trigger, trigger_status - simulates open circuit / short circuit / high level / low level, action - action to be performed, expected_response - expected result, timing - response time requirement, sequence_prev / sequence_next - timing sequence, loop_config - closed loop path;

[0096] Step 2: Port mapping validity check; check the template input data, and immediately report an error if the model does not have the required port;

[0097] Step 3: Timing Link Topology Check; Establish a directed graph of timing relationships between steps to check for circular dependencies, unreasonable timing delays, and disconnected links;

[0098] Step 4: Generate test instruction set; convert each step into internal objects, namely trigger action instruction set, closed-loop configuration instruction set, sampling instruction set and judgment logic instruction set, jump logic pass / fail jump, and finally form a complete execution flowchart for test execution unit scheduling;

[0099] The key data structure is:

[0100] typedef struct {

[0101] char step_name

[64] ; / / Step name, such as "fire alarm triggered"

[0102] / / Trigger signal group

[0103] char trigger_signal

[32] ; / / Trigger signal, such as FIRE_IN1

[0104] int trigger_status; / / Trigger status (short circuit / open circuit / high level / low level)

[0105] int trigger_timeout_ms; / / Maximum trigger wait time

[0106] / / Perform action

[0107] char action

[64] ; / / Such as "SET_FIRE", "SIM_FAULT"

[0108] / / Expected output

[0109] char expected

[64] ; / / Such as "BUZZER_ON"

[0110] / / Timing Link

[0111] char sequence_prev

[64] ; / / Name of the preceding steps

[0112] int sequence_delay_ms; / / How many milliseconds this step should be delayed after the preceding sequence is completed.

[0113] / / Closed-loop path

[0114] struct tLoopConfig loop; / / Closed-loop configuration for output → input

[0115] / / Judgment Indicators

[0116] struct tJudgeParam judge_param; / / Parameters specific to this step

[0117] } tTemplateStep.

[0118] The signal closed-loop establishment algorithm of the signal closed-loop unit in the templated test system for multiple fire alarm controllers shown is as follows: The HMI controller sends test tasks to the MCU and PLC respectively based on the template parsing results; the MCU controls the multi-line output board and PLC expansion output board to activate the output ports; the multi-line input board and PLC expansion input board synchronously activate the corresponding input ports; a closed-loop path of "output and input" is established through hardware and software linkage to ensure automatic loopback of the test signal; the specific steps are as follows:

[0119] Step 1: Read the loop configuration; for example, template definition: "loop":{"output":"O1","feedback":"I1"};

[0120] Step 2: Path planning; The system automatically finds a path from output to input using a hardware matrix.

[0121] Step 3: Configure the MCU / PLC to issue relay closing / opening, analog resistor selection, and analog short circuit / open circuit injection according to the path;

[0122] Step 4: Automatic Connectivity Verification; The system automatically outputs test pulses, and the connection is checked through the feedback port.

[0123] If the connection is not established, an error report will be generated.

[0124] The key data structures and algorithms are:

[0125] typedef struct {

[0126] char output_port

[32] ; / / Output port, such as "O1"

[0127] char feedback_port

[32] ; / / Input port, such as "I1"

[0128] int enable; / / 0 = disable closed-loop operation, 1 = enable closed-loop operation

[0129] } tLoopConfig;

[0130] typedef struct {

[0131] int max_response_time_ms; / / Maximum response time

[0132] float max_jitter; / / Maximum jitter threshold

[0133] int stable_window_ms; / / Stable window requirements

[0134] int require_buzzer; / / Whether to require sound

[0135] int require_led; / / Whether to require lighting

[0136] int relay_expect; / / Relay action expectation

[0137] } tJudgeParam.

[0138] The self-determination process of the self-determination algorithm unit of the templated test system for multiple fire alarm controllers shown is as follows:

[0139] 1) The HMI controller sends control signals; the HMI controller issues action signals according to the test sequence defined in the template, namely fire alarm, fault, monitoring, audible and visual, communication commands and relay outputs, etc.

[0140] 2) Signal acquisition and closed-loop verification; acquire signals such as LED, buzzer, level, relay and self-test data through a closed-loop channel;

[0141] 3) Call the self-determination algorithm module; process the collected signal and compare it with the "expected determination conditions";

[0142] 4) Test recording and exception handling; write the results into the report and record any exceptions.

[0143] The self-judgment algorithm unit of the templated test system for multiple fire alarm controllers, as shown, first filters and extracts feature data from the collected feedback data through the sampling data preprocessing module, and then automatically compares the results using the self-judgment algorithm to automatically determine each test item based on the multi-dimensional judgment of the sampling results. Specifically:

[0144] 5) Timing check; if T_resp≤T_max, the timing check passes and meets the requirements; if it exceeds the upper limit, it is considered an "action timeout"; specifically:

[0145] Response time meets:

[0146] Judgment rules:

[0147]

[0148] 6) Steady-state determination; if σ ≤ σ_max within the stable window, the steady-state determination passes; otherwise, the stability is poor, and the determination fails; specifically:

[0149] The sampling sequence is ;

[0150] Average value within the steady-state window:

[0151] The formula for calculating jitter σ is:

[0152]

[0153] Judgment rules:

[0154] in: For a stable duration;

[0155] The minimum steady-state duration defined for the template;

[0156] 7) Business consistency determination; automatically determines whether fire alarm triggering activates audible and visual alarms, fault triggering illuminates fault lights, fault clearing automatically resets, monitoring status is correctly reflected, and relay normally open / normally closed contacts operate correctly; specifically:

[0157] Define the business logic decision function:

[0158]

[0159] Fire alarm services:

[0160]

[0161] Faulty services:

[0162]

[0163] 8) Communication message judgment; namely: address code, type code, status byte, data integrity, CRC check, and finally, the results of multiple items are merged to generate a single test report; specifically:

[0164] For message data Includes: Address: ,type: ,state: CRC check: ;

[0165] Message field consistency

[0166]

[0167] CRC check

[0168]

[0169] Message interval

[0170]

[0171] Overall message determination:

[0172]

[0173] Verify that the address, type code, and status code match the template expectations; verify that the CRC is correct; and check that the message sequence and time interval conform to the communication protocol.

[0174] The key data structure is:

[0175] typedef struct {

[0176] int max_response_time_ms; / / Maximum response time

[0177] float max_jitter; / / Maximum jitter threshold

[0178] int stable_window_ms; / / Stable window requirements

[0179] int require_buzzer; / / Whether to require sound

[0180] int require_led; / / Whether to require lighting

[0181] int relay_expect; / / Relay action expectation

[0182] } tJudgeParam.

[0183] The report generation and traceability algorithm of the templated test system for multiple fire alarm controllers shown is to automatically generate a report after the test results are judged, namely: test item name, port number; measured value, threshold range; judgment result; execution time and operator number; the report is saved in a standard format and uploaded to the production management system, supporting traceability by batch and model.

[0184] The steps for using the templated test system for multiple fire alarm controller models shown are as follows:

[0185] Step 1: Generate a template file through the host computer of the template generation unit and import it into a USB flash drive; the host computer software interface allows you to select test items, port mapping and parameter configuration, test timing and logic configuration, thresholds and judgments, and finally generate a structured template file in JSON or XML format; generate the template file and import it into a USB flash drive.

[0186] Step 2: Generate a test instruction set through the HMI parsing module of the template management unit; the template management unit automatically loads the corresponding test template file, which contains test items, test port mappings, signal status, judgment conditions, etc.; the test template is imported into the HMI controller via USB flash drive; after port mapping validity checks and timing link topology checks, the test instruction set is finally generated.

[0187] Step 3: The output of the signal closed-loop unit automatically feeds back to the input to form a closed loop; the HMI controller sends test tasks to the MCU and PLC respectively based on the template parsing results; the MCU controls the multi-line output board and PLC expansion output board to activate the output ports; the multi-line input board and PLC expansion input board synchronously activate the corresponding input ports; through hardware and software linkage, a closed-loop path of "output and input" is established to ensure that the test signal automatically returns to the loop.

[0188] Step 4: Test execution unit controls execution and collects feedback signals; The HMI controller sends test commands to the MCU and PLC controllers through the RS485 communication interface. The MCU and PLC controllers execute the test commands in sequence. The test execution unit automatically runs each test task in the order defined by the template to simulate the input and monitor the controller output.

[0189] Step 5: The self-judgment algorithm unit automatically analyzes, judges, and compensates the algorithm; the collected feedback data is first filtered and feature data extracted by the sampling data preprocessing module, and then automatically compared by the self-judgment algorithm to make an automatic judgment on each test item based on the multi-dimensional judgment of the sampling results.

[0190] Step Six: Report Generation and Traceability. The unit automatically generates and uploads reports; the HMI controller automatically records the execution steps and judgment results of each test, generates a standardized test report, and uploads it to the production management system to achieve batch traceability.

[0191] The template-based testing system and method for multiple fire alarm controller models presented here addresses the problems existing in the production testing of fire alarm controllers, such as large model differences, complex testing steps, frequent manual terminal insertion and removal, difficulty in determining action timing, and complex sound and light linkage logic. A production automation testing system based on "template-based testing" is proposed. This system uses test templates as its core, abstracting and describing the functional characteristics, hardware structure, input / output port configuration, and business logic rules of different controller models. This enables the testing process to be standardized, structured, and automated, thereby eliminating human error, reducing repetitive operations, and significantly improving testing efficiency and consistency. The template-based testing system defines test content in a data-driven manner, transforming traditional test steps that rely on human experience and manual recording into parsable and executable structured template files. The templates include not only the triggering conditions, action steps, and expected responses for each test item, but also key production testing elements such as input / output signal mapping relationships, multi-event timing links, closed-loop path definitions, judgment rules, and threshold parameters. By abstracting test behavior into template parameters, the system can automatically adapt to different models, versions, and numbers of loops of fire alarm controllers, achieving the goal of testing multiple models with a single system. Specifically:

[0192] 1) Closed-loop construction of input and output signals; Based on the signal path defined by the template, the system automatically configures programmable switch matrix, PLCI / O or multi-line port board to realize automatic feedback of output signals to the input end without the need for manual cable handling and plugging / unplugging;

[0193] 2) Timing verification of the audio-visual drive and relay action link; the template defines the sequence and maximum response time of complex event links, and the system automatically detects the action timing through a high-speed acquisition module to avoid manual timing errors;

[0194] 3) Automatic verification of business logic such as fire alarm, fault, and monitoring; the association logic between business signals and equipment actions is predefined in the template, and the system automatically executes and compares whether the actual response meets the standard;

[0195] 4) Automatic verification of communication messages; For models that support bus communication, the template defines the message format, address field, command code, and CRC check method, and the system automatically parses and verifies the response message;

[0196] 5) Self-determining execution; the self-determining algorithm performs multi-dimensional determination based on the sampling results;

[0197] Through the above mechanism, the template-based testing system can transform traditional testing work that relies heavily on human experience into a standardized process that is reusable, maintainable, and automated. Different controller models do not need to redevelop test programs; they only need to modify or regenerate the corresponding templates, and the system can automatically execute the entire testing process. This not only significantly reduces the technical threshold for testers but also enables the production line to quickly adapt to model changes, version iterations, and functional expansions, improving the efficiency and quality consistency of automated production.

[0198] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any other way. Any modifications or equivalent changes made based on the technical essence of the present invention shall still fall within the scope of protection claimed by the present invention.

Claims

1. A template test system for multi-model fire alarm controllers, comprising: The multi-model fire alarm controller-oriented templated test system comprises a template generation unit, a template management unit, a template analysis unit, a signal closed-loop unit, a test execution unit, a self-determination algorithm unit and a report generation and traceability unit; the template generation unit is provided by an upper computer software interface, and test items, port mapping and parameter configuration, test timing and logic configuration, threshold and determination can be selected, and finally a structured template file in JSON format or XML format is generated; the template management unit is used for automatically loading a corresponding test template file, and the template file contains test items, test port mapping, signal state, determination condition and the like; the test template is imported into the HMI controller through a U disk; the HMI controller template analysis unit of the template analysis unit is responsible for analyzing the content of the template file, and generates an internal test instruction set; after analysis, a test step table is formed, including the trigger signal source, the received signal source, the trigger signal state, the sampling period and the determination condition of each step; the signal closed-loop unit is composed of a multi-line input board, a multi-line output board, a PLC input expansion board and a PLC output expansion board; the template analysis unit sends control commands to the MCUs of the multi-line input board and the multi-line output board and the PLC controller according to the generated test instruction set; the MCUs and the PLC controller of the signal closed-loop unit automatically feed back the output port to the input port under software control, so as to realize test signal closed loop; the system can dynamically configure the closed-loop path; the HMI controller of the test execution unit sends test instructions to the MCUs and the PLC controller through an RS485 communication interface, and the MCUs and the PLC controller execute the test instructions in turn, and the test execution unit automatically runs each test task according to the order defined in the template to perform input simulation and monitor the controller output; the self-determination algorithm unit jumps to the next flow point according to the logic node according to whether the judgment result matches the template definition; the report generation and traceability unit automatically records the execution steps and the determination result of each test through the HMI controller, generates a standardized test report, and uploads the report to a production management system, so as to realize batch traceability.

2. The method of claim 1, wherein: The algorithm steps of the template generation unit of the multi-model fire alarm controller-oriented templated test system are as follows: Step one, model capability reading; The upper computer reads the characteristic information of the target fire alarm controller from the model database, including: the number of input loops, the number of output loops, supported business functions, sound and light drive configuration and communication capability; Step two, port mapping configuration; the production operator maps the logical ports in the template to the physical port numbers, and the system checks the port mapping; if the number of ports is insufficient or repeated, it automatically prompts correction; Step three, test item configuration; the operator can select: fire detection test, fault detection test, supervision detection test, sound and light drive test, relay action test, communication message test, loop short circuit and open circuit simulation test; each test item generates a structured step object; Step four, timing link configuration; the host computer allows users to configure complex business timing links, i.e. fire trigger → sound and light start → output action → alarm keep → reset → sound and light stop; fault trigger → fault light on → fault release → automatic reset; Step five, determine parameter configuration; including: maximum response time T_max, maximum stable jitter σ_max, sound and light start delay, relay attraction and release determination value, communication message type code and address code / CRC check parameter; Step six, template export; the template generation unit writes the above content into a JSON / XML file, and attaches a template version number and generation time, and the template is imported into the HMI controller through the U disk for execution.

3. The method of claim 1, wherein: The analysis algorithm of the template analysis unit of the template test system for multiple models of fire alarm controllers is that after the HMI controller system is started, the template source JSON / XML file is read, and the business process is defined in the template, i.e. point test step, input signal trigger condition, output control action, expected sound and light performance, expected action sequence, power-off / reset operation step; the template analysis unit parses the template file into an executable structure body in the system, and the specific steps are: Step one, analyze the template file; analyze the key fields in the file: step_name-step name, trigger_signal-input trigger, trigger_status-analog open / short / high / low, action-execution action, expected_response-expected result, timing-response time requirement, sequence_prev / sequence_next-timing link, loop_config-closed loop path; Step two, port mapping legality check; check the template input data, if the model does not have the port, then immediately report an error; Step three, timing link topology check; the timing relationship between steps is established into a directed graph, and it is checked whether there is a circular dependency, unreasonable timing delay and unconnected link; Step four, generate test instruction set; convert each step into an internal object, i.e. trigger action instruction set, closed loop configuration instruction set, sampling instruction set and determination logic instruction set, jump logic pass / fail jump, and finally form a complete execution flowchart for the test execution unit to schedule.

4. The method of claim 1, wherein: The signal closed loop establishment algorithm of the signal closed loop unit of the template test system for multiple models of fire alarm controllers is that the HMI controller sends test tasks to the MCU and PLC according to the template analysis result; the MCU controls the multi-line output board and the PLC expansion output board to activate the output port; the multi-line input board and the PLC expansion input board are activated synchronously to correspond to the input port; through the software and hardware linkage, the closed loop path of "output and input" is established to ensure the automatic loop of the test signal; the specific steps are: Step one, read the loop configuration; Step two, path planning; the system automatically finds the path that can realize output→input through the hardware matrix; Step three, configure MCU / PLC, according to the path to issue relay closing / opening, analog resistance selection, analog short circuit / circuit injection; Step four, automatic connectivity verification; the system automatically outputs test pulses, and detects whether it is connected through the feedback port, If not connected, an error report is generated.

5. The method of claim 1, wherein: The self-determination process of the self-determination algorithm unit of the template test system for multiple types of fire alarm controllers is: 1) The HMI controller sends a control signal; the HMI controller defines the test sequence according to the template, and sends an action signal, i.e. fire alarm, fault, supervision, sound and light, communication instruction and relay output, etc. 2) Signal acquisition and closed loop verification; collect LED, buzzer, level, relay and self-checking data signals through a closed loop channel; 3) Call the self-determination algorithm module; process the collected signals and compare them with the "expected determination conditions"; 4) Test record and exception handling; write the results into a report and record the exception results.

6. The method of claim 1, wherein: The self-determination algorithm of the self-determination algorithm unit of the template test system for multiple types of fire alarm controllers first filters the collected feedback data through the sampling data preprocessing module, extracts feature data, and then automatically compares through the self-determination algorithm. Multi-dimensional determination based on sampling results is automatically determined for each test item, specifically: 1) Timing determination; if T_resp≤T_max, the timing determination is passed and meets the requirements; if it exceeds the upper limit, it is "action timeout"; specifically: Response time meets: Decision rule: ; 2) Steady state determination; if σ≤σ_max in the steady state window, the steady state determination is passed; otherwise, the stability is poor and the determination is not passed; specifically: The sampling sequence is ; Average value in the steady state window: The formula for calculating the jitter σ is: ; Determination rule: wherein: is the stable duration; minimum steady state duration defined for the template; 3) Business consistency determination; automatically determine whether the fire alarm trigger starts the sound and light, whether the fault trigger lights up the fault light, whether the fault is automatically reset, whether the supervision state is correctly reflected, and whether the relay normally open / normal close contact point is correctly operated; specifically: Define the business logic determination function: ; Fire alarm business: ; Fault business: ; 4) Communication message determination; that is, address code, type code, state byte, data integrity, CRC check, and finally multiple results are fused to generate a single test report; specifically: For packet data , containing: address: , type: , status: , CRC check: ; Message field consistency: ; CRC check: ; Message time interval ; Total message determination: ; Check whether the address, type code and state code are consistent with the template expectations; check whether the CRC is correct; check whether the message sequence and time interval meet the communication protocol.

7. The method of claim 1, wherein: The report generation and traceability algorithm of the report generation and traceability unit of the template test system for multiple types of fire alarm controllers is to automatically generate a report after the test results are determined, i.e. test item name, port number; measured value, threshold range; determination result; execution time and operator number; The report is saved in a standard format and uploaded to the production management system, supporting batch and model traceability.

8. The method of claim 1, wherein: The use method steps of the template test system for multiple types of fire alarm controllers are: Step one, generate template file by host computer of template generation unit and import into U disk; provide through host computer software interface, can select test project, port mapping and parameter configuration, test timing and logic configuration, threshold and judgment, finally generate structured template file, JSON format or XML format; generate template file and import into U disk; Step two, generate test instruction set by HMI analysis module of template management unit; template management unit automatically loads corresponding test template file, template file contains test items, test port mapping, signal state, judgment conditions and other contents; test template is imported into HMI controller through U disk; through port mapping legality check, timing link topology check, finally generate test instruction set; Step three, the output end of signal closed loop unit automatically feeds back the input end to form a closed loop; HMI controller sends test task to MCU and PLC respectively according to template analysis result; MCU controls multi line output board and PLC expansion output board to activate output port; multi line input board and PLC expansion input board activate corresponding input port synchronously; through software and hardware linkage, establish "output and input" closed loop path, ensure that test signal automatically loops back Step four, test execution unit controls execution and collects feedback signal; HMI controller sends test instruction to MCU and PLC controller through RS485 communication interface, MCU and PLC controller execute test instruction in turn, test execution unit automatically runs each test task according to template definition to execute input simulation and monitor controller output; Step five, self judgment algorithm unit automatically analyzes, judges and compensates algorithm; the collected feedback data is first filtered through sampling data preprocessing module and feature data extraction, and then automatically compared through self judgment algorithm, so as to automatically judge each test item based on multi-dimensional judgment of sampling result; Step six, report generation and traceability unit automatically generates report and uploads; HMI controller automatically records the execution steps and judgment results of each test, generates standardized test report, and uploads to production management system, so as to realize batch traceability.