Methods and related equipment for testing the behavior of configuration components in a fire protection configuration system
By generating a test interface and using linkage attributes to test the behavior of configuration components in the fire protection configuration system, the problem of low efficiency and high cost of existing testing methods is solved, realizing efficient and low-cost testing of configuration component behavior and ensuring the correct operation of the fire protection system.
Patent Information
- Application Number
- CN202310685218.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-09
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2043-06-09
AI Technical Summary
Existing methods for testing the behavior of configuration components in fire protection configuration systems are inefficient and costly.
By acquiring the configuration configuration file of the fire protection configuration system, a test interface is generated, and test items are obtained based on the linkage attributes. The correctness of the behavior of the configuration components is tested in response to test commands. The linkage relationship between the components is displayed by using condition-triggered components and behaviors, and the consistency between the behavior of the target component and the expected results is judged.
The ability to directly test the behavior of configured components through the test interface improves testing efficiency, reduces costs, ensures the accuracy of configured components in real-world environments, and reduces the risk of errors.
Smart Images

Figure CN116832384B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of fire protection information technology, and in particular to methods and related equipment for testing the behavior of configuration components in a fire protection configuration system. Background Technology
[0002] This section is intended to provide background or context for the embodiments of the invention set forth in the claims. It should not be construed as an admission that the description herein is prior art.
[0003] In a fire protection configuration system, the configured components correspond to fire-fighting equipment, sensors, and other fire-fighting facilities in the actual fire protection system. Similarly, the component states of these configured components correspond to the equipment states generated by the fire-fighting facilities, commonly including alarm states and fault states. The component behaviors of these configured components can be the operational actions of the fire-fighting facilities in the actual fire protection system, such as water flow in pipes, or a display change in the digital world, such as a component flashing red after an alarm is triggered. To ensure the correctness of the component behaviors generated by each configured component based on its component state, current methods for testing the component behaviors of configured components require setting up a real environment and running the fire protection configuration system using real or simulated data. This testing method is inefficient and costly. Summary of the Invention
[0004] The method and related equipment for testing the behavior of configuration components in a fire protection configuration system provided in this invention at least solve the problems of low testing efficiency and high cost of existing methods for testing the behavior of configuration components.
[0005] According to one aspect of the present invention, a method for testing the behavior of configuration components in a fire protection configuration system is provided, comprising:
[0006] Obtain the configuration configuration file of the fire protection configuration system. The configuration configuration file includes component information of the configuration components. The component information includes the visualization parameters and linkage attributes of the configuration components. The linkage attributes are attributes determined according to the linkage items pre-configured for the configuration components. The linkage items include linkage conditions and linkage behaviors. The linkage conditions are one type of component state that the configuration components, acting as condition triggering components, have. The linkage behaviors are one type of component behaviors that the configuration components, acting as behavior display components, have. The condition triggering component is used to trigger the behavior display component to generate a component behavior belonging to the linkage behavior when a component state belonging to the linkage conditions is generated. The condition triggering component and the behavior display component are the same configuration component or different configuration components.
[0007] The fire protection configuration system generated based on the visualization parameters is presented on a predetermined test interface, and the linkage items of the behavior display component are obtained based on the linkage attributes. Test items for testing the behavior display component are generated on the test interface according to the linkage items. The test items include test conditions, which are conditions for testing the correctness of the component behavior generated by the behavior display component under different linkage conditions.
[0008] In response to the test command received from the test interface for the behavior display component, the correctness of the component behavior of the behavior display component is tested based on the test conditions.
[0009] In some embodiments, the test item further includes an expected test result, which is the component behavior that the behavior display component should produce under the test conditions, as determined by the linkage item. The step of testing the correctness of the component behavior of the behavior display component based on the test conditions includes:
[0010] After the corresponding condition triggering component generates a target component state based on the test conditions, the target component behavior generated by the behavior display component is determined, wherein the target component state is a component state that the condition triggering component has that belongs to the linkage condition or a component state that does not belong to the linkage condition.
[0011] Determine whether the behavior of the target component is consistent with the expected test result, so as to obtain a judgment result indicating the correctness of the component behavior of the behavior display component, and push the judgment result to the test interface.
[0012] In some embodiments, the configuration file further includes a component state modification interface configured for the condition triggering component. The component state modification interface is an interface for modifying the component state of the condition triggering component. The step of generating a target component state based on the test condition triggering the corresponding condition triggering component includes:
[0013] Based on the test conditions, the target component state that the condition triggering component needs to generate is determined, so that the component state currently generated by the condition triggering component can be modified to the target component state through the component state modification interface.
[0014] In some of these embodiments, the linkage attribute includes:
[0015] The first linkage attribute of the condition triggering component includes the identity identifier of the behavior display component that the condition triggering component needs to trigger, and the first state data of the condition triggering component, which includes state data of the component state that belongs to the linkage condition and state data of the component state that does not belong to the linkage condition.
[0016] Then, after the corresponding condition-triggered component generates the target component state based on the test conditions, the method further includes:
[0017] Based on the identity identifier, determine the behavior display component that the condition triggering component needs to trigger, and send the first state data of the target component state to the behavior display component;
[0018] By triggering the behavior display component to execute pre-configured behavior change processing logic, the behavior display component generates the target component behavior, wherein the behavior change processing logic is a processing logic configured in the behavior display component for determining the target component behavior based on the first state data.
[0019] In some embodiments, the linkage attribute further includes:
[0020] The behavior display component has a second linkage attribute, which includes behavior data of the component behavior belonging to the linkage behavior and second state data of the condition triggering component corresponding to the behavior data. The second state data is state data of the component state belonging to the linkage condition.
[0021] The steps by which the behavior display component executes the pre-configured behavior change processing logic include:
[0022] Based on the first state data and the second state data, determine whether the target component state generated by the condition triggering component is a component state belonging to the linkage condition. If so, use the behavior data corresponding to the second state data to present the component behavior belonging to the linkage behavior on the test interface.
[0023] In some embodiments, the linkage conditions of the linkage item include multiple conditions, which are generated from different condition triggering components. Each linkage condition corresponds to a linkage behavior. The multiple condition triggering components are used to combine and trigger the behavior display component to generate a component behavior belonging to one of the linkage behaviors. The linkage attribute further includes:
[0024] The trigger priority is set for the multiple linkage conditions of the linkage item, so that when the multiple condition triggering components combine to trigger the behavior display component to produce a component behavior belonging to one of the linkage behaviors, the condition triggering component that generates the linkage condition with the higher trigger priority is used to trigger the behavior display component to produce the corresponding component behavior belonging to the linkage behavior.
[0025] Then, the step of the behavior display component executing the pre-configured behavior change processing logic further includes:
[0026] Based on the first state data and the second state data of the first target condition triggering component, it is determined whether the target component state generated by the first target condition triggering component is a component state belonging to the linkage condition. If so, the component behavior belonging to the linkage behavior is presented on the test interface using the behavior data corresponding to the second state data of the first target condition triggering component. The triggering priority of the linkage condition of the first target condition triggering component is higher than the linkage conditions of other condition triggering components.
[0027] In some embodiments, the step of the behavior display component executing pre-configured behavior change processing logic further includes:
[0028] If the target component state generated by the first target condition triggering component is a component state that does not belong to the linkage condition, then, based on the first state data and the second state data of the second target condition triggering component, it is determined whether the target component state generated by the second target condition triggering component belongs to the linkage condition. If so, the component behavior belonging to the linkage behavior is presented on the test interface using the behavior data corresponding to the second state data of the second target condition triggering component, wherein the triggering priority of the linkage condition of the second target condition triggering component is lower than that of the linkage condition of the first target condition triggering component.
[0029] In some embodiments, the step of determining whether the target component state generated by the condition triggering component is a component state belonging to the linkage condition, based on the first state data and the second state data, includes:
[0030] Determine whether the first state data and the second state data are the same. If they are, the target component state generated by the condition triggering component is a component state belonging to the linkage condition.
[0031] According to another aspect of the present invention, an apparatus is provided for testing the behavior of configuration components in a fire protection configuration system, the apparatus being used to perform the method for testing the behavior of configuration components in a fire protection configuration system.
[0032] According to another aspect of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for testing the behavior of configuration components in a fire protection configuration system.
[0033] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program that, when executed by a processor, implements the method for testing the behavior of configuration components in a fire protection configuration system.
[0034] Beneficial effects of the embodiments of the present invention:
[0035] This invention presents the fire protection configuration system on the test interface and generates test items for testing the behavior of each component. The configuration components to be tested are directly tested according to the test items on the test interface. The correctness test of the behavior of each configuration component can be completed before the fire protection configuration system is submitted to the real production environment, thereby improving the production quality of configuration components, reducing the risk of errors after the fire protection configuration system is put into operation, and achieving high testing efficiency and low cost.
[0036] Details of one or more embodiments of the present invention are set forth in the following drawings and description, so that other features, objects and advantages of the invention will be more readily understood. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is a flowchart illustrating a method for testing the behavior of configuration components in a fire protection configuration system, according to an embodiment of the present invention.
[0039] Figure 2 This is a schematic diagram of a process for determining whether the behavior of a target component is consistent with the expected test results, provided in an embodiment of the present invention.
[0040] Figure 3 This is a schematic diagram of the fire protection configuration system and the test items of the corresponding configuration components generated by the test interface provided in an embodiment of the present invention.
[0041] Figure 4This is a schematic diagram illustrating the process by which a trigger behavior display component generates the behavior of a target component, according to an embodiment of the present invention.
[0042] Figure 5 This is a schematic diagram illustrating how a configuration component A generates component state 1, which triggers its component behavior a1, according to an embodiment of the present invention.
[0043] Figure 6 This is a schematic diagram illustrating how configuration component B generates component state b1, triggering configuration component A to generate component behavior a1, according to an embodiment of the present invention.
[0044] Figure 7 This is a schematic diagram illustrating how multiple linkage conditions combined trigger configuration component A to generate component behavior a1, according to an embodiment of the present invention.
[0045] Figure 8 This is a schematic diagram of a fire protection configuration system provided in an embodiment of the present invention;
[0046] Figure 9 This is a schematic diagram illustrating the configuration of linkage items for a configuration component according to an embodiment of the present invention;
[0047] Figure 10 This is a schematic diagram of the behavior change processing logic of the test tool linked to the configuration component A in an embodiment of the present invention. Detailed Implementation
[0048] Embodiments of this embodiment will now be described in more detail with reference to the accompanying drawings. While some embodiments of this embodiment are shown in the drawings, it should be understood that this embodiment can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this embodiment. It should be understood that the accompanying drawings and embodiments are for illustrative purposes only and are not intended to limit the scope of protection of this embodiment.
[0049] First, some nouns or terms that appear in the description of the embodiments of the present invention shall be interpreted as follows:
[0050] Configuration: The process of using tools and methods provided in application software to complete a specific task in a project.
[0051] Component status: The configuration components in the fire protection configuration system correspond to fire protection equipment, sensors and other fire protection facilities in the real world. The component status of the configuration components corresponds to the equipment status generated by the fire protection facilities. Common equipment statuses include alarm status and fault status.
[0052] Component behavior: Component behavior can be the operation of fire protection facilities in the real world, such as the flow of water in water pipes; or it can be a display change in the digital world, such as the component flashing red after an alarm is triggered.
[0053] Behavior display component: This term is defined to facilitate the differentiation and understanding of different configuration components. As an instruction receiver, the behavior display component can perform a certain action or undergo a certain display change after receiving a linkage trigger instruction. That is, the configuration component that generates the behavior of the component belonging to linkage behavior mentioned below.
[0054] Condition-triggered component: A term defined to distinguish it from behavior display component. A condition-triggered component is a configuration component that acts as an instruction issuer and triggers the behavior display component to generate a running action by issuing a certain instruction.
[0055] Linkage item: The linkage conditions and linkage behaviors configured when configuring linkage relationships for configuration components. Each linkage item configures the relationship between the component state generated by the condition-triggered component and the component behavior generated by the behavior display component.
[0056] Test items: These are semantic representations generated after the configured linkage items are parsed by the testing tool and various test scenarios are traversed. The testing tool can then perform automated testing based on these test items.
[0057] To address the problems of low testing efficiency and high cost in existing testing methods for the behavior of configured components in fire protection configuration systems, the first embodiment of this invention provides a method for testing the behavior of configured components in a fire protection configuration system. This method involves importing the configuration file of the fire protection configuration system into a testing tool, which then performs the testing. Figure 1 As shown, the method includes the following steps:
[0058] Step S11: Obtain the configuration configuration file of the fire protection configuration system. The configuration configuration file includes component information of the configuration components. The component information includes the visualization parameters and linkage attributes of the configuration components. The linkage attributes are determined according to the linkage items pre-configured for the configuration components. The linkage items include linkage conditions and linkage behaviors. The linkage condition is one of the component states that the configuration component, acting as a condition triggering component, has. The linkage behavior is one of the component behaviors that the configuration component, acting as a behavior display component, has. The condition triggering component is used to trigger the behavior display component to produce the component behavior that belongs to the linkage behavior when a component state belonging to the linkage condition is generated. The condition triggering component and the behavior display component can be the same configuration component or different configuration components. For example, configuration component A has component state a1 and component state a2, and component behavior a1. Configuration component B has component state b1 and component state b2. The linkage condition is as follows: if configuration component B has component state b1, when configuration component B generates component state b1, it triggers configuration component A to generate component behavior a1. In this case, configuration component B is the condition triggering component, and configuration component A is the behavior display component. When the component state a1 of configuration component A is a linkage condition, setting the component state a1 of configuration component A triggers configuration component A to generate component behavior a1. At this time, configuration component A is both a condition triggering component and a behavior display component.
[0059] Step S12: Present the fire protection configuration system generated based on visualization parameters on a predetermined test interface, and obtain the linkage items of the behavior display component based on the linkage attributes. Generate test items on the test interface based on these linkage items to test the behavior display component. The test items include test conditions, which are conditions used to test the correctness of the component behavior generated by the behavior display component under different linkage conditions. For example, if the test condition is that configuration component B generates component state b1, test whether the component behavior generated by the behavior display component after being triggered by component state b1 is the predetermined component behavior.
[0060] Step S13: In response to the test instructions received from the test interface for the behavior display component, test the correctness of the component behavior of the behavior display component based on the test conditions.
[0061] This invention presents the fire protection configuration system on the test interface and generates test items for testing the behavior of each component. The configuration components to be tested are directly tested according to the test items on the test interface. The correctness of the behavior of each configuration component can be tested before the fire protection configuration system is submitted to the real production environment, thereby improving the production quality of configuration components and reducing the risk of errors after the fire protection configuration system is put into operation. It does not require building a real environment or using real test data or simulated data for testing, and has high testing efficiency and low cost.
[0062] To further improve testing efficiency and the intuitiveness of test results, the test items in this embodiment of the invention also include expected test results. The expected test results are the component behaviors that the behavior display component needs to produce under test conditions, as determined by the linkage item. For example, if the linkage condition included in the linkage item is that configuration component B generates component state b1, and the linkage behavior triggered by this linkage condition is component behavior a1 of configuration component A, then the expected test result is that configuration component A generates component behavior a1. Figure 2 As shown, step S13, which tests the correctness of the component behavior based on test conditions, includes:
[0063] Step S21: After the corresponding condition triggering component generates the target component state based on the test conditions, determine the target component behavior generated by the behavior display component. The target component state is either a component state belonging to the linkage condition or a component state not belonging to the linkage condition that the condition triggering component has.
[0064] Step S22: Determine whether the target component behavior is consistent with the expected test results, so as to obtain the judgment result used to indicate the correctness of the component behavior of the behavior display component, and push the judgment result to the test interface.
[0065] Therefore, as Figure 3 As shown, this embodiment of the invention can sequentially test the correctness of the target component behavior generated by the behavior display component under each test condition according to the generated test conditions, and push the correctness judgment results obtained from the test to the test interface to intuitively inform the testers. The testers can then know whether the component behavior of the behavior display component under the corresponding test conditions meets the expected test results, thereby determining whether it is necessary to correct the component behavior generated by the behavior display component under the corresponding linkage conditions. The testing efficiency is high, the cost is low, there is no need for manual observation to obtain test results at all times, and the user experience is excellent.
[0066] The configuration file in this embodiment of the invention also includes a component state modification interface configured for the condition-triggered component. This interface is used to modify the component state of the condition-triggered component. The step of triggering the corresponding condition-triggered component to generate a target component state based on test conditions includes: determining the target component state that the condition-triggered component needs to generate based on the test conditions, and then modifying the currently generated component state of the condition-triggered component to the target component state through the component state modification interface. Therefore, this embodiment of the invention can adjust the component state that the corresponding condition-triggered component should generate during the test according to the test conditions through the component state modification interface, thereby testing whether the component behavior generated by the relevant behavior demonstration component under the triggering of this component state meets the expected test results. This results in high testing efficiency and significantly reduces the workload of developers and / or testers.
[0067] The linkage attributes in this embodiment of the invention include: a first linkage attribute of the condition-triggered component, which includes the identity identifier (e.g., ID identifier) of the behavior display component to be triggered by the condition-triggered component, and first state data of the condition-triggered component. The first state data includes state data of the component state belonging to the linkage condition and state data of the component state not belonging to the linkage condition. For example, the first linkage attribute of configuration component B includes the identity identifier of configuration component A, and first state data used to indicate component state b1 and / or component state b2, etc. Figure 4 As shown, after step S21 triggers the corresponding condition-triggered component to generate the target component state based on the test conditions, the method provided in this embodiment of the invention further includes:
[0068] Step S31: Based on the identity identifier, determine the behavior display component that the condition triggering component needs to trigger, so as to send the first state data of the target component to the behavior display component.
[0069] Step S32: By triggering the behavior display component to execute pre-configured behavior change processing logic, the behavior display component generates the target component behavior. The behavior change processing logic is a processing logic configured in the behavior display component for determining the target component behavior based on the first state data. Therefore, this embodiment of the invention integrates the behavior change processing logic within the behavior display component. After the condition triggering component generates the target component state, it sends the first state data of the target component state to the behavior display component, and the behavior change processing logic of the behavior display component can then determine the target component behavior based on the first state data.
[0070] For example, when the component state of configuration component B, which is a condition triggering component, changes, the method provided in this embodiment of the invention will identify the configuration component A that needs to be linked based on the linkage attribute, send the first state data of the component state of configuration component B to configuration component A for caching, call and trigger the behavior change processing logic of configuration component A to determine and render the component behavior style generated by configuration component A.
[0071] The linkage attribute in this embodiment of the invention further includes: a second linkage attribute of the behavior display component. The second linkage attribute includes behavior data of the component behavior belonging to the linkage behavior and second state data of the condition triggering component corresponding to the behavior data. The second state data is the state data of the component state belonging to the linkage condition. For example, the second linkage attribute of the configuration component A, which is a behavior display component, includes behavior data of component behavior a1 and second state data of component state b1, etc. In step S32, the step of the behavior display component executing the pre-configured behavior change processing logic includes: judging whether the target component state generated by the condition triggering component belongs to the linkage condition based on the first state data and the second state data. If so, the behavior belonging to the linkage behavior is presented on the test interface using the behavior data corresponding to the second state data. That is, the behavior change processing logic renders the style of the component behavior based on the final component state judgment result. The test of the correctness of the component behavior of the configuration component A can be completed without using real data, which is efficient and low-cost. In this embodiment of the invention, the step of determining whether the target component state generated by the condition-triggered component is a component state belonging to the linkage condition based on the first state data and the second state data includes: determining whether the first state data and the second state data are the same; if so, the target component state generated by the condition-triggered component is a component state belonging to the linkage condition. The behavior change processing logic of the behavior display component automatically determines the current component state of the condition-triggered component based on the state data sent by the condition-triggered component, and then determines which component behavior the rendering behavior display component will generate based on the state judgment result. After the behavior display component is triggered to generate the corresponding target component behavior, it determines whether the target component behavior meets the expected test results by identifying the behavior style of the target component behavior, and finally pushes the judgment result describing the compliance situation to the test interface for display to relevant personnel. This results in high testing efficiency and reduces the testing workload of relevant personnel.
[0072] In this embodiment of the invention, since the operation of fire-fighting facilities in real fire-fighting scenarios may be triggered by a combination of two corresponding devices, such as configuration component B generating component state b1 and configuration component C generating component state c1, which together trigger configuration component A to generate component behavior a1, but configuration component B generating component state b1 alone triggers configuration component A to generate component behavior a1, and configuration component C generating component state c1 alone triggers configuration component A to generate component behavior a2, in the case of combined triggering, the linkage conditions of the linkage item include multiple linkage conditions, which are generated from different condition triggering components (such as the aforementioned component state b1 and component state c1, which come from configuration component B and configuration component C respectively), and one linkage condition corresponds to one linkage behavior (such as the component state b1 generated by configuration component B corresponding to the component behavior a1 generated by configuration component A). Multiple condition triggering components are used to combine triggering behaviors to show the component generating a component behavior belonging to one of the linkage behaviors.
[0073] To test the correctness of the component behavior generated by the behavior display component under combined triggering conditions, the linkage attribute in this embodiment of the invention further includes: setting trigger priorities for multiple linkage conditions of a linkage item, so that when multiple condition triggering components combine to trigger the behavior display component to generate a component behavior belonging to one of the linkage behaviors, the condition triggering component that generates the linkage condition with the higher trigger priority triggers the behavior display component to generate the corresponding component behavior belonging to the linkage behavior. For example, if the trigger priority of the linkage condition that configuration component B generates component state b1 is higher than the trigger priority of the linkage condition that configuration component C generates component state c1, then when configuration component B generates component state b1 and configuration component C generates component state c1, the component state b1 generated by configuration component B triggers configuration component A to generate component behavior a1. The steps for the behavior display component to execute pre-configured behavior change processing logic further include: determining whether the target component state generated by the first target condition triggering component is a component state belonging to a linkage condition based on the first and second state data of the first target condition triggering component; if so, presenting the component behavior belonging to the linkage behavior on the test interface using the behavior data corresponding to the second state data of the first target condition triggering component, wherein the triggering priority of the linkage condition of the first target condition triggering component is higher than the linkage condition of other condition triggering components. Therefore, this embodiment of the invention can test the correctness of component behavior generated by a behavior display component triggered by multiple component state combinations, quickly configure linkage items consisting of multiple linkage conditions and linkage behaviors for the behavior display component, identify the linkage items of the behavior display component by reading and analyzing the linkage attributes of relevant configured components, and then semantically convert the linkage items into test conditions and expected test results intuitively displayed on the test interface. Finally, it automatically identifies whether the component behavior generated by the behavior display component meets the expected test results, greatly improving testing efficiency.
[0074] Furthermore, the step of the behavior display component executing the pre-configured behavior change processing logic also includes: if the target component state generated by the first target condition triggering component is a component state that does not belong to the linkage condition, then, based on the first and second state data of the second target condition triggering component, it is determined whether the target component state generated by the second target condition triggering component belongs to the linkage condition. If so, the component behavior belonging to the linkage behavior is presented on the test interface using the behavior data corresponding to the second state data of the second target condition triggering component. The triggering priority of the linkage condition of the second target condition triggering component is lower than that of the linkage condition of the first target condition triggering component. That is, in the case of combined triggering, when the component state generated by the condition triggering component with higher triggering priority does not belong to the set linkage condition, the condition triggering component with lower triggering priority that generated the linkage condition triggers the behavior display component to generate the corresponding component behavior; otherwise, the behavior display component generates the default component behavior. If the behavior change processing logic determines that the configuration component B with higher trigger priority is not in component state b1, then it determines whether the configuration component C is in component state c1 that belongs to the linkage condition. If so, the configuration component A, which is the behavior display component, is rendered to generate component behavior a2. If the configuration component C is not in component state c1, the configuration component A is rendered to generate the default component behavior style, which improves testing efficiency.
[0075] As can be seen from the above, the embodiments of the present invention can test the component behavior of the fire protection configuration system before submitting the developed fire protection configuration system to the real production environment. This ensures that each configuration component produces the correct component behavior under various linkage conditions. Test-related behavior change processing logic is integrated within the configuration component, and each configuration component exposes its test capabilities. After the fire protection configuration system is drawn, the correctness of the component behavior can be tested using testing tools. This advances the testing process, reduces the risk of errors after the configuration system goes live, and saves costs. The embodiments of the present invention can test the correctness of component behavior generated by multiple component state combinations triggering behavior display components. It can quickly configure linkage items consisting of multiple linkage conditions and linkage behaviors for behavior display components. By reading and analyzing the linkage attributes of relevant configuration components, the linkage items of the behavior display components are identified. Then, the linkage items are semantically converted into test conditions and expected test results that are intuitively displayed on the test interface. Finally, it automatically identifies whether the component behavior generated by the behavior display component meets the expected test results, greatly improving testing efficiency.
[0076] The second embodiment of the present invention also provides an apparatus for testing the behavior of configuration components in a fire protection configuration system. The apparatus is used to perform a method for testing the behavior of configuration components in a fire protection configuration system. For details of the method for testing the behavior of configuration components in a fire protection configuration system, please refer to the content provided in the first embodiment of the present invention. The embodiments of the present invention will not be repeated here.
[0077] The third embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements a method for testing the behavior of configuration components in a fire protection configuration system. For details of the method for testing the behavior of configuration components in a fire protection configuration system, please refer to the content provided in the first embodiment of the present invention. The embodiments of the present invention will not be described again here.
[0078] The fourth embodiment of the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements a method for testing the behavior of configuration components in a fire protection configuration system. For details of the method for testing the behavior of configuration components in a fire protection configuration system, please refer to the content provided in the first embodiment of the present invention. The embodiments of the present invention will not be described again here.
[0079] The fifth embodiment of the present invention also provides a computer program product, including a computer program, wherein the computer program, when executed by the processor of a computer, is used to cause the computer to perform a method for testing the behavior of configuration components in a fire protection configuration system. For details of the method for testing the behavior of configuration components in a fire protection configuration system, please refer to the content provided in the first embodiment of the present invention, and the embodiments of the present invention will not be repeated here.
[0080] The sixth embodiment of the present invention, based on the above four embodiments, provides a specific application embodiment of the method for testing the behavior of configuration components in a fire protection configuration system.
[0081] The application embodiment provided by this invention, after the fire protection configuration system is developed and before it is submitted to the real production environment, tests the operational status of the component behavior of each configuration component. Since the sources of the linkage conditions triggering the operation of each configuration component can be varied, a linkage model needs to be defined to establish the linkage triggering relationship between component states and component behaviors under various linkage conditions. This model is described using a programming language to test whether the component behavior generated by the configuration component under a certain linkage condition is normal. Specifically, the sources of the defined linkage conditions include:
[0082] Source 1: A certain component state of the configuration component itself serves as a linkage condition. In this case, the configuration component is both a behavior display component and a condition triggering component. For example... Figure 5The configuration component A shown here generates component state 1, which triggers its component behavior a1. At this time, configuration component A is both a behavior display component and a condition triggering component.
[0083] Source 2: The behavior display component is triggered by a certain component state as a linkage condition. For example... Figure 6 As shown, configuration component B, acting as a condition triggering component, generates component state b1, which triggers configuration component A to generate component behavior a1. Component state b1 generated by configuration component B is a linkage condition.
[0084] Source 3: A combination of a certain component state of configuration component B associated with the behavior display component and a certain component state of configuration component C associated with the behavior display component. This combination can involve multiple conditions triggering components to generate component states. For example... Figure 7 The configuration components B and C shown together trigger configuration component A to generate component behavior a1. The relationship between the component state and component behavior, which serve as the linkage condition, can be a many-to-many association.
[0085] After determining the linkage model of configuration components, component states, and component behaviors, the main execution flow of the application embodiment is described in detail below.
[0086] Step 11: Draw the fire protection configuration system:
[0087] like Figure 8 As shown, during the drawing process, configuration components are created according to the component template specifications, and the status data of the component state, the behavior data of the component behavior, the identification (such as Internet Protocol Address, or ID), the linkage resolution rules, and the component state modification interface are defined. Configuration components are retrieved from the configuration component library using a configuration drawing tool, and then combined and drawn using the tool to obtain a fire protection configuration system simulating the actual fire protection system. The drawn component information is saved in the configuration configuration file. The configuration configuration file includes the visualization parameters of the configuration components, the default component state, the default component behavior, and the component state modification interface. The visualization parameters include the location, size, and display style of the configuration component in the fire protection configuration system.
[0088] Step 12: Configure the linkage items of the configuration component:
[0089] like Figure 9As shown, when configuring configuration component A as the behavior display component for linkage item configuration, the configuration interface of the fire protection configuration system displays a linkage configuration interface for configuring the linkage items of configuration component A. The configured linkage items include linkage conditions and linkage behaviors. Specifically, when adding a linkage item, the component state of the condition triggering component is selected, and the correct component behavior that configuration component A should produce under this component state is selected. For example, configuration component B generates component state b1, triggering configuration component A to produce component behavior a1. Configuration component C generates component state c1, triggering configuration component A to produce component behavior a2. Configuration component B generates component state b1 and configuration component C generates component state c1, jointly triggering configuration component A to produce component behavior a1. Each linkage item can have multiple linkage conditions and linkage behaviors added, and the trigger priority of each linkage condition can be adjusted by dragging. The trigger priority is used when multiple condition triggering components combine to trigger the behavior display component to produce a component behavior belonging to one of the linkage behaviors. The condition triggering component that generates the linkage condition with the higher trigger priority will trigger the behavior display component to produce the corresponding component behavior belonging to the linkage behavior.
[0090] Multiple linkage items are parsed, and the component attributes of configuration component A are located in the configuration file. Linkage attributes are added to these attributes, specifically including: the identifier of the condition-triggered component, the status data of the condition-triggered component, and the behavior data of the behavior-displaying component. Similarly, the component attributes of configuration components B and C are located in the configuration file, and linkage attributes for both components are added. For example, the linkage attributes for configuration component B include: the identifier of configuration component A and the status data of configuration component B itself. Finally, a configuration file containing the linkage attributes can be exported for testing the component behavior of the configuration components.
[0091] Step 13: Import the configuration configuration file into the testing tool. Generate test items for each configuration component in the testing interface of the testing tool. The test items include test conditions and expected test results.
[0092] 31) Import the configuration file obtained in step 2 into the configuration test tool.
[0093] 32) The test program of the test tool parses the configuration configuration file and renders its contents, presenting the fire protection configuration system generated based on the visualization parameters on the test interface and putting the fire protection configuration system into its initial running state. At this time, the configuration components have loaded their respective component attributes, which include linkage attributes, into the designated memory.
[0094] 33) Update the initial component states of configuration component B and configuration component C, which are condition triggering components, to configuration component A, and cache the initial component states by the entry program of configuration component A.
[0095] 34) The testing tool parses the configuration configuration file, obtains the linkage attributes of configuration component A, and identifies and extracts the associated items configured for configuration component A.
[0096] 35) Group multiple related items according to their trigger priority. After the testing tool's test program traverses various trigger conditions, the related items are semantically transformed and displayed in a semantic manner. Taking the example scenario, after semantically transforming two related items, four test items are generated. Each test item includes the test condition and the expected test result, as shown in Figure 3:
[0097] Test condition 1: When configuration component B generates component state b1 and configuration component C generates component state c1, the expected test result is: triggering component behavior a1.
[0098] Test condition 2: When configuration component B generates component state b1 and configuration component C generates non-component state c1, the expected test result is: triggering component behavior a1.
[0099] Test condition 3: When configuration component B generates a non-component state b1 and configuration component C generates a component state c1, the expected test result is: triggering component behavior a2.
[0100] Test condition 4: When configuration component B generates non-component state b1 and configuration component C generates non-component state c1, the expected test result is: maintain the default component behavior.
[0101] Step 14: The testing tool simulates the above test conditions and automatically verifies the expected test results:
[0102] like Figure 3 As shown. After the user triggers configuration component A to perform a test on configuration component A, the testing tool executes the test conditions sequentially according to the trigger priority combination. It simulates triggering configuration components B and C based on the component states that should occur under each test condition. When the corresponding test condition is triggered for a predetermined duration (e.g., 5 seconds), the testing tool's test program extracts key information about the behavior style displayed by configuration component A on the test interface. It compares the determined behavior style with the expected test results to determine whether the component behavior of configuration component A serves the expected test results. This process is repeated sequentially until all test items are completed.
[0103] like Figure 10As shown, the specific test process of this embodiment of the invention, taking the test process of a single test item as an example, is as follows: The test tool calls the component state modification interface in the configuration component, and modifies the component states of configuration component B and configuration component C according to the corresponding test conditions through the component state modification interface. It also links and executes the behavior change processing logic of configuration component A to re-render the behavior style of configuration component A in real time. The test tool identifies and analyzes the behavior style of configuration component A to determine whether the component behavior of configuration component A meets the expected test results, and finally displays the compliance status on the test interface for relevant personnel to refer to. Specifically, when linking the behavior change processing logic of configuration component A, after the states of configuration component B and configuration component C change, the test tool identifies the configuration component A that needs to be linked based on the linkage attributes of each condition-triggered component in memory, and calls the entry program of configuration component A to cache the state data of condition-triggered components. The entry program caches the state data of condition-triggered components, triggers the call to the behavior change processing logic, and finally renders the behavior style based on the processing result of the behavior change processing logic.
[0104] To make the embodiments of the present invention clearer, the embodiments of the present invention take a fire water system as an example to illustrate the testing process of the component behavior of the configuration components of the fire water system using testing tools.
[0105] Step 21: Draw a simple fire water system configuration diagram:
[0106] The configuration component A drawn in the fire protection water system is used as the behavior display component, representing the fire water pipe. Assuming the fire water pipe is placed horizontally, the component behavior of the fire water pipe is defined as follows: Component behavior a1: flow to the left, component behavior a2: flow to the right, component behavior a3: stationary, initial behavior: stationary.
[0107] In the fire protection water system, configuration component B is drawn as a "condition-triggered component," representing the fire sprinkler terminal. It has two component states, defined as follows: Component state b1: Alarm, indicating a fire alarm has occurred. When an alarm is triggered, the sprinkler terminal sprays water, and water flows towards the terminal in the fire hose. Component state b2: Normal, indicating normal operation; the fire hose flow is still.
[0108] In the fire protection water system, configuration component C, as a condition-triggered component, represents the water pressure gauge. Configuration component C has two states based on the water pressure gauge's operating status: Component state c1: Alarm, indicating undervoltage. When undervoltage occurs, the pressure-stabilizing pump supplies water, and the fire water pipes flow. Component state c2: Normal, indicating normal operation; the fire water pipes are stationary.
[0109] Step 2, configure linkage items for configuration component A:
[0110] Linkage Item 1: When the water pressure gauge triggers a low-pressure alarm, it causes the fire hydrant to flow to the left, thus triggering component behavior a1. Linkage Item 2: When the sprinkler terminal triggers a fire alarm, it causes the fire hydrant to flow to the left, thus triggering component behavior a1.
[0111] Step 23: Perform semantic transformation on the related items to generate test items:
[0112] Test Item 1: The water pressure gauge alarms for low pressure and the sprinkler terminal alarms for fire (Test Condition 1), and the water flow in the fire hose flows to the left (Expected Test Result 1);
[0113] Test Item 2: The water pressure gauge alarms for low pressure and the sprinkler terminal is functioning normally (Test Condition 2), and the water flow in the fire hose flows to the left (Expected Test Result 2);
[0114] Test Item 3: The water pressure gauge is normal and the fire alarm at the sprinkler terminal occurs (Test Condition 3), and the water flow in the fire hose flows to the left (Expected Test Result 3);
[0115] Test item 4: The water pressure gauge and the sprinkler terminal are normal (test condition 4), and the fire water pipe enters the initial static behavior (expected test result 4);
[0116] Step 24: Test each test item and automatically verify whether the component behavior generated by configuration component A meets the expected test results, thereby determining the correctness of the component behavior of configuration component A.
[0117] In summary, this invention enables testing of the behavior of configuration components in a fire protection configuration system before submitting the developed system to a real production environment. This ensures that each component produces the correct behavior under various linkage conditions. Test-related behavior change processing logic is integrated within the configuration components, and each component exposes its testing capabilities. After the fire protection configuration system is completed, the correctness of the component behavior can be tested using testing tools. This advances the testing process, reduces the risk of errors after the configuration system goes live, and saves costs. This invention can test the correctness of component behavior generated by multiple component state combinations. It can quickly configure linkage items consisting of multiple linkage conditions and linkage behaviors for behavior display components. By reading and analyzing the linkage attributes of relevant configuration components, the linkage items of the behavior display components are identified. These linkage items are then semantically converted into test conditions and expected test results displayed intuitively on the test interface. Finally, the invention automatically identifies whether the component behavior generated by the behavior display components meets the expected test results, greatly improving testing efficiency.
[0118] Computer programs for implementing the methods of embodiments of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0119] In the context of embodiments of the present invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable signal medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or other systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0120] It should be noted that the term "comprising" and its variations used in the embodiments of the present invention are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The modifications of "one" and "multiple" mentioned in the embodiments of the present invention are illustrative and not restrictive. Those skilled in the art should understand that, unless explicitly indicated otherwise in the context, they should be understood as "one or more".
[0121] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present invention are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0122] The steps described in the method embodiments provided by this invention can be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of protection of this invention is not limited in this respect.
[0123] The term "embodiment" in this specification refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of the invention. The appearance of this phrase in various places in the specification does not necessarily imply the same embodiment, nor does it imply independence or alternativeity from other embodiments. The various embodiments in this specification are described in a related manner, with reference to each other for similar or identical parts. In particular, for apparatus, device, and system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, and relevant details are referred to in the description of the method embodiments.
[0124] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of protection of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.
Claims
1. A method for testing the behavior of configuration components in a fire protection configuration system, characterized in that, The method is executed through a testing tool, and the method includes: Obtain the configuration configuration file of the fire protection configuration system. The configuration configuration file includes component information of the configuration components. The component information includes the visualization parameters and linkage attributes of the configuration components. The linkage attributes are attributes determined according to the linkage items pre-configured for the configuration components. The linkage items include linkage conditions and linkage behaviors. The linkage conditions are one type of component state that the configuration components, acting as condition triggering components, have. The linkage behaviors are one type of component behaviors that the configuration components, acting as behavior display components, have. The condition triggering component is used to trigger the behavior display component to generate a component behavior belonging to the linkage behavior when a component state belonging to the linkage conditions is generated. The condition triggering component and the behavior display component are the same configuration component or different configuration components. The fire protection configuration system generated based on the visualization parameters is presented on a predetermined test interface, and the linkage items of the behavior display component are obtained based on the linkage attributes. Test items for testing the behavior display component are generated on the test interface according to the linkage items. The test items include test conditions, which are conditions for testing the correctness of the component behavior generated by the behavior display component under different linkage conditions. In response to the test command received by the test interface for the behavior display component, the correctness of the component behavior of the behavior display component is tested based on the test conditions; The test item also includes the expected test result, which is the component behavior that the behavior display component needs to produce under the test conditions, as determined by the linkage item. The steps for testing the correctness of the component behavior of the behavior display component based on the test conditions include: After the corresponding condition triggering component generates the target component state based on the test conditions, the target component behavior generated by the behavior display component is determined, wherein the target component state is a component state that the condition triggering component has that belongs to the linkage condition or a component state that does not belong to the linkage condition. Determine whether the behavior of the target component is consistent with the expected test result, so as to obtain a judgment result indicating the correctness of the component behavior of the behavior display component, and push the judgment result to the test interface.
2. The method for testing the behavior of configuration components in a fire protection configuration system according to claim 1, characterized in that, The configuration file also includes a component state modification interface configured for the condition triggering component. The component state modification interface is an interface used to modify the component state of the condition triggering component. The step of generating a target component state based on the test condition triggering the corresponding condition triggering component includes: Based on the test conditions, the target component state that the condition triggering component needs to generate is determined, so that the component state currently generated by the condition triggering component can be modified to the target component state through the component state modification interface.
3. The method for testing the behavior of configuration components in a fire protection configuration system according to claim 1 or 2, characterized in that, The linkage attributes include: The first linkage attribute of the condition triggering component includes the identity identifier of the behavior display component that the condition triggering component needs to trigger, and the first state data of the condition triggering component, which includes state data of the component state that belongs to the linkage condition and state data of the component state that does not belong to the linkage condition. Then, after the corresponding condition-triggered component generates the target component state based on the test conditions, the method further includes: Based on the identity identifier, determine the behavior display component that the condition triggering component needs to trigger, and send the first state data of the target component state to the behavior display component; By triggering the behavior display component to execute pre-configured behavior change processing logic, the behavior display component generates the target component behavior, wherein the behavior change processing logic is a processing logic configured in the behavior display component for determining the target component behavior based on the first state data.
4. The method for testing the behavior of configuration components in a fire protection configuration system according to claim 3, characterized in that, The linkage attribute also includes: The behavior display component has a second linkage attribute, which includes behavior data of the component behavior belonging to the linkage behavior and second state data of the condition triggering component corresponding to the behavior data. The second state data is state data of the component state belonging to the linkage condition. The steps by which the behavior display component executes the pre-configured behavior change processing logic include: Based on the first state data and the second state data, determine whether the target component state generated by the condition triggering component is a component state belonging to the linkage condition. If so, use the behavior data corresponding to the second state data to present the component behavior belonging to the linkage behavior on the test interface.
5. The method for testing the behavior of configuration components in a fire protection configuration system according to claim 4, characterized in that, The linkage conditions of the linkage item include multiple conditions, which are generated from different condition triggering components. Each linkage condition corresponds to a linkage behavior. The multiple condition triggering components are used to combine and trigger the behavior display component to generate a component behavior belonging to one of the linkage behaviors. The linkage attribute also includes: The trigger priority is set for the multiple linkage conditions of the linkage item, so that when the multiple condition triggering components combine to trigger the behavior display component to produce a component behavior belonging to one of the linkage behaviors, the condition triggering component that generates the linkage condition with the higher trigger priority is used to trigger the behavior display component to produce the corresponding component behavior belonging to the linkage behavior. Then, the step of the behavior display component executing the pre-configured behavior change processing logic further includes: Based on the first state data and the second state data of the first target condition triggering component, it is determined whether the target component state generated by the first target condition triggering component is a component state belonging to the linkage condition. If so, the component behavior belonging to the linkage behavior is presented on the test interface using the behavior data corresponding to the second state data of the first target condition triggering component. The triggering priority of the linkage condition of the first target condition triggering component is higher than the linkage conditions of other condition triggering components.
6. The method for testing the behavior of configuration components in a fire protection configuration system according to claim 5, characterized in that, The steps for the behavior display component to execute pre-configured behavior change processing logic also include: If the target component state generated by the first target condition triggering component is a component state that does not belong to the linkage condition, then, based on the first state data and the second state data of the second target condition triggering component, it is determined whether the target component state generated by the second target condition triggering component belongs to the linkage condition. If so, the component behavior belonging to the linkage behavior is presented on the test interface using the behavior data corresponding to the second state data of the second target condition triggering component, wherein the triggering priority of the linkage condition of the second target condition triggering component is lower than that of the linkage condition of the first target condition triggering component.
7. The method for testing the behavior of configuration components in a fire protection configuration system according to claim 4, characterized in that, The step of determining whether the target component state generated by the condition triggering component is a component state belonging to the linkage condition, based on the first state data and the second state data, includes: Determine whether the first state data and the second state data are the same. If they are, the target component state generated by the condition triggering component is a component state belonging to the linkage condition.
8. A device for testing the behavior of configuration components in a fire protection configuration system, characterized in that, The apparatus is used to perform the method for testing the behavior of configuration components in a fire protection configuration system as described in any one of claims 1 to 7.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Test method for testing performance of high-flow compressed air foam system
CN115876506A
Integrated test-mode for monitoring of fire and security system networks
US20120229269A1