Generation method and device of unit alarm simulation model, equipment and storage medium

The automated method for generating aircraft crew alerting simulation models using regular expressions and MATLAB functions addresses the inefficiencies and errors of traditional modeling, resulting in improved efficiency and quality of simulation models.

CN120296878APending Publication Date: 2025-07-11BEIJING AERONAUTIC SCI & TECH RES INST OF COMAC +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510407658.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-02
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

The traditional modeling method of unit alarm system has problems such as large workload, error prone, and irregular modeling, which leads to integration difficulties. Especially when dealing with complex unit alarm logic, it is difficult to efficiently generate accurate simulation models.

Method used

By obtaining the unit alarm definition file, parsing and identifying variable names, logical expressions and member functions in the alarm message logical expression, using regular expressions for normalization checks and replacement, adding them to the state machine of the preset simulation model architecture, and automatically layout and state machine design based on the MATLAB syntax specification to generate the unit alarm simulation model.

Benefits of technology

Fully automatic batch modeling of unit alarm simulation models is realized, modeling efficiency is improved, labor cost investment is reduced, and the quality and accuracy of the model is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120296878A_ABST
    Figure CN120296878A_ABST
Patent Text Reader

Abstract

The invention provides a generation method and device of a unit alarm simulation model, equipment and a storage medium, relates to the technical field of modeling and simulation, and aims at improving the modeling efficiency and accuracy of the unit alarm simulation model. The method mainly comprises the following steps: acquiring a unit alarm definition file, wherein the unit alarm definition file comprises an alarm message number, an alarm message logic expression and an alarm message text; analyzing the unit alarm definition file to obtain the alarm message logic expression, and identifying a variable name, an alarm logic expression and a member function in the alarm message logic expression based on a regular expression; adding the variable name, the alarm logic expression and the member function to a corresponding state machine in a preset simulation model architecture; and obtaining a unit alarm simulation model by setting a parameter type and a parameter initial value corresponding to the variable name in a state machine in the preset simulation model architecture and an alarm result output by the state machine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of modeling and simulation technologies, and particularly to a method, device, equipment, and storage medium for generating a crew alert simulation model. Background Art

[0002] An aircraft crew alert system (hereinafter referred to as the crew alert system) is a device used to attract the attention of the crew or notify the crew of an abnormal operation or aircraft system state. The crew alert system needs to receive the working state signals of the aircraft's on-board systems sent by the avionics system, and after certain logical processing, remind the pilot to handle immediately or attract the pilot's attention through sound, light, electricity, etc.

[0003] During the aircraft development process, conducting the design and analysis of the crew alert system through simulation means can reduce errors in the design phase, avoid a large number of modifications in the later stage of design, and effectively improve the development efficiency of the system. Therefore, it is necessary to model the crew alert system through various modeling languages (such as C / C++, Java, MATLAB / Simulink, SysML, Modelica, etc.), and integrate the model into a full-digital or semi-physical simulation environment to verify the working logic of the crew alert system.

[0004] The traditional modeling method is to manually analyze the logic of the crew alert system item by item, and then convert the alert logic into a simulation model in the modeling software. Since the crew alert system needs to synthesize the fault or status signals of more than 30 systems of the whole aircraft, with a large amount of signals and complex alert logic, there are problems such as large workload, easy errors, and difficult integration due to non-standard modeling during manual modeling. Summary of the Invention

[0005] Embodiments of this application provide a method, device, computer equipment, and storage medium for generating a crew alert simulation model, which are used to improve the modeling efficiency and accuracy of the crew alert simulation model.

[0006] Embodiments of the present invention provide a method for generating a crew alert simulation model, and the method includes:

[0007] Obtain a crew alert definition file, where the crew alert definition file includes: an alert message number, an alert message logical expression, and an alert message text;

[0008] Parse the crew alert definition file to obtain the alert message logical expression, and identify the variable name, alert logical expression, and member function in the alert message logical expression based on a regular expression;

[0009] Add the variable name, the alert logical expression, and the member function to the corresponding state machine in the preset simulation model architecture;

[0010] An alarm simulation model for the unit is obtained by setting the parameter types, parameter initial values corresponding to the variable names in the state machine in the preset simulation model architecture, and the alarm results output by the state machine.

