A model conversion method and system

By designing the conversion rules from the AltaRica3.0 model to the SBIP model, statistical analysis of random behavior is realized, and the problem that AltaRica3.0 cannot perform statistical model detection is solved, and the security analysis function is enriched.

CN116679934BActive Publication Date: 2025-01-07THE QUARTERMASTER RES INST OF THE GENERAL LOGISTICS DEPT OF THE CPLA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310613438.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-29
Publication Date
2025-01-07
Estimated Expiration
2043-05-29

AI Technical Summary

Technical Problem

The AltaRica3.0 model cannot perform probabilistic statistical analysis on safety-related systems with random behaviors, and cannot perform statistical model detection.

Method used

The conversion rules of the AltaRica3.0 flattened model to the SBIP model were designed, and an abstract syntax tree was generated using the ANTLR tool to convert variables, events, migration, assertions and delay parts respectively to realize automatic conversion of the model.

Benefits of technology

This enables the AltaRica3.0 model to perform statistical model detection, enriches the security analysis function and supports probability statistical analysis of random behaviors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116679934B_ABST
    Figure CN116679934B_ABST
Patent Text Reader

Abstract

The present invention discloses a model conversion method and system, and relates to the technical field of model conversion. The method automatically converts the flattened model of AltaRica3.0 into a SBIP model, and the flattened model of AltaRica3.0 into a Guard conversion system GTS model; including: using the metalanguage of the language recognition tool ANTLR to describe the grammatical rules of the Guard conversion system GTS model to generate an abstract syntax tree AST of the Guard conversion system GTS model; using the abstract syntax tree AST to convert the variable part, event part, migration part, assertion part and delay part of the Guard conversion system GTS model respectively. The method realizes the automatic conversion of the AltaRica3.0 flattened model GTS to the SBIP model, so that the AltaRica3.0 model can perform statistical model detection and enrich the security analysis function of AltaRica3.0.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of model conversion, and in particular relates to a model conversion method and system. Background Art

[0002] The safety and reliability of safety-critical systems such as avionics and nuclear reactor control systems are increasingly valued. In order to provide reliability and safety analysis for safety-critical systems, the Model-Based Safety Assessment (MBSA) method has received widespread attention in the industry in recent years. AltaRica3.0 is a multi-level modeling language based on MBSA. The AltaRica3.0 language is designed to formally model the functional behavior and fault behavior of the system. Its semantics is defined by the Guarded Transition Systems (GTS). There are many AltaRica3.0 model evaluation tools, such as fault tree compilers and stochastic simulators. However, there are still some limitations. The most important point is that it cannot perform statistical model checking on time attributes. As a widely used safety analysis and evaluation software, SBIP has the function of providing modeling and statistical model checking for safety-critical systems. For deterministic safety-critical systems, the existing technology can perform temporal logic safety verification on the established AltaRica3.0 model, but when there is random behavior in the safety-critical system, the existing technology cannot perform probabilistic statistical analysis on the random behavior. Summary of the invention

[0003] Aiming at the technical problem that AltaRica3.0 cannot perform statistical model detection, the present invention proposes a model conversion scheme. The scheme designs the conversion rules of the AltaRica3.0 flattened model GTS to the SBIP model according to the underlying semantic definition of AltaRica3.0 and SBIP; and obtains the SBIP model after the conversion of the AltaRica3.0 flattened model GTS according to the conversion rules and the formal semantics of the model.

[0004] In order to solve the above technical problem, the present invention proposes a message chain forwarding solution.

[0005] The first aspect of the present invention discloses a model conversion method. The method automatically converts the flattened model of AltaRica3.0 into a SBIP model, wherein the flattened model of AltaRica3.0 is a Guard conversion system GTS model; the method comprises: using the metalanguage of the language recognition tool ANTLR to describe the grammatical rules of the Guard conversion system GTS model to generate an abstract syntax tree AST of the Guard conversion system GTS model; using the abstract syntax tree AST to convert the variable part, event part, migration part, assertion part and delay part of the Guard conversion system GTS model respectively; wherein the conversion process is: traversing the abstract syntax tree AST of the Guard conversion system GTS model, according to the variable information, event information, migration information, assertion information and assertion information defined by the metalanguage of the language recognition tool ANTLR; locating the nodes corresponding to the variable information on the abstract syntax tree AST as the first group of nodes, so as to obtain the variable information contained in the first group of nodes, and performing corresponding conversion operations according to the variable declaration rules in the SBIP model. ; locating nodes corresponding to the event information on the abstract syntax tree AST as a second group of nodes to obtain event information contained in the second group of nodes, and performing corresponding conversion operations according to the port declaration rules in the SBIP model; locating nodes corresponding to the migration information on the abstract syntax tree AST as a third group of nodes to obtain migration information contained in the third group of nodes, and performing corresponding conversion operations according to the migration declaration rules, guard declaration rules and update function declaration rules in the SBIP model; locating nodes corresponding to the assertion information on the abstract syntax tree AST as a fourth group of nodes to obtain assertion information contained in the fourth group of nodes, and performing corresponding conversion operations according to the guard declaration rules and update function declaration rules in the SBIP model; locating nodes corresponding to the delay information on the abstract syntax tree AST as a fifth group of nodes to obtain event information contained in the fifth group of nodes, and performing corresponding conversion operations according to the port declaration rules and update function declaration rules in the SBIP model.

[0006] According to the method of the first aspect, in the method, the grammatical rules of the Guard conversion system GTS model are described using the metalanguage of the language recognition tool ANTLR to generate an abstract syntax tree AST of the Guard conversion system GTS model; specifically including: using the metalanguage of the language recognition tool ANTLR to describe the grammatical rules of the Guard conversion system GTS model to write the corresponding grammar file gts.g4, running the built-in program of the language recognition tool ANTLR to form the grammar and lexical parser of the Guard conversion system GTS model, inputting the Guard conversion system GTS model code, checking the correctness of the code writing, and generating the corresponding abstract syntax tree AST.

[0007] According to the method of the first aspect, the conversion rule of the variable part is: the state variables and flow variables in the guard conversion system GTS model are represented by ordinary variables of the SBIP model, wherein the variable initialization keywords init and reset of the guard conversion system GTS model are converted to data in the SBIP model, and the variable type of the guard conversion system GTS model is converted according to the basic type correspondence rule of the SBIP model.

[0008] According to the method of the first aspect, the conversion rule of the event part is:

[0009] Define the events in the Guard conversion system GTS model:

[0010] "event "Path";"

[0011] Translates to:

[0012] "export port"type port_type_name"("")"

[0013] As an event definition in the SBIP model;

[0014] Wherein, event represents the event keyword in the guard conversion system GTS model, Path represents the event name in the guard conversion system GTS model, and the event definition in the guard conversion system GTS model is used to define the event Path;

[0015] Wherein, export port represents the output port keyword in the SBIP model, type represents the port type in the SBIP model, port_type_name represents the port name in the SBIP model, and the event definition in the SBIP model is used to define a port port_type_name of type type;

[0016] During the conversion process, the event keyword event of the guard conversion system GTS model is converted into the output port keyword export port of the SBIP model, the event name Path of the guard conversion system GTS model corresponds to the port name port_type_name of the SBIP model, the guard conversion system GTS model does not have a port type definition, and the port type of the converted SBIP model is the user default type.

[0017] According to the method of the first aspect, the conversion rule of the migration part is:

[0018] The migration definition of the Guard conversion system GTS model:

