Man-machine interaction software modeling simulation method and system conforming to A661 standard
By building interactive components that comply with A661 standards and generating Lustre code for simulation verification, the problems of low modeling efficiency and error prone to human-computer interaction software are solved, and efficient and accurate modeling process and model verification are achieved.
Patent Information
- Application Number
- CN202311465257.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-06
- Publication Date
- 2025-05-06
AI Technical Summary
The prior art is inefficient and error-prone in the human-computer interaction software modeling process, especially in the development of cockpit display systems that comply with the A661 standard, lacks effective modeling verification and simulation debugging support.
By building interactive components that comply with the A661 standard and building a visual model of human-computer interaction software based on these components, the corresponding Lustre code is generated for simulation verification, to ensure that the model complies with the A661 standard and runs correctly.
Improve modeling efficiency and accuracy, ensure that the generated models comply with the A661 standard, reduce the tedious process of developers manually comparing the standards, and enhance the integrity and operability of the model.
Smart Images

Figure CN119938215A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of human-computer interaction modeling, and in particular to a human-computer interaction software modeling simulation method and system that complies with the A661 standard. Background Art
[0002] In recent years, with the rapid development of information technology and software intelligent development technology, people have a deeper understanding of the development and maintenance of safety-critical software systems and put forward higher requirements. Safety-critical software has attracted much attention. Human-computer interaction software is the top priority in the development process of safety-critical software. Typical safety-critical human-computer interaction software includes: cockpit display and control system, vital signs monitoring system, etc. Once there is a problem with this type of software, it will cause a very serious accident, causing casualties, property losses, ecological and environmental pollution and other problems. Therefore, people have put forward very strict requirements on the safety, reliability and stability of safety-critical human-computer interaction software in the form of specifications and standard documents, and it is necessary to study the design and development process of this type of software more carefully to meet these requirements. Compared with other conventional software, safety-critical human-computer interaction software has the following characteristics: strong interactivity, complex business logic, high development difficulty, long development time and high development cost. In view of the strong interactivity of safety-critical human-computer interaction software, a modeling language is needed to fully and accurately describe the entire interaction scenario and process.
[0003] At the same time, for the development of cockpit display systems, it is necessary to consider the standard specifications in the industry, and certain standards must be met in the process of completing the modeling. The ARINC 661 (A661 for short) standard is a standard for the data structure used in the interactive cockpit display system (CDS) and the communication interface between the CDS and the user application (UA). The standard defines in detail the components involved in the human-computer interaction system, including the type of component, the description of the component, and determines the interaction logic of the component through the description, and also standardizes the parameters of the component. Therefore, a modeling method that complies with the A661 standard is very necessary.
[0004] The A661 standard is a standard for the interface between cockpit display systems and user systems. It is very important for safety-critical human-computer interaction software, especially aviation cockpit display systems, which have very strict specifications, to comply with the standard. If developers need to develop in the modeling environment by themselves in accordance with the A661 standard during the modeling process, this process is relatively cumbersome and the modeling efficiency is low. In addition, the existing human-computer interaction software cannot perform simulation debugging after generating a visual model, and it is difficult for developers to confirm whether the model meets the requirements, resulting in a lack of verification support for the entire modeling process and possible errors in the model. Summary of the invention
[0005] In view of the above analysis, an embodiment of the present invention aims to provide a human-computer interaction software modeling verification method and system that complies with the A661 standard, so as to solve the problem that the existing modeling is inefficient and prone to errors.
[0006] On the one hand, an embodiment of the present invention provides a human-computer interaction software modeling and simulation method that complies with the A661 standard, comprising the following steps:
[0007] Build interactive components that comply with the A661 standard; build Lustre code templates corresponding to each interactive component;
[0008] Building a visualization model of the human-computer interaction software based on the interaction component; generating Lustre code corresponding to the visualization model of the human-computer interaction software based on the Lustre code template corresponding to the interaction component;
[0009] The visualization model of the human-computer interaction software is simulated and verified based on the Lustre code.
[0010] Based on the further improvement of the above method, the visualization model of the human-computer interaction software is constructed based on the interaction component, including:
[0011] Establish the metamodel of LIDL visual modeling language, and generate data type definition table, interface type definition table, interaction type definition table and interaction architecture definition view according to the metamodel;
[0012] Define the data class, interface class and interaction class of the human-computer interaction software respectively through the data type definition table, interface type definition table and interaction type definition table; bind the interaction components according to the type of the interaction class;
[0013] Based on the defined data classes, interface classes and interaction classes, the interaction nodes and the connection relationships between the interaction nodes are created through the interaction view to obtain a visual model of the constructed human-computer interaction software.
[0014] Based on the further improvement of the above method, the Lustre code corresponding to the visualization model of the human-computer interaction software is generated based on the Lustre code template corresponding to the interaction component, including:
[0015] Find the root nodes in the interactive nodes of the visualization model. For each root node, perform the following steps:
[0016] S241, taking the root node as the current node;
[0017] S242, generating Lustre code corresponding to the current node according to the Lustre code template corresponding to the interactive component bound to the interactive class of the current node, and marking the current node as a processed node;
[0018] S243. Check whether there is an interactive node that is connected to the input interface of the current node and is not a processed node. If so, take each interactive node that is connected to the input interface of the current node and is not a processed node as the current node, and return to step S242. If all interactive nodes are processed nodes, stop iteration and obtain the Lustre code corresponding to the visualization model.
[0019] Based on the further improvement of the above method, the Lustre code corresponding to the current node is generated according to the Lustre code template corresponding to the interactive component bound to the interactive class of the current node, including:
[0020] If the Lustre code for the interaction class corresponding to the current node does not exist, generate the Lustre code for the interaction class corresponding to the current node;
[0021] Generate the Lustre code corresponding to the current node in the main node of the Lustre code text.
[0022] Based on the further improvement of the above method, the Lustre code of the interaction class corresponding to the current node is generated, including:
[0023] Map the name of the interaction class corresponding to the current node to the node name in the Lustre code template corresponding to the interaction component;
[0024] Map the member interface of the interaction class corresponding to the current node to the parameters in the Lustre code template corresponding to the interaction component.
[0025] Based on the further improvement of the above method, the member interface of the interaction class corresponding to the current node is mapped to the parameters in the Lustre code template corresponding to the interaction component, including:
[0026] If the interface direction of the member interface of the interaction class corresponding to the current node is in, the member interface is mapped to the input parameter in the Lustre code template; if the interface direction of the member interface of the interaction class corresponding to the current node is out, the member interface is mapped to the return parameter in the Lustre code template.
[0027] Based on the further improvement of the above method, the visualization model of the human-computer interaction software is simulated and verified based on Lustre code, including:
[0028] The Lustre tool is used to simulate the generated Lustre code, and the input and output data during the execution of the simulation tool are obtained through the input and output stream acquisition method;
[0029] A monitor is constructed for the target interactive node; the monitor determines whether there is an error in the simulation process according to the input data and output data during the execution of the simulation tool;
[0030] If there is an error, the error is located based on the judgment result of the monitor.
[0031] Based on the further improvement of the above method, if there is an error, the error location is performed according to the judgment result of the monitor, including:
[0032] The suspiciousness of each line of code is calculated according to the following formula:
[0033]
[0034] Wherein, passed(e) indicates the number of test cases that executed the e-th line of code and passed the test, totalpassed indicates the total number of test cases that passed the test during the simulation, failed(e) indicates the number of test cases that executed the e-th line of code and failed the test, totalfailed indicates the total number of test cases that failed the test during the simulation, tested(e) indicates the number of test cases that executed the e-th line of code, and totaltested indicates the total number of test cases;
[0035] Localize the error to the most suspicious line of code.
[0036] On the other hand, an embodiment of the present invention provides a human-computer interaction software modeling and simulation system that complies with the A661 standard, including the following modules:
[0037] Interaction component building module, used to build interaction components that comply with the A661 standard; build the Lustre code template corresponding to each interaction component;
[0038] A visualization model building module, used to build a visualization model of human-computer interaction software based on the interaction components;
[0039] A Lustre code generation module, used to generate Lustre code corresponding to the visualization model of the human-computer interaction software based on the Lustre code template corresponding to the interaction component;
[0040] A model simulation module is used to simulate and verify the visualization model of the human-computer interaction software based on the Lustre code.
[0041] Based on the further improvement of the above system, the visualization model of the human-computer interaction software is simulated and verified based on Lustre code, including:
[0042] The Lustre tool is used to simulate the generated Lustre code, and the input and output data during the execution of the simulation tool are obtained through the input and output stream acquisition method;
[0043] A monitor is constructed for the target interactive node; the monitor determines whether there is an error in the simulation process according to the input data and output data during the execution of the simulation tool;
[0044] If there is an error, the error is located based on the judgment result of the monitor.
[0045] Compared with the prior art, the present invention constructs an interactive component that complies with the A661 standard; constructs a visualization model of human-computer interaction software based on the constructed interactive component, thereby introducing the A661 standard into the modeling process, and the generated visualization model complies with the A661 standard, and developers do not need to model by themselves in accordance with the A661 standard, thereby making the modeling process more convenient and standardized, and improving the modeling efficiency. At the same time, according to the Lustre code generation template corresponding to the constructed interactive component, the Lustre code corresponding to the visualization model is generated, and simulation verification is performed based on the Lustre code, thereby making the modeling process more complete, ensuring the integrity and operability of the model, and making the constructed model more accurate.
[0046] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The accompanying drawings are only used for the purpose of illustrating specific embodiments and are not to be considered as limiting the present invention. In the entire drawings, the same reference symbols represent the same components;
[0048] Figure 1 This is a flow chart of a method for modeling and verifying human-computer interaction software that complies with the A661 standard according to an embodiment of the present invention;
[0049] Figure 2 A block diagram of a human-computer interaction software modeling and verification system that complies with the A661 standard according to an embodiment of the present invention;
[0050] Figure 3 A schematic diagram of the metamodel structure of a visual modeling language according to an embodiment of the present invention;
[0051] Figure 4 Schematic diagram of the interaction architecture of an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0053] A specific embodiment of the present invention discloses a human-computer interaction software modeling verification method that complies with the A661 standard, such as Figure 1 As shown, the following steps are included:
[0054] S1. Build interactive components that comply with the A661 standard; build Lustre code templates corresponding to each interactive component;
[0055] S2. constructing a visualization model of the human-computer interaction software based on the interaction component; generating Lustre code corresponding to the visualization model of the human-computer interaction software based on the Lustre code template corresponding to the interaction component;
[0056] S3. Perform simulation verification on the visualization model of the human-computer interaction software based on the Lustre code.
[0057] The present invention constructs an interactive component that complies with the A661 standard; and constructs a visualization model of human-computer interaction software based on the constructed interactive component, thereby introducing the A661 standard into the modeling process, and the generated visualization model complies with the A661 standard, and developers do not need to model by themselves in accordance with the A661 standard, thereby making the modeling process more convenient and standardized, and improving the modeling efficiency. At the same time, according to the Lustre code generation template corresponding to the constructed interactive component, the Lustre code corresponding to the visualization model is generated, and simulation verification is performed based on the Lustre code, thereby making the modeling process more complete, ensuring the integrity and operability of the model, and making the constructed model more accurate.
[0058] The content of A661 standard components includes information such as component type, component behavior description, and component parameters. The interactive type components have interactive capabilities and meet the needs of user application logic modeling. The 19 standard interactive components in the A611 standard are CheckButton, ComboBox, EditBoxMasked, EditBoxNumeric, EditBoxText, PicturePushButton, PictureToggleButton, PopUpMenu, PopUpMenuButton, PushButton, ScrollList, TabbedPanelGroup, ToggleButton, EditBoxMultiLine, ComboBoxEdit, ProxyButton, PopUpPanel, Slider, and SelectionListButton. In addition to defining the component types, the standards also define the interactive logic and component parameters. The interactive logic part specifies the functions that the component can perform, and the parameters need to be added as attributes of the corresponding component class when designing the metamodel to make the language conform to the standard. Taking the typical component PushButton as an example, its function is defined as a momentary switching button in the form of text description in the standard document. An activation signal can be sent through PushButton, and its parameters are specified, namely Alignment (text alignment in the component's label area), LabelString (component's label content), and MaxStringLength (maximum length of the component's label text content).
[0059] During implementation, first generate the corresponding standard interactive component class according to the definition and parameters of the interactive component specified in the standard, and build the interactive component that complies with the A661 standard. For example, for the PushButton component, build the corresponding standard interactive component class PushButton, which contains the properties Alignment, LabelString, and MaxStringLength.
[0060] For each standard interaction component class, the corresponding Lustre code template is generated according to the interaction logic specified in the standard. For example, the input of the PushButton component is an Activation type activation signal activated, a bool type button trigger signal pushed, and the output is a bool type signal clicked. activated represents whether the component is activated. When activated is true, it means that the interaction logic can be completed normally. When activated is false, the interaction logic cannot be completed. The input variable pushed refers to the action of pressing the PushButton button, and the interaction logic of the button is triggered by pushed being true. clicked is used as an output variable to pass the signal to other interactions. The overall logic is that when activated is in the activated state, the pushed signal of the input button press passes the signal to other interactions through clicked.
[0061] Therefore, the corresponding Lustre code template is:
[0062] node PushButton(pushed:bool;activated:Activation)returns
[0063] (clicked:bool);
[0064] let
[0065] clicked=Assignment_Bool(activated,pushed);
[0066] tel
[0067] For example, CheckButton is a button that switches between selected and unchecked. Whenever the button is pressed, the selected state is switched to unchecked, or unchecked is switched to selected. Therefore, the code is designed as follows. First, the input variable activated is an Activation type variable. The variable is logically expressed as a true / false Boolean value representing whether the component is activated. As an input, when activated is true, it is an activated signal that can complete the interaction logic normally. When activated is false, it is an unactivated signal that cannot complete the interaction logic. In addition, the input variable pushed is a bool type variable, which refers to the action of pressing the CheckButton button. The interaction logic of the button is triggered by pushed being true. For these two input variables, first, it is necessary to determine that when both variables are true, it means that the button is pressed in the activated state, and the selected state should be switched. The selected state is recorded by CheckButtonState. pre(CheckButtonState) is the state at the previous moment. According to the state at the previous moment, it can be switched to the opposite state, and the bool value of the current state CheckButtonState is used as the output variable.
[0068] Therefore, the corresponding Lustre code template is:
[0069] node CheckButton(pushed:bool;activated:Activation)returns
[0070] (CheckButtonState:bool);
[0071] var
[0072] ident_inPushed,clicked:bool;
[0073] let
[0074] ident_inPushed = pushed;
[0075] clicked=Assignment_Activation(activated,ident_inPushed);
[0076] CheckButtonState=(if clicked then true else false)->(if
[0077] clicked then not(pre(CheckButtonState))else
[0078] pre(CheckButtonState));
[0079] tel
[0080] Follow the same process to build the Lustre code template corresponding to each interactive component.
[0081] The interaction classes in the human-computer interaction software model are divided into three types: action interaction type, display interaction type, and custom interaction type. The action interaction class means that the corresponding action needs to be executed through external triggers. The display interaction class is used to display according to the internal trigger of the model. Those that do not belong to the action interaction class and the display interaction class belong to the custom interaction class. The A661 standard interaction component corresponds to the action interaction type. For the display interaction type and other interaction types, a default interaction component is constructed to correspond to it. The Lustre code template corresponding to the default interaction component is:
[0082] node default(…)returns(…);
[0083] let
[0084] …
[0085] tel
[0086] After building the interaction components that meet the A661 standard, the visualization model of the human-computer interaction software is built based on the interaction components. During implementation, the visualization model can be generated based on the LIDL language.
[0087] The LIDL language originated from a research paper by Dr. Vincent of France. Starting from the background of safety-critical software, it aims to propose a method for designing critical embedded human-computer interaction software systems. It combines the two fields of critical software engineering and interactive software engineering, analyzes, summarizes and summarizes some key issues in the development of such software systems, such as timely response, concurrency, integrity, reliability, availability, security, maintainability, etc. On this basis, he designed and proposed the LIDL language, discussed the grammatical rules and design concepts of the LIDL language in detail, and gave construction examples. The LIDL language model consists of three basic parts: data types, interfaces, and interactions. For the implementation of these three parts, the LIDL language grammar rules adopt a design method that is very close to human natural language, which allows developers to clearly and accurately obtain the implemented functions through the LIDL language code, which also provides great help for the convenience of implementing human-computer interaction software systems.
[0088] Specifically, constructing a visualization model of human-computer interaction software based on the interaction component includes:
[0089] S21, establish a metamodel of the LIDL visual modeling language, and generate a data type definition table, an interface type definition table, an interaction type definition table, and an interaction architecture definition view according to the metamodel;
[0090] S22, respectively define the data class, interface class and interaction class of the human-computer interaction software through a data type definition table, an interface type definition table and an interaction type definition table; bind the interaction component according to the type of the interaction class;
[0091] S23. Based on the defined data classes, interface classes and interaction classes, interactive nodes and connection relationships between interactive nodes are created through an interactive view to obtain a visualization model of the constructed human-computer interaction software.
[0092] During implementation, firstly, according to the definition of the above three components in the LIDL modeling language, a metamodel of the LIDL visual modeling language can be established. Figure 3 As shown. During implementation, the Eclipse Sirius framework can be used to build a metamodel. The Sirius framework can automatically generate framework code based on the constructed metamodel. There are 8 classes, 13 combination relationships and two application relationships in the metamodel. The corresponding classes for data types, interactions and interfaces in the metamodel are Datatype, Interface and Interaction respectively. Since the definitions of data types, interfaces and interactions are all structured information, in order to facilitate representation, the table form is used as the definition input view of these three types. Therefore, these three types can also be composed of corresponding table classes, namely DatatypeTable, InterfaceTable and InteractionTable, namely data type definition table, interface type definition table and interaction type definition table. These three table classes are all derived from the table factory class (TableFactory). Based on the three table classes in the metamodel, the three concepts in the LIDL visual modeling language can be visualized in the form of table views.
[0093] During implementation, the table view (Edition Table Description) of the Sirius framework may be used to configure and generate a data type definition table, an interface type definition table, and an interaction type definition table.
[0094] The header of the data type definition table includes the data class name, member name, and member type. The member type includes the basic data types Number, Text, Boolean, and Activation.
[0095] The header of the interface class definition table includes the interface class name, member name, member type and interface direction, wherein the member type is the data type or basic data type defined in the data type definition table.
[0096] The header of the interaction class definition table includes the interaction class name, member interface name, member interface class name and interface range.
[0097] In order to facilitate modelers to clearly and intuitively represent the relationship between interactions, the interaction relationship is defined in graphical form.
[0098] During implementation, the default graphic elements of the Sirius framework can be used as the default layer of the interaction architecture view. The container element (Container) in Sirius can be configured as Interaction, which represents the interaction in the interaction architecture diagram. The interaction is illustrated as a rectangular block, and the interface in the interaction is illustrated as a small rectangular block on the edge of the rectangular block. The element-based edge (ElementBased Edge) is configured as Interface Exchange, which represents the relationship between the interactions in the interaction architecture diagram connected by interfaces.
[0099] Modelers define data classes, interface classes, and interaction classes in human-computer interaction software through data type definition tables, interface type definition tables, and interaction type definition tables.
[0100] During implementation, we take a counter as an example. The human-computer interaction software of the counter includes three buttons and a digital display area; the three buttons are "plus", "minus" and "reset". Each time the user presses the "plus" button, the number in the digital display area will increase by one; each time the "minus" button is pressed, the displayed number will decrease by one; each time the user presses the "reset" button, the displayed number will become zero.
[0101] The modeler defines the data types used by the human-computer interaction software in the data type definition table, defines the interfaces included in the human-computer interaction software in the interface type definition table, and defines the interaction classes of the human-computer interaction software in the interaction type definition table. The interaction classes in the counter human-computer interaction software include: NumberDisplay (digital display area interaction class), PushButton (button interaction class), Counter (counter calculation interaction class) and MainUI (main interface interaction class that connects the various interaction modules of the counter). The definitions of the NumberDisplay class, PushButton class and Counter class are shown in Table 1.
[0102] Table 1 Interaction definition table
[0103]
[0104] Corresponding to the interaction in the counter human-computer interaction software above, NumberDisplay belongs to the display interaction type, PushButton belongs to the action interaction type, Counter and MainUI belong to the custom interaction type. PushButton interaction can be bound to the PushButton interaction component. NumberDisplay and Counter are bound to the default interaction component.
[0105] Modelers can add interaction nodes (i.e., interaction instances corresponding to interaction classes) and interaction relationships between interaction nodes in the interaction architecture definition view according to the relationship between interactions, and obtain the visualization model corresponding to the human-computer interaction software. The main interface of the counter contains three buttons and a digital display area, so three interaction nodes of the PushButton class (plusBut, minusBut, and resetBut) and an interaction node numberDisplay of the NumberDisplay class are added to the main interface. The software also includes an interaction node counter of the Counter class for internal interaction. Figure 4 An example diagram of the interaction architecture built for modelers. plusBut, minusBut, and resetBut send activation signals to counter through their clicked interfaces, and counter sends display data to numberDisplay through its counterDisplay interface. It should be noted that in the interaction architecture view, the interface names of the interaction nodes can be configured by yourself. For example, the clicked interface of plusBut is configured as plusclicked, which is convenient for distinguishing between different PushButtons.
[0106] Modelers can define data types, interface types, and interaction types through data class definition tables, interface class definition tables, and interaction class definition tables, and define interaction relationships through interaction architectures. This makes modeling efficient and error-prone, and can clearly display model hierarchies, facilitating model simulation verification.
[0107] After obtaining the visualization model, the model is first checked for consistency and integrity. After passing the verification, the Lustre code corresponding to the visualization model of the human-computer interaction software can be generated based on the Lustre code template corresponding to the interactive component.
[0108] The verification of the visualization model includes: obtaining each member interface class name in the interaction class definition corresponding to the interaction node, and determining whether the member interface class name exists in the interface definition table. If not, the verification fails; reading the interaction instances constructed in the interaction architecture definition view and the interface connection relationships between the interaction instances, and verifying the interface connection relationships of the interaction instances according to the definition information of the interface class.
[0109] Specifically, the interface connection relationship of the interaction instance is verified according to the definition information of the interface class, including:
[0110] For each connection line in the interaction architecture definition view, obtain a source interface instance and a target interface instance connected by the connection line;
[0111] According to the interface class name corresponding to the source interface instance, determine whether the interface direction of the source interface instance is the out direction. If not, the verification fails. According to the interface class name corresponding to the target interface instance, determine whether the interface direction of the target interface instance is the in direction. If not, the verification fails.
[0112] like Figure 4 As shown, the interaction type of numberDisplay is NumberDisplay. According to the definition information of the NumberDisplay class in the interaction definition table, the interface type of its theValue interface is Number_Input, that is, the interface class name is Number_Input. The interface direction of the Number_Input class is searched in the interface definition table. If it is in, the interface direction of theValue interface is in; if it is out, the interface direction of theValue interface is out. The source interface instance connected to theValue interface of numberDisplay is the counterDisplay interface in the counter interaction node, and its interface type is Number_Output. According to the interface definition table, its interaction direction is out. The interface direction of the Number_Output class is searched in the interface definition table. If it is in, the interface direction of the counterDisplay interface is in; if it is out, the interface direction of the counterDisplay interface is out.
[0113] If the interface direction of the source interface instance is out and the interface direction of the destination interface instance is in, the data flow direction is correct and the verification passes. Otherwise, the verification fails.
[0114] After verification, the Lustre code corresponding to the visualization model of the human-computer interaction software is generated based on the Lustre code template corresponding to the interactive component, including:
[0115] Find the root nodes in the interactive nodes of the visualization model. For each root node, perform the following steps:
[0116] S241, taking the root node as the current node;
[0117] S242, generating Lustre code corresponding to the current node according to the Lustre code template corresponding to the interactive component bound to the interactive class of the current node, and marking the current node as a processed node;
[0118] S243. Check whether there is an interactive node that is connected to the input interface of the current node and is not a processed node. If so, take each interactive node that is connected to the input interface of the current node and is not a processed node as the current node, and return to step S242. If all interactive nodes are processed nodes, stop iteration and obtain the Lustre code corresponding to the visualization model.
[0119] During implementation, traverse each interaction node in the interaction architecture diagram to find out whether it contains a member interface with an interface direction of out and a connection line with the member interface as the source interface. If not, the interaction node is the root node. For example, the aforementioned counter human-computer interaction software contains 5 interaction nodes, among which the numberDisplay interaction node has no member interface with a direction of out and a connection line with the interface as the source interface, so it is the root node.
[0120] Take the numberDisplay interaction node as the current node, and generate the corresponding Lustre code according to the Lustre code template corresponding to the interaction component bound to its corresponding interaction class NumberDisplay. The NumberDisplay class belongs to the display interaction type and is bound to the default interaction component. Therefore, generate the corresponding Lustre code according to the Lustre code template corresponding to the default interaction component.
[0121] After the code corresponding to the numberDisplay interaction node is generated, the numberDisplay interaction node is marked as a processed node. The interaction node connected to the input interface of the numberDisplay interaction node is searched, that is, the interaction node connected to the member interface of the numberDisplay interaction node with the direction in. The counter interaction node is connected to the input interface theValue of the numberDisplay interaction node, and the counter interaction node is not a processed node at this time. Then, the counter interaction node is taken as the current node, and the corresponding Lustre code is generated according to the Lustre code template corresponding to the interaction component bound to its interaction class Counter. After the code corresponding to the counter interaction node is generated, the counter interaction node is marked as a processed node. The interaction node connected to the input interface of the counter interaction node is searched. If plusBut, minusBut, and resetBut are all connected to the input interface of the counter interaction node, then plusBut, minusBut, and resetBut are taken as the current nodes, and their corresponding Lustre codes are generated. If all interaction nodes are processed nodes, the code generation ends, and the Lustre code corresponding to the visualization model is obtained.
[0122] Specifically, according to the Lustre code template corresponding to the interactive component bound to the interactive class of the current node, the Lustre code corresponding to the current node is generated, including:
[0123] If the Lustre code for the interaction class corresponding to the current node does not exist, generate the Lustre code for the interaction class corresponding to the current node;
[0124] Generate the Lustre code corresponding to the current node in the main node of the Lustre code text.
[0125] Specifically, the Lustre code for the interaction class corresponding to the current node is generated, including:
[0126] Map the name of the interaction class corresponding to the current node to the node name in the Lustre code template corresponding to the interaction component;
[0127] Map the member interface of the interaction class corresponding to the current node to the parameters in the Lustre code template corresponding to the interaction component.
[0128] Specifically, the member interface of the interaction class corresponding to the current node is mapped to the parameters in the Lustre code template corresponding to the interaction component, including:
[0129] If the interface direction of the member interface of the interaction class corresponding to the current node is in, the member interface is mapped to the input parameter in the Lustre code template; if the interface direction of the member interface of the interaction class corresponding to the current node is out, the member interface is mapped to the return parameter in the Lustre code template.
[0130] For example, for the plusBut interaction node, which is bound to the PushButton component, the corresponding interaction class name PushButton is mapped to the node name of the Lustre code template. The interaction class PushButton has three member interfaces in the definition table, the Activation_Input interface class, the Boolean_Input interface class, and the Boolean_Output interface class. Its member interfaces are mapped to the parameters of the Lustre code template. The interface directions of the Activation_Input interface class and the Boolean_Input interface class are in, so the member interface is mapped to the input parameter. The interface direction of the Boolean_Output interface class is out, so the member interface is mapped to the return parameter.
[0131] The generated Lustre code of the PushButton interaction class is:
[0132] node PushButton(pushed:Boolean_Input; activated:Activation_Input)
[0133] returns(clicked:Boolean_Output);
[0134] let
[0135] clicked=Assignment_Bool(activated,pushed);
[0136] tel
[0137] Then, in the main node of the Lustre code text, add the definition code of the plusBut interaction node:
[0138] Add variables to the variables block of the main node:
[0139] plusBut_pushed:Boolean_Input;
[0140] plusBut_activated:Activation_Input;
[0141] plusBut_clicked:Boolean_Output;
[0142] Add the instance code of the plusBut interaction node in the let / tel block of the main node:
[0143] plusBut_clicked=PushButton(plusBut_pushed;plusBut_activated).
[0144] The minusBut interaction node is also an instance of the interaction class PushButton. Since the interaction class PushButton has been defined, the code corresponding to the minusBut interaction node can be directly generated in the main node of the Lustre code text.
[0145] That is, add the variable minusBut_clicked: Boolean_Output to the variable block of the main node;
[0146] Add the instance code of the minusBut interaction node minusBut_clicked=PushButton(minusBut_pushed; minusBut_activated) in the let / tel block of the main node.
[0147] Modelers can modify the generated code text to meet customized functional requirements.
[0148] Since the interactive components are based on the A661 standard, the corresponding Lustre code also complies with the A661 standard.
[0149] After generating the Lustre code corresponding to the visualization model, the visualization model of the human-computer interaction software is simulated and verified based on the Lustre code.
[0150] Before simulation verification, in order to facilitate monitoring of each local variable and output variable in the model, the local variables of each node in the Lustre code are added as return parameters, that is, they are added to the brackets after its returns.
[0151] The visualization model of the human-computer interaction software is simulated and verified based on Lustre code, including:
[0152] The Lustre tool is used to simulate the generated Lustre code, and the input and output data during the execution of the simulation tool are obtained through the input and output stream acquisition method;
[0153] A monitor is constructed for the target interactive node; the monitor determines whether there is an error in the simulation process according to the input data and output data during the execution of the simulation tool;
[0154] If there is an error, the error is located based on the judgment result of the monitor.
[0155] The Lustre tool simulation tool is a simulation tool for Lustre code. It is a tool that uses command lines in a Linux environment. When implemented, the operating system command can be initiated through the Process class in the Java program to call the Lustre tool simulation tool, and then the input and output data of the Lustre tool simulation tool execution process can be obtained through the getInputStream() and getOutputStream() input and output stream acquisition methods, so as to facilitate the subsequent judgment of whether the simulation process is correct.
[0156] During implementation, variables in the simulation debugging process can be displayed in a table. For example, the Java SWT framework can be used to create a table to display the variables obtained through the input and output streams, the simulation node Node to which the variables belong, the variable type Variable Type, and the variable value Variable Value under each simulation step Step.
[0157] In order to facilitate rapid monitoring of the simulation process and error location, a monitor can be built for the interactive nodes in the visualization model of the human-computer interaction software to determine whether there are errors in the simulation process.
[0158] During implementation, a monitor is built for the target interaction node. For example, if you want to determine whether the minusBut interaction node meets the requirements, you can build a corresponding monitor and configure a judgment expression in it to determine whether the input and output data of the interaction node are logical.
[0159] For example, the monitor code built for the minusBut interaction node is as follows to determine whether the minus interaction node is executed correctly:
[0160] node minusBut_observer(minusBut_pushed; counterDislpay)returns(result:bool)
[0161] let
[0162] result=if(minusBut_pushed)and counterDislpay=pre(counterDislpay)-1
[0163] then true else false;
[0164] tel
[0165] If the output data after the subtraction interaction node is executed satisfies the subtraction logic, true is returned, that is, the test passes; otherwise, false is returned, that is, the test fails. The monitor results are synchronously displayed in the variable window, so you can intuitively see whether the current simulation process passes the monitor constraints. During implementation, multiple observers can be configured at the same time to meet more requirements in the simulation.
[0166] If the monitor outputs a false result during the simulation, the error code can be located in the following ways:
[0167] The suspiciousness of each line of code involved in the test item where the simulation failed:
[0168]
[0169] Among them, passed(e) represents the number of test cases that execute the e-th line of code and pass the test, totalpassed represents the total number of test cases that pass the test during the simulation process, failed(e) represents the number of test cases that execute the e-th line of code and fail the test, totalfailed represents the total number of test cases that fail the test during the simulation process, tested(e) represents the number of test cases that execute the e-th line of code, and totaltested represents the total number of test cases.
[0170] After calculating the suspicion of each line of code, the line of code with the highest suspicion is the line of code most likely to have an error, and the error is located in the line of code with the highest suspicion.
[0171] For example, the counter interaction software configures three monitors during the simulation process to verify whether the addition, subtraction, and reset signal interactions are correct.
[0172] During the simulation, 300 single-step executions were run, which means 300 test cases were run, of which the addition signal plusBut_pushed was 1 in 100 test cases to test the addition interaction node plusBut, the subtraction signal minusBut_pushed was 1 in 100 test cases to test the addition interaction node minusBut, and the reset signal resetBut_pushed was 1 in 100 test cases to test the addition interaction node resetBut. After simulation and verification by the monitor, it was found that 200 test cases of the addition signal and the reset signal passed, while 100 test cases of the subtraction signal did not pass.
[0173] For each test case, the statements executed are obtained, and the suspicion of each line of code is calculated according to the suspicion calculation formula (1). After ranking the lines of code from high to low in terms of suspicion, the line of code with the highest suspicion is the error code line, which makes it easier for modelers to quickly locate errors.
[0174] By simulating the test cases executed by Lustre code, the visual model of the constructed human-computer interaction software can be quickly simulated, thereby helping modelers to quickly determine whether the constructed model is correct.
[0175] A specific embodiment of the present invention discloses a human-computer interaction software modeling simulation system that complies with the A661 standard, such as Figure 2 As shown, it includes the following modules:
[0176] Interaction component building module, used to build interaction components that comply with the A661 standard; build the Lustre code template corresponding to each interaction component;
[0177] A visualization model building module, used to build a visualization model of human-computer interaction software based on the interaction components;
[0178] A Lustre code generation module, used to generate Lustre code corresponding to the visualization model of the human-computer interaction software based on the Lustre code template corresponding to the interaction component;
[0179] A model simulation module is used to simulate and verify the visualization model of the human-computer interaction software based on the Lustre code.
[0180] Preferably, the visualization model of the human-computer interaction software is simulated and verified based on the Lustre code, including:
[0181] The Lustre tool is used to simulate the generated Lustre code, and the input and output data during the execution of the simulation tool are obtained through the input and output stream acquisition method;
[0182] A monitor is constructed for the target interactive node; the monitor determines whether there is an error in the simulation process according to the input data and output data during the execution of the simulation tool;
[0183] If there is an error, the error is located based on the judgment result of the monitor.
[0184] The above method embodiments and system embodiments are based on the same principle, and their related parts can be used for reference, and can achieve the same technical effect. The specific implementation process refers to the above embodiment, which will not be repeated here.
[0185] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0186] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A human-computer interaction software modeling and simulation method that complies with the A661 standard, characterized in that: The following steps are involved: Build interactive components that comply with the A661 standard; build Lustre code templates corresponding to each interactive component; Constructing a visualization model of human-computer interaction software based on the interaction components; Generate Lustre code corresponding to the visualization model of the human-computer interaction software based on the Lustre code template corresponding to the interactive component; The visualization model of the human-computer interaction software is simulated and verified based on the Lustre code.
2. The human-computer interaction software modeling and simulation method according to the A661 standard according to claim 1, characterized in that: The visualization model of the human-computer interaction software based on the interaction component includes: Establish the metamodel of LIDL visual modeling language, and generate data type definition table, interface type definition table, interaction type definition table and interaction architecture definition view according to the metamodel; Define the data class, interface class and interaction class of the human-computer interaction software respectively through the data type definition table, interface type definition table and interaction type definition table; bind the interaction components according to the type of the interaction class; Based on the defined data classes, interface classes and interaction classes, interaction nodes and connection relationships between interaction nodes are created through the interaction view to obtain a visual model of the constructed human-computer interaction software.
3. The human-computer interaction software modeling and simulation method according to the A661 standard according to claim 1, characterized in that: The Lustre code corresponding to the visualization model of the human-computer interaction software generated based on the Lustre code template corresponding to the interactive component includes: Find the root nodes in the interactive nodes of the visualization model. For each root node, perform the following steps: S241, taking the root node as the current node; S242, generating Lustre code corresponding to the current node according to the Lustre code template corresponding to the interactive component bound to the interactive class of the current node, and marking the current node as a processed node; S243. Check whether there is an interactive node that is connected to the input interface of the current node and is not a processed node. If so, take each interactive node that is connected to the input interface of the current node and is not a processed node as the current node, and return to step S242. If all interactive nodes are processed nodes, stop iteration and obtain the Lustre code corresponding to the visualization model.
4. The human-computer interaction software modeling and simulation method according to the A661 standard according to claim 3 is characterized in that: Generate the Lustre code corresponding to the current node according to the Lustre code template corresponding to the interactive component bound to the interactive class of the current node, including: If the Lustre code for the interaction class corresponding to the current node does not exist, generate the Lustre code for the interaction class corresponding to the current node; Generate the Lustre code corresponding to the current node in the main node of the Lustre code text.
5. The human-computer interaction software modeling and simulation method according to A661 standard according to claim 4 is characterized in that: Generate Lustre code for the interaction class corresponding to the current node, including: Map the name of the interaction class corresponding to the current node to the node name in the Lustre code template corresponding to the interaction component; Map the member interface of the interaction class corresponding to the current node to the parameters in the Lustre code template corresponding to the interaction component.
6. The human-computer interaction software modeling and simulation method according to A661 standard according to claim 5, characterized in that: Map the member interface of the interaction class corresponding to the current node to the parameters in the Lustre code template corresponding to the interaction component, including: If the interface direction of the member interface of the interaction class corresponding to the current node is in, the member interface is mapped to the input parameter in the Lustre code template; if the interface direction of the member interface of the interaction class corresponding to the current node is out, the member interface is mapped to the return parameter in the Lustre code template.
7. The human-computer interaction software modeling and simulation method according to the A661 standard according to claim 1, characterized in that: The visualization model of the human-computer interaction software is simulated and verified based on Lustre code, including: The Lustre tool is used to simulate the generated Lustre code, and the input and output data during the execution of the simulation tool are obtained through the input and output stream acquisition method; A monitor is constructed for the target interactive node; the monitor determines whether there is an error in the simulation process according to the input data and output data during the execution of the simulation tool; If there is an error, the error is located based on the judgment result of the monitor.
8. The human-computer interaction software modeling and simulation method according to A661 standard according to claim 7, characterized in that: If there is an error, the error is located based on the monitor's judgment result, including: The suspiciousness of each line of code is calculated according to the following formula: Wherein, passed(e) indicates the number of test cases that executed the e-th line of code and passed the test, totalpassed indicates the total number of test cases that passed the test during the simulation, failed(e) indicates the number of test cases that executed the e-th line of code and failed the test, totalfailed indicates the total number of test cases that failed the test during the simulation, tested(e) indicates the number of test cases that executed the e-th line of code, and totaltested indicates the total number of test cases; Localize the error to the most suspicious line of code.
9. A human-computer interaction software modeling and simulation system that complies with the A661 standard, characterized in that: Includes the following modules: Interaction component building module, used to build interaction components that comply with the A661 standard; build the Lustre code template corresponding to each interaction component; A visualization model building module, used to build a visualization model of human-computer interaction software based on the interaction components; A Lustre code generation module, used to generate Lustre code corresponding to the visualization model of the human-computer interaction software based on the Lustre code template corresponding to the interaction component; A model simulation module is used to simulate and verify the visualization model of the human-computer interaction software based on the Lustre code.
10. The human-computer interaction software modeling and simulation system according to A661 standard according to claim 9, characterized in that: The visualization model of the human-computer interaction software is simulated and verified based on Lustre code, including: The Lustre tool is used to simulate the generated Lustre code, and the input and output data during the execution of the simulation tool are obtained through the input and output stream acquisition method; A monitor is constructed for the target interactive node; the monitor determines whether there is an error in the simulation process according to the input data and output data during the execution of the simulation tool; If there is an error, the error is located based on the judgment result of the monitor.