[0011] In an optional embodiment, after identifying the variable names, alarm logic expressions, and member functions in the alarm message logic expression based on regular expressions, the method further includes:

[0012] Conduct a normative check on the alarm logic expression according to the MATLAB syntax specification;

[0013] If the normative check of the alarm logic expression passes, add the variable name, the alarm logic expression, and the member function to the corresponding state machine in the preset simulation model architecture;

[0014] If the normative check of the alarm logic expression fails, replace the non - standard symbols in the alarm logic expression to obtain a standard alarm logic expression, and add the variable name, the standard alarm logic expression, and the member function to the corresponding state machine in the preset simulation model architecture.

[0015] In an optional embodiment, after adding the variable name, the alarm logic expression, and the member function to the corresponding state machine in the preset simulation model architecture, the method further includes:

[0016] Automatically layout each module according to the default size of each state machine in the preset simulation model architecture and the basic rule that the input module is on the left, the state machine is in the middle, and the output module is on the right.

[0017] In an optional embodiment, the member functions include: a signal validity judgment function, a signal invalidity judgment function, and a rising edge delay function.

[0018] In an optional embodiment, the method further includes:

[0019] Based on the modeling method of Stateflow, design a preset simulation model architecture applicable to all systems, where each alarm message in the preset simulation model architecture is implemented by a state machine; the state machine contains two states, one is the normal state representing that the alarm message is not triggered, and the other is the alarm state representing that the alarm message is triggered.

[0020] In an optional embodiment, the method further includes:

[0021] Add the state machine to the preset simulation model architecture by calling the add_block function, and add two states to each state machine.

[0022] In an optional embodiment, after obtaining the unit alarm simulation model by setting the parameter type, parameter initial value corresponding to the variable name in the state machine in the preset simulation model architecture, and the alarm result output by the state machine, the method further includes:

[0023] When generating the unit alarm simulation model, configure the simulation step size, start time, and end time into the simulation step size, start time, and end time by calling MATLAB functions.

[0024] An embodiment of the present invention provides a device for generating a unit alarm simulation model, the device includes:

[0025] An acquisition module, configured to acquire a unit alarm definition file, where the unit alarm definition file includes: an alarm message number, an alarm message logical expression, and an alarm message text;

[0026] An identification module, configured to parse the unit alarm definition file to obtain the alarm message logical expression, and identify the variable name, alarm logical expression, and member function in the alarm message logical expression based on a regular expression;

[0027] An addition module, configured to add the variable name, the alarm logical expression, and the member function to the corresponding state machine in the preset simulation model architecture;

[0028] A setting module, configured to obtain a unit alarm simulation model by setting the parameter type, parameter initial value corresponding to the variable name in the state machine in the preset simulation model architecture, and the alarm result output by the state machine.

[0029] A computer program product, the computer program product includes a computer program, and when the computer program is executed by a processor, it implements the above-mentioned method for generating a unit alarm simulation model.

[0030] The present invention provides a method, an apparatus, a computer device and a storage medium for generating a simulation model of unit alarms. First, a unit alarm definition file is obtained, and the unit alarm definition file includes: an alarm message number, an alarm message logical expression, and an alarm message text. Then, the alarm message logical expression is obtained by parsing the unit alarm definition file, and the variable name, the alarm logical expression, and the member function in the alarm message logical expression are identified based on a regular expression. The variable name, the alarm logical expression, and the member function are added to the corresponding state machine in a preset simulation model architecture. Finally, a unit alarm simulation model is obtained by setting the parameter type, the parameter initial value corresponding to the variable name in the state machine in the preset simulation model architecture, and the alarm result output by the state machine. By means of the present application, full-automatic batch modeling of the unit alarm simulation model is realized, the modeling efficiency of the unit alarm simulation model is greatly improved, a large amount of labor cost investment is saved, and the quality of the unit alarm simulation model is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 is a flowchart of a method for generating a simulation model of unit alarms provided by the present application;

[0032] Figure 2 is an architecture diagram of an alarm message state machine provided by the present application;

[0033] Figure 3 is a schematic structural diagram of an apparatus for generating a simulation model of unit alarms provided by the present application;