[0019] "transition"EventReference":"Expression

[0020] “->”Instruction

[0021] Translates to:

[0022] "on"port_name"from"place_name"to"

[0023] place_name"provided""("Expression")"

[0024] "delayabledo" "{"Instruction"}"

[0025] As the migration definition in the SBIP model;

[0026] Among them, transition represents the migration keyword in the guard conversion system GTS model, EventReference represents the migration name in the guard conversion system GTS model, Expression represents the migration expression judgment in the guard conversion system GTS model, Instruction represents the migration instruction in the guard conversion system GTS model, and the migration definition in the guard conversion system GTS model is used to define a migration EventReference. When the defined migration satisfies the migration expression Expression, the defined migration executes the instruction Instruction;

[0027] Wherein, port_name represents the port name in the SBIP model, place_name represents the location name in the SBIP model, and when the migration defined by the migration definition in the SBIP model satisfies the migration expression Expression, the migration process moves from location place_name to location place_name through port port_name, and executes the instruction Instruction;

[0028] During the conversion process, the migration name EventReference of the Guard conversion system GTS model corresponds to the port name port_name of the SBIP model. There is no position definition for the Guard conversion system GTS model, and the position of the converted SBIP model is the user default position.

[0029] According to the method of the first aspect, the conversion rule of the assertion part is:

[0030] The assertion definition in the Guard conversion system GTS model:

[0031] "assertion"Instruction1";"

[0032] Translates to:

[0033] "initial to" place_name "do" Instruction1

[0034] "on"port_name"from"place_name"to"

[0035] place_name"provided""("Expression")"

[0036] "delayabledo""{"Instruction","Instruction1"}"

[0037] As an assertion definition in the SBIP model;

[0038] Wherein, assertion represents the assertion keyword in the guard conversion system GTS model, Instruction1 represents the assertion instruction in the guard conversion system GTS model, and the assertion definition in the guard conversion system GTS model is used to define an assertion Instruction1;

[0039] The assertion definition in the SBIP model is divided into two parts, one is the initial assertion, and the other is the execution assertion in migration;

[0040] During the conversion process, the assertion of the guard conversion system GTS model is mapped into two parts. The assertion instruction Instruction1 of the guard conversion system GTS model is converted into the assertion instruction in the initial assertion of the SBIP model, and the assertion instruction in the guard conversion system GTS model is converted into the execution assertion in the SBIP model migration.

[0041] According to the method of the first aspect, the delay rule of the event part is:

[0042] The delay definition in the Guard conversion system GTS model is:

[0043] "event"Path"(""delay"=OperatorCall

[0044] "("Expression1“)””)”

[0045] Translates to:

[0046] "@stochastic""(""dist="OperatorCall

[0047] ",""cly="x",""param="Expression1")"

[0048] "export port"type port_type_name"("")"

[0049] As the delay definition in the SBIP model;

[0050] Wherein, delay represents the delay keyword in the GTS model of the guard conversion system, OperatorCall represents the delay function name in the GTS model of the guard conversion system, Expression1 represents the delay function expression in the GTS model of the guard conversion system, and the delay definition in the GTS model of the guard conversion system is used to define the delay of the event Path following the OperatorCall function type;

[0051] The delay definition in the SBIP model is divided into two parts. The first part describes the delay characteristics, and the second part represents the output port definition. The delay definition in the SBIP model is used to define the delay of the output port port_type_name following the OperatorCall function type.

[0052] The second aspect of the present invention discloses a model conversion system. The system automatically converts the flattened model of AltaRica3.0 into a SBIP model, and the flattened model of AltaRica3.0 is a Guard conversion system GTS model; the module unit of the system is configured to execute: using the metalanguage of the language recognition tool ANTLR to describe the grammatical rules of the Guard conversion system GTS model to generate an abstract syntax tree AST of the Guard conversion system GTS model; using the abstract syntax tree AST to convert the variable part, event part, migration part, assertion part and delay part of the Guard conversion system GTS model respectively; wherein the conversion process is: traversing the abstract syntax tree AST of the Guard conversion system GTS model, according to the variable information, event information, migration information, assertion information and assertion information defined by the metalanguage of the language recognition tool ANTLR; locating the nodes corresponding to the variable information on the abstract syntax tree AST as the first group of nodes to obtain the variable information contained in the first group of nodes, and performing corresponding operations according to the variable declaration rules in the SBIP model. conversion operation; locating the nodes corresponding to the event information on the abstract syntax tree AST as the second group of nodes to obtain the event information contained in the second group of nodes, and performing corresponding conversion operations according to the port declaration rules in the SBIP model; locating the nodes corresponding to the migration information on the abstract syntax tree AST as the third group of nodes to obtain the migration information contained in the third group of nodes, and performing corresponding conversion operations according to the migration declaration rules, guard declaration rules and update function declaration rules in the SBIP model; locating the nodes corresponding to the assertion information on the abstract syntax tree AST as the fourth group of nodes to obtain the assertion information contained in the fourth group of nodes, and performing corresponding conversion operations according to the guard declaration rules and update function declaration rules in the SBIP model; locating the nodes corresponding to the delay information on the abstract syntax tree AST as the fifth group of nodes to obtain the event information contained in the fifth group of nodes, and performing corresponding conversion operations according to the port declaration rules and update function declaration rules in the SBIP model.

[0053] According to the system of the second aspect, the grammatical rules of the Guard conversion system GTS model are described using the metalanguage of the language recognition tool ANTLR to generate an abstract syntax tree AST of the Guard conversion system GTS model; specifically including: using the metalanguage of the language recognition tool ANTLR to describe the grammatical rules of the Guard conversion system GTS model to write the corresponding grammar file gts.g4, running the built-in program of the language recognition tool ANTLR to form the grammar and lexical parser of the Guard conversion system GTS model, inputting the Guard conversion system GTS model code, checking the correctness of the code writing, and generating the corresponding abstract syntax tree AST.

[0054] According to the system of the second aspect, the conversion rules of the variable part are: the state variables and flow variables in the guard conversion system GTS model are represented by ordinary variables of the SBIP model, wherein the variable initialization keywords init and reset of the guard conversion system GTS model are converted to data in the SBIP model, and the variable type of the guard conversion system GTS model is converted according to the basic type correspondence rule of the SBIP model.

[0055] According to the system of the second aspect, the conversion rule of the event part is:

[0056] Define the events in the Guard conversion system GTS model:

[0057] "event "Path";"

[0058] Translates to:

[0059] "export port"type port_type_name"("")"

[0060] As an event definition in the SBIP model;

[0061] Wherein, event represents the event keyword in the guard conversion system GTS model, Path represents the event name in the guard conversion system GTS model, and the event definition in the guard conversion system GTS model is used to define the event Path;

[0062] Wherein, export port represents the output port keyword in the SBIP model, type represents the port type in the SBIP model, port_type_name represents the port name in the SBIP model, and the event definition in the SBIP model is used to define a port port_type_name of type type;

[0063] During the conversion process, the event keyword event of the guard conversion system GTS model is converted into the output port keyword export port of the SBIP model, the event name Path of the guard conversion system GTS model corresponds to the port name port_type_name of the SBIP model, the guard conversion system GTS model does not have a port type definition, and the port type of the converted SBIP model is the user default type.

[0064] According to the system of the second aspect, the conversion rule of the migration part is:

[0065] The migration definition of the Guard conversion system GTS model:

[0066] "transition"EventReference":"Expression

