Variable reference method and device, electronic equipment, storage medium and product
By using graphical components to implement cross-layer variable calls on the model construction interface, the problems of complex variable calls and high code writing thresholds in large models are solved, and a simplified variable calling method and improved user experience are achieved.
Patent Information
- Application Number
- CN202510062434.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-05-13
AI Technical Summary
When building a large model with many components related to each other, variable calls are more complicated in the prior art, and there is a problem of high technical barriers for variable cross-level calls using code writing methods.
By rendering the first component and the second component to the model construction interface, at least one variable information to be referenced is determined based on a trigger operation on the first component and displayed at a preset location of the second component to implement cross-layer calls of variables based on the graphical component.
It simplifies the cross-level calling method of variables, improves user experience, has a certain universality, and solves the problems of complex variable calling and high technical threshold.
Smart Images

Figure CN119987921A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a variable reference method, device, electronic device, storage medium and product. Background Art
[0002] In the actual application scenarios of physical modeling, variables may be called hundreds or thousands of times across layers. For example, when assigning a value to variable X in a Modelica model with a model structure of a\b1\c1\d1\e1 and calling variable X in a Modelica model with a model structure of a\b2\c2\d2\e2\f2\g2\h2, the Input / Output method is usually used to first pass the signal corresponding to variable X from e1 to a layer by layer, and then from a to h2 layer by layer. This requires more than ten groups of interfaces or connections to implement the call of variable X.
[0003] However, the above cross-variable calling method is not only not practical, but also complicated when building a large model with many interrelated components, which is not conducive to the operation of the corresponding modeler. In addition, the cross-layer calling of variables can also be achieved by writing code, but this method has a certain technical threshold and low universality. Summary of the invention
[0004] The present invention provides a variable reference method, device, electronic device, storage medium and product, which realize cross-layer calling of variables based on graphical components, have certain universality and improve user experience.
[0005] According to one aspect of the present invention, a variable reference method is provided, the method comprising:
[0006] After rendering the first component and the second component to the model building interface, determining at least one variable information to be referenced based on a triggering operation on the first component;
[0007] At least one variable information to be referenced is displayed at a preset position of the second component, so that the variable information to be referenced corresponding to the first component is referenced based on the second component.
[0008] According to another aspect of the present invention, there is provided a variable reference device, the device comprising:
[0009] A variable information determination module, configured to determine at least one variable information to be referenced based on a trigger operation on the first component after rendering the first component and the second component to the model building interface;
[0010] The variable reference module is used to display at least one variable information to be referenced at a preset position of the second component, so as to reference the variable information to be referenced corresponding to the first component based on the second component.
[0011] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:
[0012] at least one processor; and
[0013] a memory communicatively connected to at least one processor; wherein,
[0014] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by at least one processor so that the at least one processor can execute the variable reference method of any embodiment of the present invention.
[0015] According to another aspect of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the variable reference method of any embodiment of the present invention when executed.
[0016] According to another aspect of the present invention, there is provided a computer program product, comprising a computer program, wherein the computer program implements the variable reference method according to any embodiment of the present invention when executed by a processor.
[0017] The technical solution of the embodiment of the present invention renders the first component and the second component to the model building interface, and determines at least one variable information to be referenced based on the trigger operation on the first component. The at least one variable information to be referenced is displayed at a preset position of the second component, so as to reference the variable information to be referenced corresponding to the first component based on the second component. Among them, the first component and the second component are both pre-created graphical components. The present invention solves the problem of complex variable calling when establishing a large model containing many interrelated components in the prior art, and the problem of high technical threshold for cross-level variable calling by writing code. The cross-level calling of variables is realized by the graphical first component and the second component, which simplifies the cross-level calling method of variables, has a certain universality, and improves the user experience.
[0018] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0020] Figure 1 is a flow chart of a variable reference method provided by an embodiment of the present invention;
[0021] Figure 2 is an example diagram of a setting interface of a first component provided by an embodiment of the present invention;
[0022] Figure 3 is an example diagram of a setting interface of a second component provided in an embodiment of the present invention
[0023] Figure 4 is a flow chart of a component generation method provided by an embodiment of the present invention;
[0024] Figure 5 is an example diagram of component style settings provided by an embodiment of the present invention;
[0025] Figure 6 It is a structural schematic diagram of a variable reference device provided by an embodiment of the present invention;
[0026] Figure 7 It is a structural schematic diagram of an electronic device for implementing the variable reference method of an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme 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 creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] Embodiment 1
[0030] Figure 1This is a flow chart of a variable reference method provided by the first embodiment of the present invention. This embodiment is applicable to the case where a variable is called across levels based on a graphical first component and a second component when constructing a Modelica model. The method can be executed by a variable reference device, which can be implemented in the form of hardware and / or software. The variable reference device can be configured in an electronic device such as a mobile phone, a computer or a server. Figure 1 As shown, the method includes:
[0031] S110: After rendering the first component and the second component to the model building interface, determine at least one variable information to be referenced based on a triggering operation on the first component.
[0032] In an embodiment of the present invention, in the scenario of building a Modelica model, the model building interface can be understood as a display interface for building the current Modelica model. The first component can be a graphical component generated based on the connector module. The setting interface corresponding to the first component can be used to define the variable information to be referenced. The variable information to be referenced can include the variable name, variable type and variable dimension of the variable to be referenced. The variable name of the variable to be referenced can be a string used to uniquely represent the variable to be referenced. The variable type of the variable to be referenced can be understood as the data type that the variable to be referenced can be set to. Optionally, in the scenario of building a Modelica model, the variable to be referenced is a Modelica variable, and the variable type of the variable to be referenced can be one of the variable types such as floating point type (Real) or integer type (Integer) or Boolean type (Boolean). The variable dimension of the variable to be referenced is usually related to an array, a matrix or a higher-dimensional data structure. The variable dimension can be used to describe the size of the data structure of the variable to be referenced in each dimension. The setting interface corresponding to the second component can be used to display or call the variable information to be referenced set on the first component.
[0033] Specifically, when constructing a Modelica model, the first component and the second component can be rendered to the model construction interface first, and in response to a trigger operation of the user on the setting interface of the first component, the referenced variable information of at least one referenced variable set by the user is obtained.
[0034] For example, see Figure 2 , Figure 2 The rectangle containing an X on the left side represents the first component, Figure 2 The right side is the setting interface of the first component. After the first component and the second component are rendered to the model building interface for building the Modelica model, in response to the user's double-click operation on the first component, the setting interface of the first component is displayed. Based on the user's triggering operation on the setting interface of the first component, at least one variable information to be referenced set by the user is obtained. For example, Figure 2 In the example, the variable name of the variable to be referenced is X, and the variable type is Real.
[0035] In an embodiment of the present invention, the method of rendering the first component and the second component to the model building interface may be: in response to a trigger operation on the model building interface, displaying the component interface, wherein the component interface includes at least one first component to be selected and at least one second component to be selected; based on the trigger selection on the component interface, determining the first component and the second component to be added to the model building interface, and rendering the first component and the second component to the model building interface.
[0036] Among them, the trigger operation of the model building interface can be understood as the operation of the user clicking the corresponding component setting control. The component interface may include at least one first component to be selected and at least one second component to be selected. The first component to be selected may be a pre-built graphical component for defining the variable information to be referenced. The second component to be selected may be a pre-built graphical component for displaying or calling the variable information to be referenced defined by the first component to be selected. The trigger selection on the component interface may be a trigger operation of selecting a first component from at least one first component to be selected, and a trigger operation of selecting a second component from at least one second component to be selected.
[0037] Specifically, in response to a trigger operation of a user clicking a corresponding component setting control in the model building interface, a component interface is displayed. The component interface may include at least one first component to be selected and at least one second component to be selected. In response to a trigger selection by a user in the component interface, the first component and the second component to be added to the model building interface selected by the user are determined, and the first component and the second component are rendered to the model building interface, so as to determine the variable information to be referenced based on the trigger operation of the first component in the model building interface.
[0038] S120: Display at least one variable information to be referenced at a preset position of the second component, so as to reference the variable information to be referenced corresponding to the first component based on the second component.
[0039] The preset position may be a pre-set position for displaying the variable information to be referenced. Optionally, the variable information to be referenced defined by the first component is displayed on a setting interface corresponding to the second component.
[0040] Specifically, the variable name, variable type and variable dimension of at least one variable to be referenced are displayed at a preset position of the setting interface of the second component, so as to realize the reference of the variable information to be referenced defined by the first component based on the second component reference based on the trigger operation on the second component.
[0041] For example, in conjunction with the above examples, see Figure 3 , Figure 3 This is an example diagram of the setting interface of the second component. Figure 3 The component containing an X on the left side represents the second component, Figure 3 On the right is the setting interface of the second component. If the variable name of the first variable to be referenced pre-set on the first component is X, the variable type is Real type, and the variable name of the second variable to be referenced is X1, and the variable type is Integer type, then at least one variable information to be referenced defined by the first component is displayed in the drop-down box corresponding to the setting interface of the second component, so as to realize the reference of the variable information to be referenced corresponding to the first component based on the second component based on the user's corresponding variable selection operation. For example, when the user selects the variable name of the variable to be referenced as X, the variable type and variable dimension corresponding to the variable to be referenced with the variable name X are displayed in the setting interface of the second component. It should be noted that after displaying the variable type and variable dimension corresponding to the variable to be referenced with the variable name X in the setting interface of the second component, the user can also modify the variable type and variable dimension corresponding to the variable to be referenced with the variable name X according to actual needs.
[0042] In an embodiment of the present invention, the variable information to be referenced includes the variable name, variable type and variable dimension of the variable to be referenced. The reference processing method for the variable information to be referenced may be: based on the trigger operation on the second component, determining the target variable name, wherein the target variable name is the variable name in the variable information to be referenced; based on the target variable name, displaying the target variable type and target variable dimension corresponding to the target variable name on the second component.
[0043] The trigger operation on the second component can be understood as the operation of the user selecting the variable to be referenced in the setting interface corresponding to the second component. The target variable name can be the variable name of the variable to be referenced selected by the user. The target variable type is the variable type corresponding to the target variable name in the variable information to be referenced. The target variable dimension can be understood as the variable dimension corresponding to the target variable name in the variable information to be referenced.
[0044] Specifically, based on the trigger selection operation of the user at the control corresponding to the variable name on the setting interface of the second component, the target variable name is determined. Based on the target variable name, the target variable type and target variable dimension corresponding to the target variable name in the variable information to be referenced are determined. And the target variable type and target variable dimension corresponding to the target variable name are displayed at the corresponding position of the setting interface of the second component.
[0045] Exemplarily, in combination with the above example, in response to the user's double-click operation on the second component, the setting interface corresponding to the second component is displayed. Based on the user's triggering selection operation of the drop-down box corresponding to the variable name on the setting interface of the second component, the variable name X of the variable to be referenced selected by the user, that is, the target variable name, is determined. Based on the target variable name X, the target variable type and target variable dimension corresponding to the target variable name X in the variable information to be referenced are determined and displayed at a preset position on the setting interface of the second component, that is, the target variable type corresponding to the target variable name X is displayed as a Real type.
[0046] The technical solution of this embodiment renders the first component and the second component to the model building interface, and determines at least one variable information to be referenced based on the trigger operation on the first component. The at least one variable information to be referenced is displayed at a preset position of the second component, so as to reference the variable information to be referenced corresponding to the first component based on the second component. Among them, the first component and the second component are both pre-created graphical components. The present invention solves the problem of complex variable calling when establishing a large model containing many interrelated components in the prior art, and the problem of high technical threshold for cross-level variable calling by writing code. The cross-level calling of variables is realized by the graphical first component and the second component, which simplifies the cross-level calling method of variables, has a certain universality, and improves the user experience.
[0047] Embodiment 2
[0048] Figure 4 This is a flowchart of a component generation method provided by the second embodiment of the present invention. The embodiment of the present invention is based on the above embodiment. Before triggering the selection of at least one first component to be selected and at least one second component to be selected on the component interface, the first component to be selected and the second component to be selected can be obtained first. The specific implementation method can refer to the technical solution of this embodiment. Among them, the technical terms that are the same or corresponding to the above embodiment are not repeated here. Figure 4 As shown, the method includes:
[0049] S210. Add a first prefix to the preset component text to generate a first connector module, and add a second prefix to the preset component text to generate a second connector module, wherein the first connector module is a connector module for defining variables, and the second connector module is a connector module for referencing variables.
[0050] Among them, the preset component text can be understood as the text used to generate the connector module. The first prefix can be used to limit the scope of the connector module. Optionally, the first prefix can be an inner prefix. The first connector module can be a connector module for top-level definition of variables generated based on the preset component text after adding the inner prefix. For example, the first connector module can be named the InnerMemory module. The second prefix can be used to limit the scope of the connector module. The second prefix can be an outer prefix. The second connector module can be a connector module for sub-layer reference variables based on the preset component text after adding the outer prefix. For example, the second connector module can be named the OuterMemory module.
[0051] Specifically, when generating a connector module based on a preset component text, a first prefix is automatically added to the preset component text using the default component prefix field annotated in the Modelica syntax to generate a first connector module. Also, a second prefix is automatically added to the preset component text using the default component prefix field annotated in the Modelica syntax to generate a second connector module.
[0052] Exemplarily, the first prefix is the inner prefix, the second prefix is the outer prefix, the default component prefix field is the defaultComponentPrefixes field, the first connector module is the InnerMemory module, and the second connector module is the OuterMemory module.
[0053] As a graphical connection method in physical modeling, connectors do not support cross-multi-level connections, but only support the interconnection between external connectors and internal connectors in the Modelica model. By adding the inner prefix or outer prefix when generating the connector module, cross-level calls to variables can be realized. The specific method can be: when generating a connector module based on the preset component text, the defaultComponentPrefixes field annotated in the Modelica syntax is used to automatically add the inner prefix or outer prefix to the preset component text, so as to generate the first connector module InnerMemory module based on the preset component text with the inner prefix added, and generate the second connector module OuterMemory module based on the preset component text with the outer prefix added. Based on this, the InnerMemory module is used to define the top-level inner connector, and the OuterMemory module is used as the outer reference connector of the sub-layer. It can be understood that the variable to be referenced defined by the InnerMemory module can be referenced through the OuterMemory module to realize cross-level calls of variables.
[0054] S220. Determine the inheritance relationship between the first connector module and the second connector module, and perform graphical processing on the first connector module and the second connector module to obtain a first component to be selected corresponding to the first connector module and a second component to be selected corresponding to the second connector module, so as to render the first component to be selected and the second component to be selected to the component interface.
[0055] The inheritance relationship may be used to characterize the association relationship between the first connector module and the second connector module, that is, the first connector module may obtain the variable type set by the second connector module.
[0056] Specifically, since the first connector module is a connector module that defines variables, and the second connector module is a connector module that references variables, the first connector module can be set to inherit the second connector module to achieve that all variables to be referenced referenced by the sublayer can be associated with the variables to be referenced defined in the top layer. The first connector module is graphically processed, that is, the first connector module is encapsulated to obtain a first component to be selected corresponding to the first connector module. Correspondingly, the second connector module is encapsulated to obtain a second component to be selected corresponding to the second connector module. Based on the above, at least one first component to be selected and at least one second component to be selected can be obtained, and the first component to be selected and the second component to be selected are rendered into the component interface to determine the first component and the second component based on the trigger operation on the component interface.
[0057] In an embodiment of the present invention, the inheritance relationship between the first connector module and the second connector module may be determined by coding the first connector module according to at least one preset variable type corresponding to the second connector module so that the first connector module inherits the preset variable type corresponding to the second connector module.
[0058] The preset variable type may be a pre-set variable type that can be set by the second connector module. For example, the preset variable type may be a floating point type (Real), an integer type (Integer), a Boolean type (Boolean), and the like.
[0059] Specifically, according to at least one preset variable type corresponding to the second connector module, the first connector module is coded so that the first connector module can inherit the preset variable type corresponding to the second connector module, making it convenient for subsequent users to set the variable type of the variable to be referenced in the first component corresponding to the first connector module.
[0060] Exemplarily, in combination with the above example, the first connector module may be an InnerMemory module, and the second connector module may be an OuterMemory module. Among them, the OuterMemory module may set multiple optional variable types, such as floating point type (Real), integer type (Integer), Boolean type (Boolean), etc. The inheritance relationship between the first connector module and the second connector module is determined as follows: the first connector module inherits the preset variable type of the second connector module, so that the variable to be referenced by the sub-layer reference can be associated with the variable to be referenced defined in the top layer. For example, the above inheritance relationship can be implemented by the code shown below.
[0061] connector InnerMemory=OuterMemory
[0062] annotation(defaultComponentPrefixes="inner");
[0063] connector OuterMemory=Real
[0064] annotation(defaultComponentPrefixes="outer");
[0065] Based on the above, we can know that if InnerMemory is defined at the top level and OuterMemory with the same name is defined at any sub-level, reading and writing are actually references to the inner variable defined at the upper level. In other words, the variable type of the second connector module is set to Real type, and the first connector module inherits the second connector module, so that the Real type variable to be referenced can be set in the first connector module.
[0066] In an embodiment of the present invention, the first connector module is graphically processed to obtain the first component to be selected by encapsulating the module name and module parameter information corresponding to the first connector module into the first component to determine the variable information to be referenced based on the first component.
[0067] The module name may be understood as the name of the first connector module. Different connector modules may be distinguished by the module name. The module parameter information may include configuration information or module attribute information of the first connector module, which is used to characterize the function of the first connector module.
[0068] Specifically, determine the module name of the first connector module and the module parameter information associated with the first connector module. Encapsulate the module name and the module parameter information into a first component to facilitate subsequent determination of the variable information to be referenced according to the trigger operation on the first component. It should be noted that the encapsulated first component contains the module name of the first connector module and all necessary module parameter information.
[0069] Correspondingly, the second connector module may be graphically processed to obtain the second component to be selected by encapsulating the module name and module parameter information corresponding to the second connector module into a second component, and processing the reference variable information based on the second component.
[0070] Specifically, determine the module name of the second connector module and the module parameter information associated with the second connector module. Encapsulate the module name and the module parameter information into a second component to facilitate subsequent determination of the variable information to be referenced according to the trigger operation on the second component. It should be noted that the encapsulated second component contains the module name of the second connector module and all necessary module parameter information.
[0071] Optionally, when the first connector module is graphically processed, a component color corresponding to the variable type can be set according to the variable type that can be set in the first connector module to obtain a first component of the corresponding component color. Correspondingly, when the second connector module is graphically processed, a component color corresponding to the variable type can be set according to the variable type that can be set in the second connector module to obtain a second component of the corresponding component color.
[0072] For example, in conjunction with the above examples, see Figure 5 The first connector module InnerMemory module can be represented by a solid line, and the second connector module OuterMemory module can be represented by a dotted line. If each connector module can only set one type of variable, the connector module that can set the Real type can be represented by blue, the connector module that can set the Integer type can be represented by orange, and the connector module that can set the Boolean type can be represented by purple.
[0073] The technical solution of this embodiment generates a first connector module by adding a first prefix to the preset component text, and generates a second connector module by adding a second prefix to the preset component text. Among them, the first connector module is a connector module for defining variables, and the second connector module is a connector module for referencing variables. The inheritance relationship between the first connector module and the second connector module is determined to solve the problem of inconsistent connector types. By determining the inheritance relationship, the first connector module and the second connector module are associated. The first connector module and the second connector module are graphically processed to obtain the first component to be selected and the second component to be selected, so as to render the first component to be selected and the second component to be selected to the component interface. The present invention realizes the generation of the first component to be selected and the second component to be selected, facilitates the subsequent cross-level call of variables according to the graphical first component and the second component, simplifies user operations, and improves user experience.
[0074] Embodiment 3
[0075] Figure 6 Schematic diagram of a variable reference device provided by Embodiment 3 of the present invention. Figure 6 As shown, the device includes: a variable information determination module 310 and a variable reference module 320.
[0076] The variable information determination module 310 is used to determine at least one variable information to be referenced based on a trigger operation on the first component after rendering the first component and the second component to the model building interface; the variable reference module 320 is used to display at least one variable information to be referenced at a preset position of the second component, so as to reference the variable information to be referenced corresponding to the first component based on the second component.
[0077] The technical solution of this embodiment renders the first component and the second component to the model building interface, and determines at least one variable information to be referenced based on the trigger operation on the first component. The at least one variable information to be referenced is displayed at a preset position of the second component, so as to reference the variable information to be referenced corresponding to the first component based on the second component. Among them, the first component and the second component are both pre-created graphical components. The present invention solves the problem of complex variable calling when establishing a large model containing many interrelated components in the prior art, and the problem of high technical threshold for cross-level variable calling by writing code. The cross-level calling of variables is realized by the graphical first component and the second component, which simplifies the cross-level calling method of variables, has a certain universality, and improves the user experience.
[0078] On the basis of the above embodiment, optionally, the variable information determination module includes: a component rendering unit, which is used to display a component interface in response to a trigger operation on the model building interface, wherein the component interface includes at least one first component to be selected and at least one second component to be selected; based on the trigger selection on the component interface, determine the first component and the second component to be added to the model building interface, and render the first component and the second component to the model building interface.
[0079] Optionally, the device includes: a component generation module, which includes: a connector module generation unit, which is used to add a first prefix to the preset component text to generate a first connector module, and to add a second prefix to the preset component text to generate a second connector module, wherein the first connector module is a connector module for defining variables, and the second connector module is a connector module for referencing variables; a component determination unit, which is used to determine the inheritance relationship between the first connector module and the second connector module, and to perform graphical processing on the first connector module and the second connector module to obtain a first component to be selected corresponding to the first connector module and a second component to be selected corresponding to the second connector module, so as to render the first component to be selected and the second component to be selected to the component interface.
[0080] Optionally, the component determination unit includes: an inheritance relationship determination subunit, used to code the first connector module according to at least one preset variable type corresponding to the second connector module, so that the first connector module inherits the preset variable type corresponding to the second connector module.
[0081] Optionally, the component determination unit includes: a component graphical processing subunit, used to encapsulate the module name and module parameter information corresponding to the first connector module into a first component, so as to determine the variable information to be referenced based on the first component.
[0082] Optionally, the variable information to be referenced includes the variable name, variable type and variable dimension of the variable to be referenced, and the variable reference module includes: a variable information reference unit, used to determine the target variable name based on the trigger operation on the second component, wherein the target variable name is the variable name in the variable information to be referenced; based on the target variable name, the target variable type and target variable dimension corresponding to the target variable name are displayed on the second component.
[0083] The variable reference device provided in the embodiment of the present invention can execute the variable reference method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0084] Embodiment 4
[0085] Figure 71 is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0086] like Figure 7 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0087] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0088] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a variable reference method.
[0089] In some embodiments, the variable reference method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the variable reference method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the variable reference method in any other appropriate manner (e.g., by means of firmware).
[0090] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0091] The computer program for implementing the variable reference method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program can be executed completely on the machine, partially on the machine, partially on the machine as an independent software package and partially on a remote machine, or completely on a remote machine or server.
[0092] Embodiment 5
[0093] Embodiment 5 of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a processor to execute a variable reference method, the method comprising:
[0094] After rendering the first component and the second component to the model building interface, at least one variable information to be referenced is determined based on a trigger operation on the first component; at least one variable information to be referenced is displayed at a preset position of the second component, so as to reference the variable information to be referenced corresponding to the first component based on the second component.
[0095] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0096] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0097] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0098] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0099] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0100] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A variable reference method, characterized in that: include: After rendering the first component and the second component to the model building interface, determining at least one variable information to be referenced based on a triggering operation on the first component; The at least one variable information to be referenced is displayed at a preset position of the second component, so as to reference the variable information to be referenced corresponding to the first component based on the second component.
2. The method according to claim 1, characterized in that The rendering of the first component and the second component to the model building interface includes: In response to a trigger operation on the model building interface, a component interface is displayed, wherein the component interface includes at least one first component to be selected and at least one second component to be selected; Based on a trigger selection on the component interface, a first component and a second component to be added to the model building interface are determined, and the first component and the second component are rendered to the model building interface.
3. The method according to claim 2, characterized in that The method further comprises: Adding a first prefix to the preset component text to generate a first connector module, and adding a second prefix to the preset component text to generate a second connector module, wherein the first connector module is a connector module for defining variables, and the second connector module is a connector module for referencing variables; Determine the inheritance relationship between the first connector module and the second connector module, and perform graphical processing on the first connector module and the second connector module to obtain the first component to be selected corresponding to the first connector module and the second component to be selected corresponding to the second connector module, so as to render the first component to be selected and the second component to be selected to the component interface.
4. The method according to claim 3, characterized in that The determining the inheritance relationship between the first connector module and the second connector module includes: According to at least one preset variable type corresponding to the second connector module, the first connector module is coded so that the first connector module inherits the preset variable type corresponding to the second connector module.
5. The method according to claim 3, characterized in that: Graphically processing the first connector module to obtain a first component to be selected corresponding to the first connector module includes: The module name and module parameter information corresponding to the first connector module are encapsulated into a first component, so as to determine the variable information to be referenced based on the first component.
6. The method according to claim 1, characterized in that The variable information to be referenced includes the variable name, variable type and variable dimension of the variable to be referenced, and the reference to the variable information to be referenced corresponding to the first component based on the second component includes: Based on the trigger operation on the second component, determine the target variable name, wherein the target variable name is the variable name in the variable information to be referenced; Based on the target variable name, the target variable type and target variable dimension corresponding to the target variable name are displayed in the second component.
7. A variable reference device, characterized in that: include: A variable information determination module, configured to determine at least one variable information to be referenced based on a trigger operation on the first component after rendering the first component and the second component to the model building interface; The variable referencing module is used to display the at least one variable information to be referenced at a preset position of the second component, so as to reference the variable information to be referenced corresponding to the first component based on the second component.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the variable reference method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the variable reference method according to any one of claims 1 to 6 when executed.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the variable reference method according to any one of claims 1 to 6.