[0034] Figure 4 is a schematic diagram of a computer device provided by the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0035] In order to better understand the above technical solutions, the technical solutions of the embodiments of the present application will be described in detail below with reference to the drawings and specific embodiments. It should be understood that the specific features in the embodiments of the present application and the embodiments are detailed descriptions of the technical solutions of the embodiments of the present application, rather than limitations on the technical solutions of the present application. Without conflict, the technical features in the embodiments of the present application and the embodiments can be combined with each other.

[0036] Please refer to Figure 1 , which is a method for generating a simulation model of unit alarms provided by an embodiment of the present invention. The method specifically includes S101-S104:

[0037] S101, obtain a unit alarm definition file, where the unit alarm definition file includes: an alarm message number, an alarm message logical expression, and an alarm message text.

[0038] Among them, the alarm information label is used to uniquely identify the corresponding alarm information; the alarm message logical expression is used to determine whether there is an alarm; and the alarm information text is used to represent the relevant text information of the alarm.

[0039] S102, parse the unit alarm definition file to obtain the alarm message logical expression, and identify the variable name, alarm logical expression, and member function in the alarm message logical expression based on a regular expression.

[0040] In this embodiment, a file automatic analysis algorithm is used to analyze the unit alarm definition file. Information such as the alarm message number, alarm message logical expression, alarm message text, and input / output interface parameters corresponding to each alarm message is identified, and the Chinese and English states of the characters, the case of specific characters, etc. in each alarm message logical expression are checked for standardization. Among them, the member functions include: a signal validity judgment function, a signal invalidity judgment function, and a rising edge delay function.

[0041] Since the unit alarm definition file is manually compiled, there may be problems such as the mixed use of symbols in Chinese and English states and the use of arithmetic and logical operators not conforming to the MATLAB specification in the alarm message logical expression. It is necessary to check the standardization of the alarm message logical expression and automatically complete the replacement of non-standard symbols to make the alarm logical expression conform to the MATLAB syntax specification. To solve the above problems, in an optional embodiment provided in this application, after identifying the variable name, alarm logical expression, and member function in the alarm message logical expression based on a regular expression, the method further includes: checking the standardization of the alarm logical expression through the MATLAB syntax specification; if the standardization check of the alarm logical expression passes, adding the variable name, the alarm logical expression, and the member function to the corresponding state machine in the preset simulation model architecture; if the standardization check of the alarm logical expression fails, replacing the non-standard symbols in the alarm logical expression to obtain a standard alarm logical expression, and adding the variable name, the standard alarm logical expression, and the member function to the corresponding state machine in the preset simulation model architecture.