[0067] “->”Instruction

[0068] Translates to:

[0069] "on"port_name"from"place_name"to"

[0070] place_name"provided""("Expression")"

[0071] "delayabledo" "{"Instruction"}"

[0072] As the migration definition in the SBIP model;

[0073] Among them, transition represents the migration keyword in the guard conversion system GTS model, EventReference represents the migration name in the guard conversion system GTS model, Expression represents the migration expression judgment in the guard conversion system GTS model, Instruction represents the migration instruction in the guard conversion system GTS model, and the migration definition in the guard conversion system GTS model is used to define a migration EventReference. When the defined migration satisfies the migration expression Expression, the defined migration executes the instruction Instruction;

[0074] Wherein, port_name represents the port name in the SBIP model, place_name represents the location name in the SBIP model, and when the migration defined by the migration definition in the SBIP model satisfies the migration expression Expression, the migration process moves from location place_name to location place_name through port port_name, and executes the instruction Instruction;

[0075] During the conversion process, the migration name EventReference of the Guard conversion system GTS model corresponds to the port name port_name of the SBIP model. There is no position definition for the Guard conversion system GTS model, and the position of the converted SBIP model is the user default position.

[0076] According to the system of the second aspect, the conversion rule of the assertion part is:

[0077] The assertion definition in the Guard conversion system GTS model:

[0078] "assertion"Instruction1";"

[0079] Translates to:

[0080] "initial to" place_name "do" Instruction1

[0081] "on"port_name"from"place_name"to"

[0082] place_name"provided""("Expression")"

[0083] "delayabledo""{"Instruction","Instruction1"}"

[0084] As an assertion definition in the SBIP model;

[0085] Wherein, assertion represents the assertion keyword in the guard conversion system GTS model, Instruction1 represents the assertion instruction in the guard conversion system GTS model, and the assertion definition in the guard conversion system GTS model is used to define an assertion Instruction1;

[0086] The assertion definition in the SBIP model is divided into two parts, one is the initial assertion, and the other is the execution assertion in migration;

[0087] During the conversion process, the assertion of the guard conversion system GTS model is mapped into two parts. The assertion instruction Instruction1 of the guard conversion system GTS model is converted into the assertion instruction in the initial assertion of the SBIP model, and the assertion instruction in the guard conversion system GTS model is converted into the execution assertion in the SBIP model migration.

[0088] According to the system of the second aspect, the delay rule of the event part is:

[0089] The delay definition in the Guard conversion system GTS model is:

[0090] "event"Path"(""delay"=OperatorCall

[0091] "("Expression1“)””)”

[0092] Translates to:

[0093] "@stochastic""(""dist="OperatorCall

[0094] ",""cly="x",""param="Expression1")"

[0095] "export port"type port_type_name"("")"

[0096] As the delay definition in the SBIP model;

[0097] Wherein, delay represents the delay keyword in the GTS model of the guard conversion system, OperatorCall represents the delay function name in the GTS model of the guard conversion system, Expression1 represents the delay function expression in the GTS model of the guard conversion system, and the delay definition in the GTS model of the guard conversion system is used to define the delay of the event Path following the OperatorCall function type;

[0098] The delay definition in the SBIP model is divided into two parts. The first part describes the delay characteristics, and the second part represents the output port definition. The delay definition in the SBIP model is used to define the delay of the output port port_type_name following the OperatorCall function type.

[0099] The third aspect of the present invention discloses an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps in any one of the model conversion methods described in the first aspect of the present disclosure are implemented.

[0100] The fourth aspect of the present invention discloses a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in any one of the model conversion methods described in the first aspect of the present disclosure are implemented.

[0101] In summary, the technical solution proposed in the present invention realizes the automatic conversion of the AltaRica3.0 flattened model GTS to the SBIP model, so that the AltaRica3.0 model can be used for statistical model detection, enriching the security analysis function of AltaRica3.0. BRIEF DESCRIPTION OF THE DRAWINGS

[0102] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0103] Figure 1 A schematic diagram of a flow chart of a model conversion method according to an embodiment of the present invention;

[0104] Figure 2 is a schematic structural diagram of a cooling system according to an embodiment of the present invention;

[0105] Figure 3 FIG. 4 is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0106] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0107] The first aspect of the present invention discloses a model conversion method. The method automatically converts a flattened model of AltaRica 3.0 into a SBIP model, and the flattened model of AltaRica 3.0 is converted into a GTS model. Figure 1 FIG. 1 is a flow chart of a model conversion method according to an embodiment of the present invention; Figure 1 As shown, the method includes: using the metalanguage of the language recognition tool ANTLR to describe the grammatical rules of the guard conversion system GTS model to generate an abstract syntax tree AST of the guard conversion system GTS model; using the abstract syntax tree AST to convert the variable part, event part, migration part, assertion part and delay part of the guard conversion system GTS model respectively.

[0108] In some embodiments, the conversion process is: traversing the abstract syntax tree AST of the guard conversion system GTS model, according to the variable information, event information, migration information, assertion information and assertion information defined by the metalanguage of the language recognition tool ANTLR.

[0109] In some embodiments, the grammatical rules of the Guard conversion system GTS model are described using the metalanguage of the language recognition tool ANTLR to generate an abstract syntax tree AST of the Guard conversion system GTS model; specifically including: using the metalanguage of the language recognition tool ANTLR to describe the grammatical rules of the Guard conversion system GTS model to write the corresponding grammar file gts.g4, running the built-in program of the language recognition tool ANTLR to form the grammar and lexical parser of the Guard conversion system GTS model, inputting the Guard conversion system GTS model code, checking the correctness of the code writing, and generating the corresponding abstract syntax tree AST.

[0110] In some embodiments, nodes corresponding to the variable information are located on the abstract syntax tree AST as a first group of nodes to obtain the variable information contained in the first group of nodes, and corresponding conversion operations are performed according to the variable declaration rules in the SBIP model;

[0111] In some embodiments, nodes corresponding to the event information are located on the abstract syntax tree AST as a second group of nodes to obtain the event information contained in the second group of nodes, and corresponding conversion operations are performed according to the port declaration rules in the SBIP model;

[0112] In some embodiments, nodes corresponding to the migration information are located on the abstract syntax tree AST as a third group of nodes to obtain the migration information contained in the third group of nodes, and corresponding conversion operations are performed according to the migration declaration rules, guard declaration rules, and update function declaration rules in the SBIP model;

[0113] In some embodiments, nodes corresponding to the assertion information are located on the abstract syntax tree AST as a fourth group of nodes to obtain the assertion information contained in the fourth group of nodes, and corresponding conversion operations are performed according to the guard declaration rules and the update function declaration rules in the SBIP model;

[0114] In some embodiments, nodes corresponding to the delay information are located on the abstract syntax tree AST as the fifth group of nodes to obtain event information contained in the fifth group of nodes, and corresponding conversion operations are performed according to the port declaration rules and update function declaration rules in the SBIP model.

[0115] Specifically, AltaRica3.0 is a language for complex system driven modeling, and its semantics is defined according to GTS. The AltaRica3.0 model is composed of a hierarchical structure of components. When performing safety analysis on the AltaRica3.0 model, AltaRica3.0 will perform a dimensionality reduction operation to form a GTS model, which is called flattening. Then, the AltaRica3.0 flattened model GTS is subjected to safety analysis, such as fault tree analysis, random simulation and other analyses. For the flattening operation, there are currently mature algorithms. Due to the deficiency that AltaRica3.0 cannot perform statistical model detection, according to the underlying semantic definitions of the AltaRica3.0 flattened model GTS and SBIP, the conversion rules of the AltaRica3.0 flattened model GTS to the SBIP model are designed, and the automatic conversion of the AltaRica3.0 flattened model GTS to the SBIP model is realized. First, the components of the GTS model and the SBIP model are introduced, and then the lexical and grammatical analysis of GTS and SBIP is carried out, and the corresponding rules are designed.

