An automated static model checking method and device
Through the automated static model inspection method, checking whether the model complies with pre-set rules, solving the problem of increasing complexity of model design, improving efficiency and quality, and reducing labor costs.
Patent Information
- Application Number
- CN202111373836.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-18
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2041-11-18
AI Technical Summary
In model-based system development, it is difficult for the prior art to efficiently check whether the model complies with pre-set rules, resulting in increased model design complexity and increased labor and time costs.
采用自动化的静态模型检查方法,通过制定和执行规则检查项,基于模型的使用场景和需求在设计平台上建立脚本,提取和量化描述模型特征,进行符合性检查,生成定制化规则检查报告。
It reduces the work burden of model designers, improves the efficiency and quality of model design, saves manpower, and ensures the accuracy and reliability of the model.
Smart Images

Figure CN114116470B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software, and in particular to an automated static model checking method and device, which are used to automatically check whether a system design model complies with preset rules. Background Art
[0002] In model-based system development, model design is a key link. Models designed based on requirements can be used for early model simulation verification and later code generation. The correctness of the model has a great impact on the efficiency and quality of the entire project. The system requirement specifications are decomposed according to customer requirements, and the high-level software requirements are decomposed based on this decomposition. When designing a system model according to the system requirement specifications or designing a model according to the high-level software requirements, if the model state machine has too many layers, the code complexity will increase, which will increase the time and labor costs for the management and testing of the later code.
[0003] When using model-based system design methods in engineering, on the one hand, a large number of models will be generated during the R&D process, and on the other hand, the model itself has a large number of features. When the model-specific application scenarios and system requirements are different, some model features need to be restricted. For example, in the civil aircraft R&D process, when designing models based on high-level requirements, it is necessary to limit the number of state layers to not be too many according to pre-set restriction rules, as well as the naming rules of the modules in the model (including length restrictions, symbol restrictions, etc.).
[0004] The existing model checking method is to check and control by designers during the design process, or by model reviewers during the review stage; it requires a lot of manpower and is inefficient. Summary of the invention
[0005] The purpose of the present invention is to provide an automated static model checking method for checking the restriction rules on the model in project requirements; reducing the workload of model designers and increasing the efficiency and quality of model design.
[0006] In order to achieve the above tasks, the present invention adopts the following technical solutions:
[0007] An automated static model checking method, comprising:
[0008] Formulate one or more rule check items according to requirements, and execute each rule check item in turn. After execution, collect all check results and generate a customized rule check report. The execution process of each rule check item includes:
[0009] Based on the usage scenarios and requirements of the model, a check rule is formulated to restrict the model, and then a script of the check rule is established on the design platform of the model, and the check rule is quantitatively described in the script;
[0010] According to the formulated inspection rules, relevant model features of the inspection rules are extracted in the script;
[0011] Based on the quantitative description of the inspection rules and the extracted relevant model features, a compliance check is performed to determine whether the model features conform to the quantitative description of the rules and output the inspection results.
[0012] Furthermore, the model is a graphic model, a mathematical model or a code model, wherein the graphic model refers to a visualized functional module flow chart designed according to requirements in a system design process based on model development.
[0013] Furthermore, the inspection rules refer to restrictions on the model based on the usage scenarios and requirements of the model, including but not limited to: restrictions on the model name, restrictions on the model modules, restrictions on the model hierarchy, restrictions on the model input and output dimensions, and restrictions on the model background.
[0014] Furthermore, the quantitative description of the checking rules refers to describing the model checking rules to be performed in a numerical range on the design platform of the model based on the language of the design platform.
[0015] Furthermore, the relevant model features refer to model attributes expressed in the language of the design platform on the model design platform, including model name, module name, input and output data types, dimensions, model frequency, and attributes related to rule items that need to be checked in the model hierarchy.
[0016] Furthermore, the compliance check refers to extracting model-related features and comparing them with the inspection rule items described quantitatively. If they are consistent, they are compliant, and if they are inconsistent, they are not compliant.
[0017] Furthermore, when the checking rule is that the module name of each layer in the model must be unique, the quantitative description of the checking rule is: the number of occurrences of each module name in each layer of the model must not be greater than 1;
[0018] The execution process of the rule check item corresponding to the check rule is as follows:
[0019] Extract all module names of the top-level model in the script; count the number of times each module name appears. If it is greater than 1, the check item fails; if it is not greater than 1, determine whether the model has a next layer; if the model has a next layer, extract all module names of the next layer; repeat the previous operations, count the number of times each module name appears and perform a compliance check until the model does not have a next layer; if a module name appears more than 1 in any layer, the rule check item fails. If this situation does not occur in each layer, the rule check item passes.
[0020] Further, when the check rule is that the state machine in the model has at most 3 layers, the quantitative description of the check rule is: the level of each state machine in the model cannot exceed 3;
[0021] The execution process of the rule check item corresponding to the check rule is as follows:
[0022] Extract all state machines in the model in the script; calculate the number of layers of each state machine. If it is greater than 3, the check item fails; if it is not greater than 3, the check item passes; return the check result and generate a check report together with other check item results.
[0023] An automated static model checking device, comprising:
[0024] The formulation and generation module is used to formulate one or more rule check items according to the requirements, and execute each rule check item in turn. After the execution is completed, all check results are collected and a customized rule check report is generated; wherein the execution process of each rule check item in the formulation and generation module is implemented by the following units:
[0025] The checking and describing unit is used to formulate a checking rule for restricting the model based on the usage scenario and requirements of the model, and then establish a script of the checking rule on the design platform of the model, and quantitatively describe the checking rule in the script;
[0026] An extraction unit, used to extract relevant model features of the inspection rule in the script according to the formulated inspection rule;
[0027] The judgment unit is used to perform a conformity check based on the quantitative description of the inspection rule and the extracted relevant model features, judge whether the model features conform to the quantitative description of the rule, and output the inspection result.
[0028] A terminal device comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the automated static model checking method are implemented.
[0029] A computer-readable storage medium stores a computer program, which implements the steps of the automated static model checking method when executed by a processor.
[0030] Compared with the prior art, the present invention has the following technical features:
[0031] 1. The present invention can formulate model checking rules and make quantitative descriptions according to the needs of projects and engineering; automatically extract model-related features through scripts and perform compliance checks with quantitative checking rules, thus saving manual review of model content and ensuring the accuracy of the model.
[0032] 2. The present invention can automatically execute multiple inspection scripts and generate result reports, saving manpower, improving the efficiency and quality of model design, reducing workload, and performing partial inspection on the model before use, thereby improving the efficiency and accuracy of model design; it has strong versatility and improves the quality and reliability of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 is a flow chart of the automated static model checking method of the present invention;
[0034] Figure 2 is a case flow chart of a static model checking method in one embodiment of the present invention;
[0035] Figure 3 It is a case flow chart of an automated static model checking method in one embodiment of the present invention. DETAILED DESCRIPTION
[0036] 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 described clearly and completely below in conjunction with the accompanying 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 them.
[0037] See also Figure 1 The present invention provides an automated static model checking method, comprising:
[0038] Formulate one or more rule check items according to requirements, and execute each rule check item in turn. After execution, collect all check results and generate a customized rule check report. The execution process of each rule check item includes:
[0039] S1, based on the usage scenarios and requirements of the model, formulate a check rule to restrict the model, then establish a script of the check rule on the design platform of the model, and quantitatively describe the check rule in the script.
[0040] The model is a graphical model, a mathematical model or a code model, wherein the graphical model refers to a visual functional module flow chart designed according to requirements in a system design process based on model development. The quantitative description of the checking rules refers to a numerical range description of the model checking rules to be performed based on the language of the design platform on the model design platform.
[0041] S2, extracting relevant model features of the inspection rules in the script according to the formulated inspection rules.
[0042] The inspection rules refer to restrictions on the model based on the usage scenarios and requirements of the model, including but not limited to: restrictions on the model name, restrictions on the model modules, restrictions on the model hierarchy, restrictions on the model input and output dimensions, and restrictions on the model background.
[0043] For example, the restrictions on the model name may be the length of the name, the character type, etc.; the restrictions on the model module may be the number, attributes, etc. The relevant model features refer to the model attributes expressed in the language of the design platform on the model design platform, including: model name, module name, input and output data types, dimensions, model frequency, model level, etc., including the attributes related to the rule items that need to be checked.
[0044] S3, based on the quantitative description of the inspection rules and the extracted relevant model features, a compliance check is performed to determine whether the model features conform to the quantitative description of the rules, and the inspection results are output.
[0045] The conformity check refers to extracting the relevant features of the model and comparing them with the check rule items described quantitatively. If they are consistent, they are conformed, and if they are inconsistent, they are not conformed.
[0046] After a rule check item is executed, a check result is generated; the check results generated by all rule check items are summarized and processed to obtain a rule check report.
[0047] Example 1
[0048] Figure 2 This is a case flow chart of an automated static model checking method in one embodiment of the present invention. The rule checking item execution process in this embodiment is as follows:
[0049] 2.1 Formulate model rules according to project requirements: the module name of each layer in the model must be unique;
[0050] 2.2 Extract all module names of the top-level model in the script;
[0051] 2.3 Count the number of times each module name appears. If it is greater than 1, the check fails and goes to step 2.5. If it is not greater than 1, go to the next step;
[0052] 2.4 Check whether the model has the next layer. If so, extract all module names of the model in this layer and go to step 2.3. If not, go to step 2.6.
[0053] 2.5 If a model fails a check item, the check report will show that the check item failed and prompt "All model module names at the same layer should be unique."
[0054] 2.6 If the model passes this inspection, it will be shown in the inspection report as passed.
[0055] 2.7 Execute other scripts and generate an inspection result report together with the other script results.
[0056] Example 2
[0057] Figure 3 This is a case flow chart of an automated static model checking method in one embodiment of the present invention. The rule checking item execution process in this embodiment is as follows:
[0058] 3.1 Formulate model rules according to project requirements: the number of levels of each state machine in the model cannot exceed 3;
[0059] 3.2 Extract all state machines in the model in the script;
[0060] 3.3 Calculate the number of layers of each state machine. If it is greater than 3, the check item fails. If it is not greater than 3, the check item passes.
[0061] 3.4 If the model fails a check item, the check report will show that the check item failed and prompt "The state machine in the model has a maximum of 3 layers."
[0062] 3.5 If the model passes this inspection, it will be shown in the inspection report as passed.
[0063] 3.6 Execute other scripts and generate an inspection result report together with the other script results.
[0064] According to a second aspect of the present invention, there is provided an automated static model checking device, comprising:
[0065] The formulation and generation module is used to formulate one or more rule check items according to the requirements, and execute each rule check item in turn. After the execution is completed, all check results are collected and a customized rule check report is generated; wherein the execution process of each rule check item in the formulation and generation module is implemented by the following units:
[0066] The checking and describing unit is used to formulate a checking rule for restricting the model based on the usage scenario and requirements of the model, and then establish a script of the checking rule on the design platform of the model, and quantitatively describe the checking rule in the script;
[0067] An extraction unit, used to extract relevant model features of the inspection rule in the script according to the formulated inspection rule;
[0068] The judgment unit is used to perform a conformity check based on the quantitative description of the inspection rule and the extracted relevant model features, judge whether the model features conform to the quantitative description of the rule, and output the inspection result.
[0069] The functions of the above modules / units correspond to the relevant steps in the aforementioned method embodiment and will not be repeated here.
[0070] The present invention also provides a terminal device, which can be, for example, a computer, a server, etc.; it includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the automated static model checking method are implemented.
[0071] The present invention also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the automated static model checking method are implemented; the storage medium may be, for example, a disk, a storage array, various types of memories, etc.
[0072] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. An automated static model checking method, characterized in that: include: Formulate multiple rule check items according to requirements, and execute each rule check item in turn. After execution, collect all check results and generate a customized rule check report; The execution process of each rule check item includes: Based on the usage scenarios and requirements of the model, a check rule is formulated to restrict the model, and then a script of the check rule is established on the design platform of the model, and the check rule is quantitatively described in the script; According to the formulated inspection rules, relevant model features of the inspection rules are extracted in the script; Based on the quantitative description of the inspection rules and the extracted relevant model features, a compliance check is performed to determine whether the model features conform to the quantitative description of the rules and output the inspection results; Wherein, when the checking rule is that the module name of each layer in the model must be unique, the quantitative description of the checking rule is: the number of occurrences of each module name in each layer of the model must not be greater than 1; The execution process of the rule check item corresponding to the check rule is as follows: Extract all module names of the top-level model in the script; count the number of times each module name appears. If it is greater than 1, the rule check item fails; if it is not greater than 1, determine whether the model has a next layer; if the model has a next layer, extract all module names of the next layer; repeat the previous operations, count the number of times each module name appears and perform a compliance check until the model does not have a next layer; if a module name appears more than 1 in any layer, the rule check item fails. If this situation does not occur in each layer, the rule check item passes.
2. The automated static model checking method according to claim 1, characterized in that: The model is a graphic model, a mathematical model or a code model, wherein the graphic model refers to a visualized functional module flow chart designed according to requirements in a system design process based on model development.
3. The automated static model checking method according to claim 1, characterized in that: The inspection rules refer to restrictions on the model based on the usage scenarios and requirements of the model, including but not limited to: restrictions on the model name, restrictions on the model modules, restrictions on the model hierarchy, restrictions on the model input and output dimensions, and restrictions on the model background.
4. The automated static model checking method according to claim 1, characterized in that: The quantitative description of the checking rules refers to a numerical range description of the model checking rules that need to be performed on the design platform of the model based on the language of the design platform.
5. The automated static model checking method according to claim 1, characterized in that: The relevant model features refer to the model attributes expressed in the language of the design platform on the model design platform, including the model name, module name, input and output data types, dimensions, model frequency, and attributes related to the rule items that need to be checked in the model hierarchy.
6. The automated static model checking method according to claim 1, characterized in that: Conformity check refers to extracting model-related features and comparing them with the quantitatively described inspection rule items. If they are consistent, they are conforming, and if they are inconsistent, they are not conforming.
7. An automated static model checking device, characterized in that: include: The formulation and generation module is used to formulate multiple rule check items according to requirements, and execute each rule check item in turn. After the execution is completed, all check results are collected and a customized rule check report is generated; wherein the execution process of each rule check item in the formulation and generation module is implemented by the following units: The checking and describing unit is used to formulate a checking rule for restricting the model based on the usage scenario and requirements of the model, and then establish a script of the checking rule on the design platform of the model, and quantitatively describe the checking rule in the script; An extraction unit, used to extract relevant model features of the inspection rule in the script according to the formulated inspection rule; A judgment unit, used to perform a conformity check based on the quantitative description of the inspection rule and the extracted relevant model features, to judge whether the model features conform to the quantitative description of the rule, and to output the inspection result; Wherein, when the checking rule is that the module name of each layer in the model must be unique, the quantitative description of the checking rule is: the number of occurrences of each module name in each layer of the model must not be greater than 1; The execution process of the rule check item corresponding to the check rule is as follows: Extract all module names of the top-level model in the script; count the number of times each module name appears. If it is greater than 1, the rule check item fails; if it is not greater than 1, determine whether the model has a next layer; if the model has a next layer, extract all module names of the next layer; repeat the previous operations, count the number of times each module name appears and perform a compliance check until the model does not have a next layer; if a module name appears more than 1 in any layer, the rule check item fails. If this situation does not occur in each layer, the rule check item passes.
8. A terminal 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 steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored therein, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method for realizing model specification checking self-definition
CN106951606A