[0042] Specifically, analyze and identify the variable name and member function in the alarm message logical expression based on a regular expression (this member function is a custom function that realizes functions such as data validity judgment and signal delay). According to the MATLAB variable naming specification, design a variable name matching pattern (\<[a-zA-Z](+)?(_)?\w+), and automatically identify the variable name in the alarm message logical expression based on a regular expression. Based on the existing member function library, identify the member function in the alarm message expression through a regular expression (such as \<',TD,'(')).

[0043] During the process of logical expression analysis, the alarm message logical expression is automatically analyzed based on regular expressions, and the parameters and member functions in the alarm message logical expression can be automatically identified. Thus, the input / output types, variable types, initial values, etc. of the parameters can be automatically set by the program, and member functions can be automatically added, further reducing the workload of modeling.

[0044] S103, add the variable name, the alarm logic expression, and the member function to the corresponding state machine in the preset simulation model architecture.

[0045] In this embodiment, the corresponding variable is found from the ICD, and the variable name, the alarm logic expression, and the member function are added to the corresponding state machine in the preset simulation model architecture by calling the API function of MATLAB.

[0046] In an optional embodiment provided by the present application, after adding the variable name, the alarm logic expression, and the member function to the corresponding state machine in the preset simulation model architecture, the method further includes: automatically arranging each module according to the default size of each state machine in the preset simulation model architecture and the basic rule that the input module is on the left, the state machine is in the middle, and the output module is on the right, so as to prevent the models from overlapping after generation.

[0047] Based on the modeling method of Stateflow, a preset simulation model architecture applicable to all systems is designed. Each alarm message in the preset simulation model architecture is implemented by a state machine; the state machine includes two states, one is the normal state representing that the alarm message is not triggered, and the other is the alarm state representing that the alarm message is triggered. The state machine is added to the preset simulation model architecture by calling the add_block function, and two states are added to each state machine.

[0048] Specifically, in this embodiment, the Simulink model and the state machine model are automatically generated according to the preset simulation model architecture. The Simulink model is created by calling the API function new_system of MATLAB, and the open_system function is called to open the model in a load-only manner. The state machine (Chart module) is added by calling the add_block function, and two states are added to each Chart module. The MATLAB Function module is generated as needed according to whether the alarm message logical expression contains member functions. Among them, each alarm message corresponds to a Chart module, and each Chart module contains two states: Normal and Alert; the state machine defaults to the normal state. When the alarm logical expression is true, the alarm logic is triggered and the alarm state is entered; when the alarm logical expression is false, it returns to the normal state; the member functions used in the alarm logic are implemented through the MATLAB Function module. According to the identified member functions, the text content in MATLAB Function is automatically added, and finally the state transition conditions are automatically added.

[0049] In this embodiment, the alarm message may include types such as CAS, voice alarm, or information. Before the model generation, it is necessary to manually select which types of alarm messages need to be generated this time to assist the program in screening the message types required by the user. If the message number is empty during the model generation process, you can choose to ignore it or generate the model according to the default parameters. Configure parameters such as the simulation step size and start time of the model, and automatically configure them into the model by calling MATLAB functions during model generation. Preferably, in order to facilitate personnel operation, a human-machine interaction interface can be built. In the human-machine interaction interface, select the alarm message definition file of the system to be generated, configure the types of alarm messages to be generated, and support the simultaneous generation of one or more types of messages. The basic parameters of the model such as the simulation step size, start time, and end time can be configured in the interface. At the same time, in order to facilitate personnel to monitor the model generation process, the generation progress of the model should be displayed in the form of a progress bar, text, etc. When any abnormal situation occurs during the generation process, prompt information needs to be given to the operator, and subsequent operations should be completed according to the operator's instructions. There are two inputs to the system alarm logic model. One is the system fault information output by the system fault model and the alarm message status flag bits output by other system alarm logic models. The system alarm logic model comprehensively judges the alarm logic of this system based on the above two types of parameters.

[0050] S104, obtain the unit alarm simulation model by setting the parameter type, parameter initial value corresponding to the variable name in the state machine in the preset simulation model architecture, and the alarm result output by the state machine.

[0051] Set the model simulation parameters, save and close the model. Automatically set parameters such as the simulation step size and start time of the model, save and close the model. If only one model is generated at a time, the process can be terminated. If multiple models need to be generated in batch at a time.

[0052] In an optional embodiment provided by the present application, after obtaining the unit alarm simulation model by setting the parameter type, parameter initial value corresponding to the variable name in the state machine in the preset simulation model architecture, and the alarm result output by the state machine, the method further includes: when the unit alarm simulation model is generated, configure the simulation step size, start time, and end time into the simulation step size, start time, and end time by calling MATLAB functions.

[0053] The embodiment of the present invention provides a method for generating a unit alarm simulation model. First, obtain a unit alarm definition file, where the unit alarm definition file includes: an alarm message number, an alarm message logical expression, and an alarm message text; then parse the unit alarm definition file to obtain the alarm message logical expression, and identify the variable name, alarm logic expression, and member function in the alarm message logical expression based on a regular expression; add the variable name, the alarm logic expression, and the member function to the corresponding state machine in the preset simulation model architecture; finally, obtain the unit alarm simulation model by setting the parameter type, parameter initial value corresponding to the variable name in the state machine in the preset simulation model architecture, and the alarm result output by the state machine. Through the present application, the full-automatic batch modeling of the unit alarm simulation model is realized, greatly improving the modeling efficiency of the unit alarm simulation model, saving a large amount of human cost investment, and improving the quality of the unit alarm simulation model.

[0054] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

[0055] In an embodiment, a device for generating a unit alarm simulation model is provided. The device for generating a unit alarm simulation model corresponds one-to-one to the method for generating a unit alarm simulation model in the above embodiment. As Figure 3 shown, the detailed description of each functional module of the device for generating a unit alarm simulation model is as follows:

[0056] An acquisition module 31, configured to acquire a unit alarm definition file, where the unit alarm definition file includes: an alarm message number, an alarm message logical expression, and an alarm message text;

[0057] An identification module 32, configured to parse the unit alarm definition file to obtain the alarm message logical expression, and identify the variable name, alarm logical expression, and member function in the alarm message logical expression based on a regular expression;

[0058] An addition module 33, configured to add the variable name, the alarm logical expression, and the member function to a corresponding state machine in a preset simulation model architecture;

[0059] A setting module 34, configured to obtain a unit alarm simulation model by setting the parameter type, parameter initial value corresponding to the variable name in the state machine in the preset simulation model architecture, and the alarm result output by the state machine.

[0060] In an optional embodiment, the addition module 33 is specifically configured to:

[0061] Perform a standardization check on the alarm logical expression according to the MATLAB syntax specification;

[0062] If the standardization check of the alarm logical expression passes, add the variable name, the alarm logical expression, and the member function to a corresponding state machine in the preset simulation model architecture;

[0063] If the standardization check of the alarm logical expression fails, replace the non-standard symbols in the alarm logical expression to obtain a standardized alarm logical expression, and add the variable name, the standardized alarm logical expression, and the member function to a corresponding state machine in the preset simulation model architecture.

[0064] In an optional embodiment, the setting module 34 is further configured to:

[0065] Automatically layout each module according to the default size of each state machine in the preset simulation model architecture and the basic rule that the input module is on the left, the state machine is in the middle, and the output module is on the right.

[0066] In an optional embodiment, the member functions include: a signal validity judgment function, a signal invalidity judgment function, and a rising edge delay function.

[0067] In an optional embodiment, the setting module 34 is further configured to design a preset simulation model architecture applicable to all systems based on the modeling method of Stateflow. Each alarm message in the preset simulation model architecture is implemented by a state machine; the state machine includes two states, one is a normal state representing that the alarm message is not triggered, and the other is an alarm state representing that the alarm message is triggered.

[0068] In an alternative embodiment, the setting module 34 is further configured to add the state machine to the preset simulation model architecture by calling the add_block function, and add two states to each of the state machines.

[0069] In an alternative embodiment, the setting module 34 is further configured to configure the simulation step size, start time, and end time into the simulation step size, start time, and end time by calling MATLAB functions when generating the unit alarm simulation model.

[0070] For the specific limitations of the apparatus for generating the unit alarm simulation model, reference may be made to the limitations of the method for generating the unit alarm simulation model in the foregoing text, which will not be elaborated herein. Each module in the above device can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory of the computer device in the form of software, so as to facilitate the processor to call and execute the operations corresponding to each of the above modules.

[0071] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as Figure 4 shown. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a method for generating a unit alarm simulation model.

[0072] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:

[0073] Obtain a unit alarm definition file, where the unit alarm definition file includes: an alarm message number, an alarm message logical expression, and an alarm message text;

[0074] Parse the unit alarm definition file to obtain the alarm message logical expression, and identify the variable name, alarm logic expression, and member function in the alarm message logical expression based on a regular expression;

[0075] Add the variable name, the alarm logic expression, and the member function to the corresponding state machine in the preset simulation model architecture;

[0076] By setting the parameter types, parameter initial values corresponding to the variable names in the state machine of the preset simulation model architecture, and the alarm results output by the state machine, a unit alarm simulation model is obtained.

[0077] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0078] Obtain a unit alarm definition file, where the unit alarm definition file includes: alarm message number, alarm message logical expression, and alarm message text;

[0079] Parse the unit alarm definition file to obtain the alarm message logical expression, and identify the variable names, alarm logical expressions, and member functions in the alarm message logical expression based on regular expressions;

[0080] Add the variable names, the alarm logical expressions, and the member functions to the corresponding state machine in the preset simulation model architecture;

[0081] By setting the parameter types, parameter initial values corresponding to the variable names in the state machine of the preset simulation model architecture, and the alarm results output by the state machine, a unit alarm simulation model is obtained.

[0082] In one embodiment, a computer program product is provided, where the computer program product includes a computer program. When the computer program is executed by a processor, the following steps are implemented:

[0083] Obtain a unit alarm definition file, where the unit alarm definition file includes: alarm message number, alarm message logical expression, and alarm message text;

[0084] Parse the unit alarm definition file to obtain the alarm message logical expression, and identify the variable names, alarm logical expressions, and member functions in the alarm message logical expression based on regular expressions;

[0085] Add the variable names, the alarm logical expressions, and the member functions to the corresponding state machine in the preset simulation model architecture;

[0086] By setting the parameter types, parameter initial values corresponding to the variable names in the state machine of the preset simulation model architecture, and the alarm results output by the state machine, a unit alarm simulation model is obtained.

[0087] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0088] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0089] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments or equivalently replace some of the technical features. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention and should all be included in the protection scope of the present invention.