[0116] Specifically, the GTS model is roughly divided into variables, events, initialization, transitions, assertions, and delays, where the number of transitions corresponds to the number of events. GTS is a six-tuple G =<V,E,T,A,ξ,delay> , where V is a set of variables, divided into state variables S and flow variables F. State variables are used to describe the state of the system, and flow variables are used to describe the transfer function implemented by the system. Flow variables are functionally dependent on state variables: once the value of the state variable is set, the value of the flow variable is uniquely determined. E is a set of events in GTS. An event is a label for the state transition of a component. T is a set of migrations. Migrations are used to describe the evolution of the system. A migration is a triple<e,G,P> , can also be expressed as e: G→P, where: e is the event marking the transition, G is a Boolean condition of a variable (state variable and flow variable), P is the action performed on the state variable to calculate the new state of the system, and when the guard condition is met, the transition e: G→P can occur. A is a set of assertions used to calculate the value of the flow variable. ξ is the initial assignment of state variables and flow variables. delay is a function of events to the non-negative real field, which is used to describe the time characteristics of events.

[0117] The SBIP model consists of three parts: a set of component-defined behaviors (Behavior), interactions (Interaction) used to define synchronization and communication between components, and a set of priorities (Priority) that define interaction rules. Through the combination of behaviors, interactions, and priorities, a hierarchy of complex components can be constructed. These complex components are called composite components (Compound). Atom components (Atom) are the simplest type of components, which represent all non-hierarchical components. The atomic components of SBIP can be represented by the six-tuple B= <L,P,T,X,{g τ} τ∈T ,{f τ} τ∈T Indicates.<L,P,T> is a migration system, L = {l1, l2, ..., l k} is the set of control positions, P is the set of ports, is the set of migrations, X is the set of variables, g τ (X) is the guard for the variable X in τ∈T, that is, the predicate acting on the variable X, f τ (X) is the update function acting on deterministic variables and random variables.

[0118] Specifically, the conversion algorithm mainly consists of ANTLR parsing process, variable conversion algorithm, event conversion algorithm, migration conversion algorithm, assertion conversion algorithm and delay conversion algorithm.

[0119] Specifically, the ANTLR parsing process includes: using ANTLR's metalanguage to describe the grammatical rules of GTS in detail, writing the corresponding grammar file (gts.g4), running ANTLR's built-in methods to form GTS's grammar and lexical parsers, inputting a section of GTS code to check the correctness of the code, and generating the corresponding AST.

[0120] Specifically, the variable conversion process includes: traversing the generated GTS AST, accurately locating the corresponding node according to the variable information defined in the ANTLR metalanguage, thereby obtaining the variable information contained in the node, and then performing corresponding conversion operations according to the variable declaration rules in SBIP.

[0121] Specifically, the event conversion process includes: traversing the generated GTS AST, accurately locating the corresponding node according to the event information defined by the ANTLR metalanguage, thereby obtaining the event information contained in the node, and then performing corresponding conversion operations according to the port declaration rules in SBIP.

[0122] Specifically, the migration conversion process includes: traversing the generated GTS AST, accurately locating the corresponding node according to the migration information defined by the ANTLR metalanguage, thereby obtaining the migration information contained in the node, and then performing corresponding conversion operations according to the migration declaration rules, guard declaration rules and update function declaration rules in SBIP.

[0123] Specifically, the assertion conversion process includes: traversing the generated GTS AST, accurately locating the corresponding node according to the assertion information defined in the ANTLR metalanguage, thereby obtaining the assertion information contained in the node, and then performing corresponding conversion operations according to the guard declaration rules and update function declaration rules in SBIP.

[0124] Specifically, the delay conversion process includes: traversing the generated GTS AST, accurately locating the corresponding node according to the delay information defined by the ANTLR metalanguage, thereby obtaining the delay information contained in the node, and then performing corresponding conversion operations according to the port declaration rules and update function declaration rules in SBIP.

[0125] In some embodiments, the conversion rules of the variable part are as follows: the state variables and flow variables in the guard conversion system GTS model are represented by ordinary variables of the SBIP model, wherein the variable initialization keywords init and reset of the guard conversion system GTS model are converted to data in the SBIP model, and the variable type of the guard conversion system GTS model is converted according to the basic type correspondence rule of the SBIP model.

[0126] In some embodiments, the conversion rule of the event part is:

[0127] The events in the Guardian Transition System GTS model are defined as:

[0128] "event "Path";"

[0129] Among them, event represents the event keyword in the GTS model, and Path represents the event name in the GTS model. This statement means that an event Path is defined.

[0130] Convert the event definition in the Guardian Conversion System GTS model to:

[0131] "export port"type port_type_name"("")"

[0132] As an event definition in the SBIP model;

[0133] Among them, export port indicates the output port keyword in the SBIP model, type indicates the port type in the SBIP model, and port_type_name indicates the port name in the SBIP model. This statement indicates that a port port_type_name of type type is defined. During the conversion process, the GTS model event keyword event is converted to the SBIP model output port keyword export port, and the GTS model event name Path corresponds to the SBIP model port name port_type_name. Since the GTS model does not have the definition of event type, the converted SBIP model port type is the designer's default type.

[0134] In some embodiments, the conversion rule of the migration part is:

[0135] The migration in the Guardian Transformation System GTS model is defined as:

[0136] "transition"EventReference":"Expression

[0137] “->”Instruction

[0138] Among them, transition represents the transition keyword in the GTS model, EventReference represents the transition name in the GTS model, Expression represents the transition expression judgment in the GTS model, and Instruction represents the transition instruction in the GTS model. This statement means that a transition EventReference is defined, and when the expression Expression is satisfied, the migration executes the instruction Instruction.

[0139] Convert the migration definition in the Guard Conversion System GTS model to:

[0140] "on"port_name"from"place_name"to"

[0141] place_name"provided""("Expression")"

[0142] "delayabledo" "{"Instruction"}"

[0143] As the migration definition in the SBIP model;

[0144] Among them, port_name represents the port name in the SBIP model, place_name represents the location name in the SBIP model, Expression is the migration expression judgment in the SBIP model, and Instruction is the migration instruction in the SBIP model. This statement means that a migration is defined. When the expression Expression is satisfied, the migration moves from the location place_name to the location place_name through the port port_name, and executes the instruction Instruction. During the conversion process, the GTS model migration name EventReference corresponds to the SBIP model port name port_name, the GTS model expression Expression corresponds to the SBIP model expression Expression, and the GTS model instruction Instruction corresponds to the SBIP model instruction Instruction. Since the GTS model does not have the definition of location, the converted SBIP model location is the designer's default location name.

[0145] In some embodiments, the conversion rule of the assertion part is:

[0146] The assertions in the Guardian Transformation System GTS model are defined as:

[0147] "assertion"Instruction1";"

[0148] Among them, assertion represents the assertion keyword in the GTS model, and Instruction1 represents the assertion instruction in the GTS model. This statement indicates that an assertion Instruction1 is defined.

[0149] Convert the assertion definition in the Guardian Conversion System GTS model to:

[0150] "initial to" place_name "do" Instruction1

[0151] "on"port_name"from"place_name"to"

[0152] place_name"provided""("Expression")"

[0153] "delayabledo""{"Instruction","Instruction1"}"

[0154] As an assertion definition in the SBIP model;

[0155] The assertion definition in the SBIP model is divided into two parts, one is the initial assertion and the other is the assertion executed during migration. During the conversion process, the assertion of the GTS model is mapped into two parts. First, the assertion instruction Instruction1 of the GTS model is converted to the assertion instruction Instruction1 in the initial assertion of the SBIP model. At the same time, the assertion instruction Instruction1 in the GTS model is converted to the execution assertion Instruction1 in the migration of the SBIP model.

[0156] In some embodiments, the delay rule of the event part is:

[0157] The delay in the Guardian Transformation System GTS model is defined as:

[0158] "event"Path"(""delay"=OperatorCall

[0159] "("Expression1“)””)”

[0160] Among them, the "event" Path definition is consistent with the event, delay represents the delay keyword in the GTS model, OperatorCall represents the delay function name in the GTS model, and Expression represents the delay function expression in the GTS model. This statement indicates that the event Path follows the delay of the OperatorCall function type.

[0161] The delay definition in the Guardian conversion system GTS model is converted to:

[0162] "@stochastic""(""dist="OperatorCall

[0163] ",""cly="x",""param="Expression1")"

[0164] "export port"type port_type_name"("")"

[0165] As the delay definition in the SBIP model;

[0166] The delay definition in the SBIP model is divided into two parts. The first part describes the delay characteristics. OperatorCall represents the delay function name in the SBIP model, x represents the time variable in the SBIP model, and Expression represents the delay function expression in the SBIP model. The second part represents the output port definition. This statement indicates that the output port port_type_name follows the delay of the OperatorCall function type.

[0167] The algorithm conversion rules will be explained in detail below.

[0168] (1) Basic type correspondence rules

[0169] GTS supports four basic types, including Boolean type, integer type, real type and user-defined type. SBIP supports four basic types, including Boolean type, integer type, real type and string type. The Boolean type, integer type and real type in GTS can be directly matched with the Boolean type, integer type and real type in SBIP without conversion. The user-defined type in GTS is similar to the enumeration form and can be matched with the integer type in SBIP. The corresponding relationship of the basic types is shown in Table 1.

[0170] AltaRica 3.0 Type Value range SBIP Type Value range Boolean true / false bool true / false Integers <![CDATA[-2 31 ~2 31 -1]]> int <![CDATA[-2 31 ~2 31 -1]]> Real <![CDATA[-1.7E +308 ~1.7E 308 ]]> float <![CDATA[-1.7E +308 ~1.7E 308 ]]> User-define -- int <![CDATA[-2 31 ~2 31 -1]]>

[0171] Table 1 Correspondence between basic types

[0172] (2) Correspondence rules between constants and variables

[0173] GTS constants are used to store immutable values ​​and are represented by the parameter keyword. For example: parameterReal gamma = 0.2, which means that the value of the real constant gamma is 0.2. GTS mainly includes two types of variables, namely state variables and flow variables. State variables are used to describe the state of the system. These variables represent the state of system components with Boolean values, symbolic constants, and enumerations. The initialization keyword for state variables is "init". Flow variables are used to describe variables that describe the transfer of information between components. The initialization keyword for flow variables is "reset".

[0174] SBIP variables are divided into constants and common variables. SBIP constants are initialized and assigned values ​​when they are declared. After initialization, their values ​​cannot be changed and are represented by the keyword const data. For example, const data float PI = 3.14 means that the value of the floating point number PI is 3.14. SBIP common variables are used to store data values ​​and can be represented by Boolean values, integer values, floating point values, etc.

[0175] The constants of GTS and SBIP can be converted according to the basic type correspondence rules. The state variables and flow variables in GTS can be represented by ordinary variables of SBIP. The keywords "init" and "reset" for initializing variables in GTS are converted to "data" in SBIP. The types of variables in GTS can be converted according to the basic type correspondence rules. The conversion rules of constants and variables are as follows.

[0176]

[0177] (3) Expression Correspondence Rules

[0178] GTS supports a standard set of logical operators, and all logical operations generate standard logical Boolean values ​​of "true" or "false". At the same time, GTS supports standard arithmetic operators, and the type of the operation result is determined by all parameters. If all parameters are integer types, the result generated is also an integer; if the parameters contain floating-point numbers, the operation result is also a floating-point type. GTS contains basic mathematical functions, such as "min()", "max()", "abs()", etc.; and GTS supports "if-then-else" conditional expressions.

[0179] SBIP supports standard logical operators and arithmetic operators. During the conversion process, the logical operators and arithmetic operators of GTS and SBIP can be directly mapped and converted. At the same time, SBIP also contains basic mathematical functions. When using built-in functions, you need to use "entern" to declare the built-in functions first. The corresponding relationship of the operators is shown in Table 2.

[0180] GTS Operator Semantics SBIP Operator + add + - reduce - * take * / remove / not negative ! and Logical AND && or Logical OR || min() Minimum min() max() Maximum max() abs() Absolute value abs() mod() mold mod()

[0181] Table 2 Correspondence between operators

[0182] For conditional expressions, SBIP supports "if-then-else" expressions which are similar to those in GTS and only require simple conversion. The mapping rules between GTS's "if-then-else" expressions and SBIP's "if-then-else" expressions are shown below.

[0183]

[0184] (4) Event conversion rules

[0185] In GTS, events are labels for the behavior of state transitions triggered by components. Ports in SBIP are used to synchronize components and pass information between components in a synchronous manner. You can use parameter-free SBIP ports to represent GTS events. The conversion rules are as follows.

[0186]

[0187] (5) Migration conversion rules

[0188] The transition in GTS is expressed as e:G→P, which means that if the guard condition G is satisfied, then event e executes expression P. The transition in SBIP is expressed as <L,P,L,,{g τ} τ∈T ,{f τ} τ∈T >, where L represents the location, P represents the port, and g τ represents the guard condition, f τ Indicates the update of variable values. Since there is no position change in the system described by GTS, only one position can be used to represent it in SBIP. In the actual conversion process, "L0" is used by default to represent the position. The migration described in GTS has the same semantics as the migration system described in SBIP, and both describe the change of system status. The conversion rules are as follows.

[0189]

[0190] (6) Assertion conversion rules

[0191] Assertions are mainly the conversion of flow variables. Its working principle is that the GTS model will execute assertions after initialization and update the values ​​of flow variables; and after each subsequent migration, assertions will be executed to update the values ​​of flow variables. In SBIP, there is a variable initialization link that can be used to express the first execution of GTS assertions. For assertion execution after GTS migration, assertion instruction execution can be added to the migration link of SBIP to express it. Its conversion rules are as follows.

[0192]

[0193]

[0194] (7) Delayed conversion rules

[0195] The delay in GTS is used to represent the time characteristics of event migration. The failure rate of system components can usually be expressed by the delay described by an exponential function. The delay in SBIP is expressed by a specific annotation of the port. The delay described in GTS has the same semantics as the delay described in SBIP, and can be directly mapped during the conversion process. The conversion rules are as follows.

[0196] Specific embodiments