Claims

1. A method for generating a unit alarm simulation model, characterized in that The method includes: Obtain the unit alarm definition file, which includes: alarm message number, alarm message logical expression, and alarm message text; Parse the unit alarm definition file to obtain the alarm message logical expression, and identify the variable name, alarm logical expression, and member function in the alarm message logical expression based on regular expressions; Add the variable name, the alarm logical expression, and the member function to the corresponding state machine in the preset simulation model architecture; Obtain the unit alarm simulation model by setting the parameter type, parameter initial value corresponding to the variable name in the state machine of the preset simulation model architecture, and the alarm result output by the state machine.

2. The method according to claim 1, wherein After identifying the variable name, alarm logical expression, and member function in the alarm message logical expression based on regular expressions, the method further includes: Conduct a normative check on the alarm logical expression according to the MATLAB syntax specification; If the normative check of the alarm logical expression passes, add the variable name, the alarm logical expression, and the member function to the corresponding state machine in the preset simulation model architecture; If the normative check of the alarm logical expression fails, replace the non-standard symbols in the alarm logical expression to obtain a standard alarm logical expression, and add the variable name, the standard alarm logical expression, and the member function to the corresponding state machine in the preset simulation model architecture.

3. The method according to claim 1, wherein After adding the variable name, the alarm logical expression, and the member function to the corresponding state machine in the preset simulation model architecture, the method further includes: Automatically layout each module according to the default size of each state machine in the preset simulation model architecture and the basic rule that the input module is on the left, the state machine is in the middle, and the output module is on the right.