[0198] Consider a cooling system (such as Figure 2 The cooling system supplies coolant from the water tank to the reactor through two identical pipes, each track consists of a pump and shares a water tank. Figure 2 The specific components of the cooling system shown, the water tank, pipe, pump and reactor are represented by the variables T, Line, P and Reactor respectively. The variables T.isEmpty and T.outFlow represent the storage status and water flow status of the water tank respectively. The variables Line1.P1.s and Line2.P2.s represent the working status of pump 1 and pump 2 respectively. The variable Line1.P1.inFlow represents the water flow inflow of pump 1, and the variables Line1.P1.outFlow, Line2.P2.inFlow, Line2.P2.outFlow and Reactor.inFlow have similar meanings. The event T.getEmpty(delay=exponential(0.3)) indicates that the probability that the water tank is empty is 0.3. The system must ensure that at least one of the two pumps remains in normal operation so that the water can accurately cool the reactor. However, the pump may fail and the water tank may be empty, which may cause the entire system to fail.

[0199] The GTS model of the cooling system is described as follows:

[0200]

[0201] The generated SBIP model using the conversion algorithm is as follows. The generated SBIP model is parsed using the syntax parser ANTLR, and the model can generate the corresponding syntax parse tree without error information.

[0202]

[0203]

[0204]

[0205] The second aspect of the present invention discloses a model conversion system. The system automatically converts the flattened model of AltaRica3.0 into a SBIP model, and the flattened model of AltaRica3.0 is a Guard conversion system GTS model; the module unit of the system is configured to execute: using the metalanguage of the language recognition tool ANTLR to describe the grammatical rules of the Guard conversion system GTS model to generate an abstract syntax tree AST of the Guard conversion system GTS model; using the abstract syntax tree AST to convert the variable part, event part, migration part, assertion part and delay part of the Guard conversion system GTS model respectively; wherein the conversion process is: traversing the abstract syntax tree AST of the Guard conversion system GTS model, according to the variable information, event information, migration information, assertion information and assertion information defined by the metalanguage of the language recognition tool ANTLR; locating the nodes corresponding to the variable information on the abstract syntax tree AST as the first group of nodes to obtain the variable information contained in the first group of nodes, and performing corresponding operations according to the variable declaration rules in the SBIP model. conversion operation; locating the nodes corresponding to the event information on the abstract syntax tree AST as the second group of nodes to obtain the event information contained in the second group of nodes, and performing corresponding conversion operations according to the port declaration rules in the SBIP model; locating the nodes corresponding to the migration information on the abstract syntax tree AST as the third group of nodes to obtain the migration information contained in the third group of nodes, and performing corresponding conversion operations according to the migration declaration rules, guard declaration rules and update function declaration rules in the SBIP model; locating the nodes corresponding to the assertion information on the abstract syntax tree AST as the fourth group of nodes to obtain the assertion information contained in the fourth group of nodes, and performing corresponding conversion operations according to the guard declaration rules and update function declaration rules in the SBIP model; locating the nodes corresponding to the delay information on the abstract syntax tree AST as the fifth group of nodes to obtain the event information contained in the fifth group of nodes, and performing corresponding conversion operations according to the port declaration rules and update function declaration rules in the SBIP model.

[0206] According to the system of the second aspect, the grammatical rules of the Guard conversion system GTS model are described using the metalanguage of the language recognition tool ANTLR to generate an abstract syntax tree AST of the Guard conversion system GTS model; specifically including: using the metalanguage of the language recognition tool ANTLR to describe the grammatical rules of the Guard conversion system GTS model to write the corresponding grammar file gts.g4, running the built-in program of the language recognition tool ANTLR to form the grammar and lexical parser of the Guard conversion system GTS model, inputting the Guard conversion system GTS model code, checking the correctness of the code writing, and generating the corresponding abstract syntax tree AST.

[0207] According to the system of the second aspect, the conversion rules of the variable part are: the state variables and flow variables in the guard conversion system GTS model are represented by ordinary variables of the SBIP model, wherein the variable initialization keywords init and reset of the guard conversion system GTS model are converted to data in the SBIP model, and the variable type of the guard conversion system GTS model is converted according to the basic type correspondence rule of the SBIP model.

[0208] According to the system of the second aspect, the conversion rule of the migration part is:

[0209] The migration definition of the Guard conversion system GTS model:

[0210] "transition"EventReference":"Expression

[0211] “->”Instruction

[0212] Translates to:

[0213] "on"port_name"from"place_name"to"

[0214] place_name"provided""("Expression")"

[0215] "delayabledo" "{"Instruction"}"

[0216] As the migration definition in the SBIP model;

[0217] Among them, transition represents the migration keyword in the guard conversion system GTS model, EventReference represents the migration name in the guard conversion system GTS model, Expression represents the migration expression judgment in the guard conversion system GTS model, Instruction represents the migration instruction in the guard conversion system GTS model, and the migration definition in the guard conversion system GTS model is used to define a migration EventReference. When the defined migration satisfies the migration expression Expression, the defined migration executes the instruction Instruction;

[0218] Wherein, port_name represents the port name in the SBIP model, place_name represents the location name in the SBIP model, and when the migration defined by the migration definition in the SBIP model satisfies the migration expression Expression, the migration process moves from location place_name to location place_name through port port_name, and executes the instruction Instruction;

[0219] During the conversion process, the migration name EventReference of the Guard conversion system GTS model corresponds to the port name port_name of the SBIP model. There is no position definition for the Guard conversion system GTS model, and the position of the converted SBIP model is the user default position.

[0220] According to the system of the second aspect, the conversion rule of the assertion part is:

[0221] The assertion definition in the Guard conversion system GTS model:

[0222] "assertion"Instruction1";"

[0223] Translates to:

[0224] "initial to" place_name "do" Instruction1

[0225] "on"port_name"from"place_name"to"

[0226] place_name"provided""("Expression")"

[0227] "delayabledo""{"Instruction","Instruction1"}"

[0228] As an assertion definition in the SBIP model;

[0229] Wherein, assertion represents the assertion keyword in the guard conversion system GTS model, Instruction1 represents the assertion instruction in the guard conversion system GTS model, and the assertion definition in the guard conversion system GTS model is used to define an assertion Instruction1;

[0230] The assertion definition in the SBIP model is divided into two parts, one is the initial assertion, and the other is the execution assertion in migration;

[0231] During the conversion process, the assertion of the guard conversion system GTS model is mapped into two parts. The assertion instruction Instruction1 of the guard conversion system GTS model is converted into the assertion instruction in the initial assertion of the SBIP model, and the assertion instruction in the guard conversion system GTS model is converted into the execution assertion in the SBIP model migration.

[0232] According to the system of the second aspect, the delay rule of the event part is:

[0233] The delay definition in the Guard conversion system GTS model is:

[0234] "event"Path"(""delay"=OperatorCall

[0235] "("Expression1“)””)”

[0236] Translates to:

[0237] "@stochastic""(""dist="OperatorCall

[0238] ",""cly="x",""param="Expression1")"

[0239] "export port"type port_type_name"("")"

[0240] As the delay definition in the SBIP model;

[0241] Wherein, delay represents the delay keyword in the GTS model of the guard conversion system, OperatorCall represents the delay function name in the GTS model of the guard conversion system, Expression1 represents the delay function expression in the GTS model of the guard conversion system, and the delay definition in the GTS model of the guard conversion system is used to define the delay of the event Path following the OperatorCall function type;

[0242] The delay definition in the SBIP model is divided into two parts. The first part describes the delay characteristics, and the second part represents the output port definition. The delay definition in the SBIP model is used to define the delay of the output port port_type_name following the OperatorCall function type.

[0243] The third aspect of the present invention discloses an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps in any one of the model conversion methods described in the first aspect of the present disclosure are implemented.

[0244] Figure 3 is a structural diagram of an electronic device according to an embodiment of the present invention, such as Figure 3 As shown, the electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, near field communication (NFC) or other technologies. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covered on the display screen, or a button, a trackball or a touch pad set on the housing of the electronic device, or an external keyboard, touch pad or mouse, etc.

[0245] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a structural diagram of the part related to the technical solution of the present disclosure, and does not constitute a limitation on the electronic device to which the technical solution of the present application is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0246] The fourth aspect of the present invention discloses a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in any one of the model conversion methods described in the first aspect of the present disclosure are implemented.

[0247] In summary, the technical solution proposed in the present invention realizes the automatic conversion of the AltaRica3.0 flattened model GTS to the SBIP model, so that the AltaRica3.0 model can be used for statistical model detection, enriching the security analysis function of AltaRica3.0.

[0248] The technical effects that can be achieved by the technical solution provided by the present invention include: (1) pre-building a chain association relationship for the message, and strengthening the chain building based on the original sequence number and other information; (2) the network device separates the data packet forwarding and inspection by checking the chain association relationship, skips the ACL and other checks, and improves the forwarding efficiency; (3) in the device scheduling resources, minimizes the jitter, packet loss, and disorder of the data packet, reduces the delay, and ensures QoS; (4) after the chain check at the receiving end, it quickly transmits to the upper layer for processing, saves the network device cache resources, and reduces the CPU overhead.

[0249] Please note that the technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above-mentioned embodiments only express several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several variations and improvements can be made, which all belong to the scope of protection of the present application. Therefore, the scope of protection of the patent in this application shall be based on the attached claims.

Claims

1. A model conversion method, characterized in that: The method automatically converts a flattened model of AltaRica 3.0 into a SBIP model, wherein the flattened model of AltaRica 3.0 refers to a Guardian Transformation System GTS model; the method comprises: Using the metalanguage of the language recognition tool ANTLR to describe the grammatical rules of the Guard conversion system GTS model, so as to generate an abstract syntax tree AST of the Guard conversion system GTS model; The variable part, event part, migration part, assertion part and delay part of the guard conversion system GTS model are converted respectively by using the abstract syntax tree AST; wherein the conversion process is: Traverse the abstract syntax tree AST of the guard conversion system GTS model, according to the variable information, event information, migration information, assertion information and delay information defined by the metalanguage of the language recognition tool ANTLR; Locating nodes corresponding to the variable information on the abstract syntax tree AST as a first group of nodes to obtain the variable information contained in the first group of nodes, and performing corresponding conversion operations according to the variable declaration rules in the SBIP model; Locating nodes corresponding to the event information on the abstract syntax tree AST as a second group of nodes to obtain the event information contained in the second group of nodes, and performing corresponding conversion operations according to the port declaration rules in the SBIP model; Locating nodes corresponding to the migration information on the abstract syntax tree AST as a third group of nodes to obtain the migration information contained in the third group of nodes, and performing corresponding conversion operations according to the migration declaration rules, guard declaration rules, and update function declaration rules in the SBIP model; Locating nodes corresponding to the assertion information on the abstract syntax tree AST as a fourth group of nodes to obtain the assertion information contained in the fourth group of nodes, and performing corresponding conversion operations according to guard declaration rules and update function declaration rules in the SBIP model; Locating nodes corresponding to the delay information on the abstract syntax tree AST as a fifth group of nodes to obtain the delay information contained in the fifth group of nodes, and performing corresponding conversion operations according to the port declaration rules and update function declaration rules in the SBIP model; The conversion rules of the variable part are as follows: the state variables and flow variables in the GTS model of the guard conversion system are represented by the common variables of the SBIP model, wherein the variable initialization keywords init and reset of the GTS model of the guard conversion system are converted to data in the SBIP model, and the variable types of the GTS model of the guard conversion system are converted according to the basic type corresponding rules of the SBIP model; The conversion rule of the event part is: Define the events in the Guard conversion system GTS model: "event "Path";" Converts to: "export port"type port_type_name"("")" As an event definition in the SBIP model; Wherein, event represents the event keyword in the guard conversion system GTS model, Path represents the event name in the guard conversion system GTS model, and the event definition in the guard conversion system GTS model is used to define the event Path; Wherein, export port represents the output port keyword in the SBIP model, type represents the port type in the SBIP model, port_type_name represents the port name in the SBIP model, and the event definition in the SBIP model is used to define a port port_type_name of type type; During the conversion process, the event keyword event of the GTS model of the guard conversion system is converted to the output port keyword export port of the SBIP model, the event name Path of the GTS model of the guard conversion system corresponds to the port name port_type_name of the SBIP model, the GTS model of the guard conversion system does not have a port type definition, and the port type of the converted SBIP model is the user default type; The conversion rule of the migration part is: The migration definition of the Guard conversion system GTS model: "transition"EventReference":"Expression "->"Instruction Converts to: "on"port_name"from"place_name"to" place_name"provided""("Expression")" "delayabledo""{"Instruction"}" As the migration definition in the SBIP model; Among them, transition represents the migration keyword in the guard conversion system GTS model, EventReference represents the migration name in the guard conversion system GTS model, Expression represents the migration expression judgment in the guard conversion system GTS model, Instruction represents the migration instruction in the guard conversion system GTS model, and the migration definition in the guard conversion system GTS model is used to define a migration EventReference. When the defined migration satisfies the migration expression Expression, the defined migration executes the instruction Instruction; Wherein, port_name represents the port name in the SBIP model, place_name represents the location name in the SBIP model, and when the migration defined by the migration definition in the SBIP model satisfies the migration expression Expression, the migration process moves from location place_name to location place_name through port port_name, and executes the instruction Instruction; During the conversion process, the migration name EventReference of the Guard conversion system GTS model corresponds to the port name port_name of the SBIP model. The Guard conversion system GTS model does not have a location definition, and the location of the converted SBIP model is the user default location; The conversion rule of the assertion part is: The assertion definition in the Guard conversion system GTS model: "assertion"Instruction1";" Converts to: "initial to"place_name"do"Instruction1 "on"port_name"from"place_name"to" place_name"provided""("Expression")" "delayabledo""{"Instruction","Instruction1"}" As an assertion definition in the SBIP model; Wherein, assertion represents the assertion keyword in the guard conversion system GTS model, Instruction1 represents the assertion instruction in the guard conversion system GTS model, and the assertion definition in the guard conversion system GTS model is used to define an assertion Instruction1; The assertion definition in the SBIP model is divided into two parts, one is the initial assertion, and the other is the execution assertion in migration; During the conversion process, the assertion of the guard conversion system GTS model is mapped into two parts, the assertion instruction Instruction1 of the guard conversion system GTS model is converted into the assertion instruction in the initial assertion of the SBIP model, and the assertion instruction in the guard conversion system GTS model is converted into the execution assertion in the SBIP model migration; Among them, the delay rule of the event part is: The delay definition in the Guard conversion system GTS model is: "event"Path"(""delay"=OperatorCall "("Expression1")"")" Converts to: "@stochastic""(""dist="OperatorCall ",""cly="x",""param="Expression1")" "export port"type port_type_name"("")" As the delay definition in the SBIP model; Wherein, delay represents the delay keyword in the GTS model of the guard conversion system, OperatorCall represents the delay function name in the GTS model of the guard conversion system, Expression1 represents the delay function expression in the GTS model of the guard conversion system, and the delay definition in the GTS model of the guard conversion system is used to define the delay of the event Path following the OperatorCall function type; The delay definition in the SBIP model is divided into two parts. The first part describes the delay characteristics, and the second part represents the output port definition. The delay definition in the SBIP model is used to define the delay of the output port port_type_name following the OperatorCall function type.