4. The method according to claim 1, wherein The member functions include: signal validity judgment function, signal invalidity judgment function, rising edge delay function.

5. The method according to any one of claims 1-4, characterized in that, The method further includes: Based on the modeling method of Stateflow, design a preset simulation model architecture applicable to all systems, and each alarm message in the preset simulation model architecture is implemented by a state machine; the state machine includes two states, one is the normal state representing that the alarm message is not triggered, and the other is the alarm state representing that the alarm message is triggered.

6. The method according to claim 5, wherein The method further includes: Add the state machine to the preset simulation model architecture by calling the add_block function, and add two states to each state machine.

7. The method according to claim 5, wherein After obtaining the unit alarm simulation model by setting the parameter type, parameter initial value corresponding to the variable name in the state machine of the preset simulation model architecture, and the alarm result output by the state machine, the method further includes: Configure the simulation step size, start time, and end time into the simulation step size, start time, and end time by calling MATLAB functions when the unit alarm simulation model is generated.

8. An apparatus for generating an alarm simulation model of a unit, characterized in that The device includes: An acquisition module, configured to acquire a unit alarm definition file, where the unit alarm definition file includes: an alarm message number, an alarm message logical expression, and an alarm message text; An identification module, configured to parse the unit alarm definition file to obtain the alarm message logical expression, and identify a variable name, an alarm logical expression, and a member function in the alarm message logical expression based on a regular expression; An addition module, configured to add the variable name, the alarm logical expression, and the member function to a corresponding state machine in a preset simulation model architecture; A setting module, configured to obtain a unit alarm simulation model by setting a parameter type, a parameter initial value corresponding to the variable name in a state machine in the preset simulation model architecture, and an alarm result output by the state machine; 9. A computer 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, the method for generating the unit alarm simulation model according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, the method for generating the unit alarm simulation model according to any one of claims 1 to 7 is implemented.