2. A model conversion method according to claim 1, characterized in that: In the method, the grammatical rules of the Guardian Transformation System GTS model are described using the metalanguage of the language recognition tool ANTLR to generate an abstract syntax tree AST of the Guardian Transformation System GTS model; Specifically, it includes: using the metalanguage of the language recognition tool ANTLR to describe the grammatical rules of the Guard conversion system GTS model to write the corresponding grammar file gts.g4, running the built-in program of the language recognition tool ANTLR to form the grammar and lexical parser of the Guard conversion system GTS model, inputting the Guard conversion system GTS model code, checking the correctness of the code writing, and generating the corresponding abstract syntax tree AST.

3. A model conversion system, characterized in that: The system automatically converts the flattened model of AltaRica 3.0 into the SBIP model, wherein the flattened model of AltaRica 3.0 refers to the Guardian Conversion System GTS model; the module unit of the system is configured to perform: Using the metalanguage of the language recognition tool ANTLR to describe the grammatical rules of the Guard conversion system GTS model, so as to generate an abstract syntax tree AST of the Guard conversion system GTS model; The variable part, event part, migration part, assertion part and delay part of the guard conversion system GTS model are converted respectively by using the abstract syntax tree AST; wherein the conversion process is: Traverse the abstract syntax tree AST of the guard conversion system GTS model, according to the variable information, event information, migration information, assertion information and delay information defined by the metalanguage of the language recognition tool ANTLR; Locating nodes corresponding to the variable information on the abstract syntax tree AST as a first group of nodes to obtain the variable information contained in the first group of nodes, and performing corresponding conversion operations according to the variable declaration rules in the SBIP model; Locating nodes corresponding to the event information on the abstract syntax tree AST as a second group of nodes to obtain the event information contained in the second group of nodes, and performing corresponding conversion operations according to the port declaration rules in the SBIP model; Locating nodes corresponding to the migration information on the abstract syntax tree AST as a third group of nodes to obtain the migration information contained in the third group of nodes, and performing corresponding conversion operations according to the migration declaration rules, guard declaration rules, and update function declaration rules in the SBIP model; Locating nodes corresponding to the assertion information on the abstract syntax tree AST as a fourth group of nodes to obtain the assertion information contained in the fourth group of nodes, and performing corresponding conversion operations according to guard declaration rules and update function declaration rules in the SBIP model; Locating nodes corresponding to the delay information on the abstract syntax tree AST as a fifth group of nodes to obtain the delay information contained in the fifth group of nodes, and performing corresponding conversion operations according to the port declaration rules and update function declaration rules in the SBIP model; The conversion rules of the variable part are as follows: the state variables and flow variables in the GTS model of the guard conversion system are represented by the common variables of the SBIP model, wherein the variable initialization keywords init and reset of the GTS model of the guard conversion system are converted to data in the SBIP model, and the variable types of the GTS model of the guard conversion system are converted according to the basic type corresponding rules of the SBIP model; The conversion rule of the event part is: Define the events in the Guard conversion system GTS model: "event "Path";" Converts to: "export port"type port_type_name"("")" As an event definition in the SBIP model; Wherein, event represents the event keyword in the guard conversion system GTS model, Path represents the event name in the guard conversion system GTS model, and the event definition in the guard conversion system GTS model is used to define the event Path; Wherein, export port represents the output port keyword in the SBIP model, type represents the port type in the SBIP model, port_type_name represents the port name in the SBIP model, and the event definition in the SBIP model is used to define a port port_type_name of type type; During the conversion process, the event keyword event of the GTS model of the guard conversion system is converted to the output port keyword export port of the SBIP model, the event name Path of the GTS model of the guard conversion system corresponds to the port name port_type_name of the SBIP model, the GTS model of the guard conversion system does not have a port type definition, and the port type of the converted SBIP model is the user default type; The conversion rule of the migration part is: The migration definition of the Guard conversion system GTS model: "transition"EventReference":"Expression "->"Instruction Converts to: "on"port_name"from"place_name"to" place_name"provided""("Expression")" "delayabledo""{"Instruction"}" As the migration definition in the SBIP model; Among them, transition represents the migration keyword in the guard conversion system GTS model, EventReference represents the migration name in the guard conversion system GTS model, Expression represents the migration expression judgment in the guard conversion system GTS model, Instruction represents the migration instruction in the guard conversion system GTS model, and the migration definition in the guard conversion system GTS model is used to define a migration EventReference. When the defined migration satisfies the migration expression Expression, the defined migration executes the instruction Instruction; Wherein, port_name represents the port name in the SBIP model, place_name represents the location name in the SBIP model, and when the migration defined by the migration definition in the SBIP model satisfies the migration expression Expression, the migration process moves from location place_name to location place_name through port port_name, and executes the instruction Instruction; During the conversion process, the migration name EventReference of the Guard conversion system GTS model corresponds to the port name port_name of the SBIP model. The Guard conversion system GTS model does not have a location definition, and the location of the converted SBIP model is the user default location; The conversion rule of the assertion part is: The assertion definition in the Guard conversion system GTS model: "assertion"Instruction1";" Converts to: "initial to"place_name"do"Instruction1 "on"port_name"from"place_name"to" place_name"provided""("Expression")" "delayabledo""{"Instruction","Instruction1"}" As an assertion definition in the SBIP model; Wherein, assertion represents the assertion keyword in the guard conversion system GTS model, Instruction1 represents the assertion instruction in the guard conversion system GTS model, and the assertion definition in the guard conversion system GTS model is used to define an assertion Instruction1; The assertion definition in the SBIP model is divided into two parts, one is the initial assertion, and the other is the execution assertion in migration; During the conversion process, the assertion of the guard conversion system GTS model is mapped into two parts, the assertion instruction Instruction1 of the guard conversion system GTS model is converted into the assertion instruction in the initial assertion of the SBIP model, and the assertion instruction in the guard conversion system GTS model is converted into the execution assertion in the SBIP model migration; Among them, the delay rule of the event part is: The delay definition in the Guard conversion system GTS model is: "event"Path"(""delay"=OperatorCall "("Expression1")"")" Converts to: "@stochastic""(""dist="OperatorCall ",""cly="x",""param="Expression1")" "export port"type port_type_name"("")" As the delay definition in the SBIP model; Wherein, delay represents the delay keyword in the GTS model of the guard conversion system, OperatorCall represents the delay function name in the GTS model of the guard conversion system, Expression1 represents the delay function expression in the GTS model of the guard conversion system, and the delay definition in the GTS model of the guard conversion system is used to define the delay of the event Path following the OperatorCall function type; The delay definition in the SBIP model is divided into two parts. The first part describes the delay characteristics, and the second part represents the output port definition. The delay definition in the SBIP model is used to define the delay of the output port port_type_name following the OperatorCall function type.

4. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps in the model conversion method described in any one of claims 1-2 are implemented.

5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the model conversion method described in any one of claims 1-2 are implemented.