CN115016777A - Model synchronous processing method, device and storage medium - Google Patents

Model synchronous processing method, device and storage medium Download PDF

Info

Publication number
CN115016777A
CN115016777A CN202210934806.2A CN202210934806A CN115016777A CN 115016777 A CN115016777 A CN 115016777A CN 202210934806 A CN202210934806 A CN 202210934806A CN 115016777 A CN115016777 A CN 115016777A
Authority
CN
China
Prior art keywords
view layer
language text
modelica language
model
modelica
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210934806.2A
Other languages
Chinese (zh)
Inventor
张鹏
丁静雯
王妍
梅俊宇
程旭
张聪聪
侯庆坤
何绍清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Automotive Technology and Research Center Co Ltd
Original Assignee
China Automotive Technology and Research Center Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Automotive Technology and Research Center Co Ltd filed Critical China Automotive Technology and Research Center Co Ltd
Priority to CN202210934806.2A priority Critical patent/CN115016777A/en
Publication of CN115016777A publication Critical patent/CN115016777A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention relates to the field of data processing, and discloses a method, equipment and a storage medium for synchronously processing a model. The method comprises the following steps: when a model establishing instruction is detected, an icon view layer, a graph view layer and a Modelica language text view layer are respectively established; when the editing operation triggered by any one of the icon view layer and the graphic view layer is detected, the editing content corresponding to the editing operation is synchronized to the Modelica language text view layer, so that the content in the Modelica language text view layer is edited synchronously. The method and the device can improve the building efficiency of the Modelica language model and reduce the building difficulty of the Modelica language model.

Description

Model synchronous processing method, device and storage medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a method, device, and storage medium for model synchronization processing.
Background
As an important link in production and manufacturing, industrial simulation technology aims to convert each module in the physical industry into data and fit the data into a virtual system, namely a simulation model. When the simulation model runs, each work and process can be displayed more truly, and simulation data can be fed back. Through the early-stage construction and simulation calculation of the simulation model, the problems of incomplete fault handling, high experimental risk system, high verification cost and the like which may occur in production and manufacturing can be eliminated or reduced.
Modelica is an object-oriented modeling language suitable for normatively constructing a complex heterogeneous natural system or an artificial system, can meet the modeling requirements of a multi-field physical system, can build a software component model and supports the creation and connection of components, so that for modeling of the complex physical system in industrial simulation, Modelica is an ideal structural description language, thoroughly realizes seamless integration among models in different fields, and can realize comprehensive multi-field unified modeling.
In view of the above, the present invention is particularly proposed.
Disclosure of Invention
In order to solve the technical problems, the invention provides a model synchronous processing method, equipment and a storage medium, which realize synchronous modification among a Modelica language model text, a Modelica language model associated visual graph and a Modelica language model associated visual icon, so that an engineer can conveniently and quickly build a Modelica language model, the building efficiency of the Modelica language model is improved, and the building difficulty of the Modelica language model is reduced.
The embodiment of the invention provides a model synchronous processing method, which comprises the following steps:
when a model establishing instruction is detected, an icon view layer, a graph view layer and a Modelica language text view layer are respectively established; the icon view layer is used for packaging the built model assembly to obtain a style icon of the model assembly; the graphic view layer is used for visually building a model, and the graphic view layer displays the pattern icons of the components in the model library; the Modelica language text view layer is used for editing and displaying Modelica language text of the model; the Modelica language text view layer comprises Modelica language text corresponding to content on a canvas of the icon view layer and Modelica language text corresponding to content on the canvas of the graphic view layer;
when the editing operation triggered by any one of the icon view layer and the graphic view layer is detected, the editing content corresponding to the editing operation is synchronized to the Modelica language text view layer, so that the content in the Modelica language text view layer is edited synchronously.
An embodiment of the present invention provides an electronic device, including:
a processor and a memory;
the processor is used for executing the steps of the model synchronization processing method according to any embodiment by calling the program or the instruction stored in the memory.
Embodiments of the present invention provide a computer-readable storage medium, which stores a program or instructions for causing a computer to execute the steps of the model synchronization processing method according to any embodiment.
The embodiment of the invention has the following technical effects:
when a model establishing instruction is detected, an icon view layer, a graph view layer and a Modelica language text view layer are respectively established, when an editing operation triggered by any view layer of the icon view layer and the graph view layer is detected, editing contents corresponding to the editing operation are synchronized to the Modelica language text view layer, so that the contents in the Modelica language text view layer are synchronously edited, synchronous modification among a Modelica language model text, a visual graph associated with the Modelica language model and a visual icon associated with the Modelica language model is realized, an engineer can conveniently and quickly establish the Modelica language model, the establishing efficiency of the Modelica language model is improved, and the establishing difficulty of the Modelica language model is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a model synchronization processing method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another model synchronization processing method provided by the embodiment of the invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Modelica is an object-oriented modeling language suitable for normatively constructing a complex heterogeneous natural system or an artificial system, can meet the modeling requirements of a multi-field physical system, can build a software component model and supports the creation and connection of components, so that for modeling of the complex physical system in industrial simulation, Modelica is an ideal structural description language, thoroughly realizes seamless integration among models in different fields, and can realize comprehensive multi-field unified modeling.
And if the Modelica text is opened only through a common text editor, only the text code can be checked, the visualization degree is extremely low, the model building method is not beneficial to engineering personnel to conveniently and quickly build the model, and the model is not beneficial to model users to quickly use and analyze the model.
In view of the above problems, embodiments of the present invention provide a method for synchronously processing a model, which is applied to simulation software, such as Cautosim software, and when a model text written based on a Modelica language is opened by the Cautosim software, the model text can be converted into a visual graph, which is beneficial for an engineer to quickly use and analyze the model.
The model synchronization processing method provided by the embodiment of the invention can be executed by electronic equipment. Fig. 1 is a flowchart of a model synchronization processing method according to an embodiment of the present invention. Referring to fig. 1, the method for processing the Modelica language model based on the Cautosim software specifically comprises the following steps:
and step 110, when a model creating instruction is detected, respectively creating an icon view layer, a graphic view layer and a Modelica language text view layer.
The icon view layer is used for packaging the built model assembly to obtain a style icon of the model assembly; for example, the model includes a plurality of identical resistor series-parallel structures, in order to improve the model building efficiency and the building convenience, the resistor series-parallel structures may be packaged as one model component, and one rectangle may be used to represent the resistor series-parallel structures, such that one rectangle represents one resistor series-parallel structure, and if the resistor series-parallel structures are also used in other models, one rectangle may be directly used instead. The rectangle is a style icon of the resistor series-parallel structure. And a plurality of drawing tools such as lines, ellipses, rectangles, polygons and the like can be displayed on the menu bar of the icon view layer, so that a user can draw the icons on the canvas of the icon view layer conveniently.
The graphic view layer is used for visually building the model, the pattern icons of the components in the model library are displayed on the graphic view layer, and the model can be built by using the components in the model library by dragging the existing pattern icons.
The Modelica language text view layer is used for editing and displaying Modelica language text of the model; the Modelica language text view layer includes Modelica language text corresponding to content on the canvas of the icon view layer and Modelica language text corresponding to content on the canvas of the graphic view layer.
In other words, when a new model is newly created by the Cautosim software, the Cautosim software will create three views for this model, namely an icon view layer, a graphic view layer, and a text view layer. The graphic view layer is used for building the model, and the components in the model library can be dragged to canvas through visual dragging, so that the addition of the components for the current model is completed. And clicking by a mouse to connect interfaces among the components to complete the connection establishment among the components. The icon view layer is used for packaging the component, namely, for the built component, the icon with the characteristic is drawn through software, and when other models use the component, the icon is used as a representative style dragged to a canvas. The text view layer is a Modelica language code of the model, and completely records all contents in the canvas of the graphic view layer and the canvas of the icon view layer in the form of the Modelica language code, and carries out model simulation solving on the basis of the contents. All contents on the canvas of the graphic view layer and the canvas of the icon view layer can be embodied in codes in the text view layer, otherwise, all the codes in the text view layer can also find corresponding contents in the canvas of the graphic view layer and the canvas of the icon view layer in a visual form.
Step 120, when an editing operation triggered by any one of the icon view layer and the graphic view layer is detected, synchronizing an editing content corresponding to the editing operation to the Modelica language text view layer so that the content in the Modelica language text view layer is edited synchronously.
Specifically, the created icon view layer, graphic view layer and Modelica language text view layer may be freely switched, for example, the electronic device running the Cautosim software is a computer, when a user mouse clicks a mark of the icon view layer in a taskbar, the icon view layer is displayed on an interface of the Cautosim software (the icon view layer includes a canvas and a menu bar, etc.), when the user mouse clicks the mark of the graphic view layer in the taskbar, the interface of the Cautosim software is switched from the icon view layer to the graphic view layer (the graphic view layer includes the canvas and the menu bar, etc.), and when the user mouse clicks the mark of the Modelica language text view layer in the taskbar, the interface of the Cautosim software is switched from the graphic view layer to the Modelica language text view layer (the Modelica language text view layer includes a text input region and the menu bar, etc.). That is, the user can switch between the icon view layer, the graphic view layer, and the Modelica language text view layer at will. When a user builds a model, visual building can be carried out based on a graphic view layer, pure code programming building can also be carried out based on a Modelica language text view layer, no matter the user visually builds based on the graphic view layer, or the pure code programming building is carried out based on the Modelica language text view layer, the editing content of the user is synchronously embodied in the graphic view layer and the Modelica language text view layer, and a component icon drawn on the icon view layer by the user can be synchronously embodied in the graphic view layer and the Modelica language text view layer, so that engineering personnel can build the model through a visual mode, the pure code programming and a combined mode of the graphic view layer and the Modelica language text view layer, the building efficiency of the model can be improved through providing a diversified model building mode, and the building difficulty is reduced.
Exemplarily, when an editing operation triggered based on any one of the icon view layer and the graphic view layer is detected, synchronizing an editing content corresponding to the editing operation to the Modelica language text view layer so that the content in the Modelica language text view layer is synchronously edited includes:
when a first editing operation that a target component in a model library is dragged to a canvas of the graph view layer based on the graph view layer is detected, recording first editing content corresponding to the first editing operation based on a first data structure matched with the graph view layer, wherein the first editing content at least comprises a storage path, a name identifier and a placement position of the target component on the canvas; according to a mapping relation between the first data structure and a Modelica language text which is made in advance, converting first editing content recorded based on the first data structure into a first Modelica language text which accords with Modelica language specifications; determining a first target position according to the first Modelica language text; inserting the first Modelica language text into the first target position in the Modelica language text view layer.
It is understood that the data structure used by the graphic view layer is different from the data structure of the Modelica language used by the Modelica language text view layer, so that the first editing content corresponding to the first editing operation occurring on the graphic view layer is recorded by using the first data structure matching with the graphic view layer, and then the conversion between the data structures is performed to convert the first editing content into the first Modelica language text conforming to the Modelica language specification, for example, "red" recorded by using the first data structure is "red", and "255, 0, 0" is converted into the first Modelica language text conforming to the Modelica language specification. After the first editing content is converted into a first Modelica language text which accords with Modelica language specifications, a first target position of the first Modelica language text in a Modelica language text view layer is determined, then the first Modelica language text is inserted into the first target position, and the purpose that the first editing content corresponding to the first editing operation is synchronized to the Modelica language text view layer is achieved. The first target position of the first Modelica language text in the Modelica language text view layer can be determined according to preset key characters included in the first Modelica language text, for example, if the first Modelica language text includes preset key characters a, the position of the character a in the Modelica language text view layer is searched, and the position is determined as the first target position. Alternatively, the insertion position may be specified in advance according to different types of editing operations, for example, for an editing operation of a newly added component, the insertion position corresponding to the Modelica language text view layer is the end, that is, the end position of an existing code, and if it is detected that the editing operation triggered based on the graphics view layer is the newly added component, the corresponding Modelica language text may be inserted to the end of the text input area of the Modelica language text view layer, that is, the end position of the existing code.
For example, the user drags the components Modelica fluid Pipes StaticPipe on the canvas on the graphic viewing layer, and renames them to pipe1 and pipe2, and when switching from the graphic viewing layer to the Modelica language text viewing layer, adds the corresponding Modelica language text in the component region of the Modelica language text viewing layer (the component region may be preset or may be identified and determined by key characters).
Exemplarily, when an editing operation triggered based on any one of the icon view layer and the graphic view layer is detected, synchronizing an editing content corresponding to the editing operation to the Modelica language text view layer so that the content in the Modelica language text view layer is synchronously edited includes:
when a second editing operation that a connecting line is added between two existing components on the canvas of the graph and view layer is detected, recording second editing content corresponding to the second editing operation based on a first data structure matched with the graph and view layer, wherein the second editing content at least comprises respective name identifiers of the two components and a port identifier connected with the connecting line; according to a mapping relation between the first data structure and a Modelica language text which is preset, converting second editing content recorded on the basis of the first data structure into a second Modelica language text which accords with Modelica language specifications; determining a second target position according to the second Modelica language text; and inserting the second Modelica language text into the second target position in the Modelica language text view layer.
Specifically, to the editing of the connection line between the newly added components: the mouse is placed on a port of the component, then the mouse is clicked, a line is connected from the port, the mouse is dragged and placed to the port of the other component, the mouse is loosened, at the moment, the Cautosmim software verifies whether the two components meet connection specifications or not (if the interfaces meet the conditions of the same physical unit, the input variables and the output variables, and the like), if the interfaces meet the connection specifications, the connection is successfully carried out, and the connected line is displayed on a canvas. When the graphic view layer is switched to the Modelica language text view layer, a Modelica language connection statement is created for connected components and ports after an equation area, namely a key character, of a text input area of the Modelica language text view layer is equated.
The second target position of the second modeica language text in the modeica language text view layer can be determined according to preset key characters included in the second modeica language text, for example, if the second modeica language text includes preset key characters a, the position of the character a in the modeica language text view layer is searched, and the position is determined as the second target position. Alternatively, the insertion position may be specified in advance according to different types of editing operations, for example, for editing a connection line between newly added components, after an equation region, that is, a key character equation, in a text input region of a Modelica language text view layer, a Modelica language connection statement may be created for the connected component and port.
Illustratively, for editing operations that modify component parameters: double-clicking the component, opening a component parameter popup window, modifying parameters in the component parameter popup window, and clicking for storage; the Cautosmim software records the parameters that were modified and records the latest values. When the graphic view layer is switched to the Modelica language text view layer, the updated parameter values are updated to the corresponding assemblies according to the assemblies to which the parameter values belong, and then the parameter values are stored in the language conforming to the Modelica grammar specification.
Exemplarily, when an editing operation triggered based on any one of the icon view layer and the graphic view layer is detected, synchronizing an editing content corresponding to the editing operation to the Modelica language text view layer so that the content in the Modelica language text view layer is synchronously edited includes:
when a third editing operation of drawing a component on the canvas of the icon view layer is detected, creating an instantiation object corresponding to the drawn component based on a Modelica language, and storing the instantiation object; and inserting the instantiation object into a third target position in the Modelica language text view layer. Specifically, for the insertion of the new drawing: and clicking drawing shapes such as lines, ellipses, rectangles, polygons and the like in the menu bar of the icon view layer, and drawing the component on the canvas of the icon view layer. Objects are instantiated in the Cautosmim software according to the rendered content. For example, a rectangle is added on the canvas, then an object of Morectangle is instantiated in the Cautosmim software and stored under the object of MoClass. And when all the drawings are finished, clicking to save or switching from the icon view layer to the Modelica language text view layer to check the saved content. For example, when the user creates a rectangle with an origin of coordinates at point (0, 0) and coordinates of four points (-40, 50), (-40, -50), (40, 50), (40, -50), when the drawing is completed and the switching is made from the icon viewing layer to the Modelica language text viewing layer, the Modelica language text viewing layer will add a row of the following code at the bottom of the model text:
annotation, [ animation = curve (chinese) of Icon
Rectangle(
origin = {0.00,0.00},extent={{-40.00,-40.00},{50.00,50.00}})}));】
The third target position of the third modeica language text in the modeica language text view layer can be determined according to preset key characters included in the third modeica language text, for example, if the third modeica language text includes preset key characters a, the position of the character a in the modeica language text view layer is searched, and the position is determined as the third target position. Alternatively, the insertion position may be pre-specified according to different types of editing operations, for example, for the insertion of a new drawing, when the drawing is completed and the drawing is switched from the icon view layer to the Modelica language text view layer, the Modelica language text view layer will add a corresponding third Modelica language text at the bottom of the model.
Further, the method further comprises:
and synchronizing the drawn components to a model library and displaying the components on a menu bar of the graphic layer. The data structures used by the icon view layer and the graphic view layer are the same, so that when the editing operation triggered based on the icon view layer is synchronized to the graphic view layer, the corresponding content of the editing operation can be directly analyzed and rendered.
Exemplarily, referring to a flowchart of another model synchronization processing method shown in fig. 2, the method specifically includes: step 210, create new components/drawings, etc. Step 220, recording relevant information of the visualized objects displayed on the canvas. And step 230, converting the recorded related information of the visual object into a Modelica language text. And step 240, storing the data in a cache. And step 250, switching views. And step 260, inserting the Modelica language text into a proper position of a Modelica language text view layer. And step 270, storing the model file. The model file stores Modelica language text.
Further, the method further comprises:
when a fourth editing operation triggered based on the Modelica language text view layer is detected, synchronizing fourth editing content corresponding to the fourth editing operation to the graphic view layer, or synchronizing fourth editing content to the graphic view layer and the icon view layer, wherein the fourth editing content is Modelica language text.
Exemplarily, the synchronizing the fourth editing content corresponding to the fourth editing operation to the graphic view layer includes:
carrying out syntax analysis on the model text in the Modelica language text view layer;
if the model text is determined to have no grammar error, converting the model text into model data of a first data structure matched with the graphic layer;
generating content displayed in the graphic view layer based on model data of a first data structure that matches the graphic view layer.
In summary, if the code level is directly changed based on the Modelica language text view layer, after the code level is changed based on the Modelica language text view layer after the graphic view layer or the icon view layer is switched, the code level is also directly changed based on the Modelica language text view layer, and the code level is also displayed on the canvas of the graphic view layer and the canvas of the icon view layer in real time, so that the consistency of text codes and visualized display contents is ensured.
The embodiment of the invention aims to provide a method for processing a graph view and a model text view of a model built by a Modelica language in real time and synchronously based on Cautosum software, so that the problems of insufficient visualization, insufficient convenience and the like in the multi-field modeling process in the prior art are solved, the efficiency of building the model is improved, and the difficulty of building the model is reduced. Specifically, the Modelica language code model is analyzed and displayed through Cautosmim software, so that the originally lengthy and complex code language is converted into a visual and operable interface model. In the process of visualization operation, recording the operation behaviors of a user through Cautosim software, and restoring the operation behaviors to the Modelica grammar one by one; the model can be changed in Cautosmim software through inputting codes, and after the change is finished, the view can be switched in real time to check the construction effect of the visual model.
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. As shown in fig. 3, the electronic device 400 includes one or more processors 401 and memory 402.
The processor 401 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 400 to perform desired functions.
Memory 402 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by processor 401 to implement the model synchronization processing methods of any of the embodiments of the invention described above and/or other desired functions. Various contents such as initial external parameters, threshold values, etc. may also be stored in the computer-readable storage medium.
In one example, the electronic device 400 may further include: an input device 403 and an output device 404, which are interconnected by a bus system and/or other form of connection mechanism (not shown). The input device 403 may include, for example, a keyboard, a mouse, and the like. The output device 404 can output various information to the outside, including warning prompt information, braking force, etc. The output devices 404 may include, for example, a display, speakers, a printer, and a communication network and its connected remote output devices, among others.
Of course, for simplicity, only some of the components of the electronic device 400 relevant to the present invention are shown in fig. 3, omitting components such as buses, input/output interfaces, and the like. In addition, electronic device 400 may include any other suitable components depending on the particular application.
In addition to the above-described methods and apparatus, embodiments of the invention may also be a computer program product comprising computer program instructions which, when executed by a processor, cause the processor to perform the steps of the model synchronization processing method provided by any of the embodiments of the invention.
The computer program product may write program text for carrying out operations for embodiments of the present invention in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program text may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present invention may also be a computer-readable storage medium having stored thereon computer program instructions, which, when executed by a processor, cause the processor to perform the steps of the model synchronization processing method provided by any of the embodiments of the present invention.
The computer-readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
It is to be understood that the terminology used herein is for the purpose of describing particular embodiments only, and is not intended to limit the scope of the present application. As used in this specification, the terms "a," "an," "the," and/or "the" are not intended to be inclusive in the singular, but rather are intended to include the plural as well, unless the context clearly indicates otherwise. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method or apparatus that comprises the element.
It is further noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," "outer," and the like are used in the orientation or positional relationship indicated in the drawings for convenience in describing the invention and for simplicity in description, and do not indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and thus should not be construed as limiting the invention. Unless expressly stated or limited otherwise, the terms "mounted," "connected," "coupled," and the like are to be construed broadly and encompass, for example, both fixed and removable coupling or integral coupling; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions deviate from the technical solutions of the embodiments of the present invention.

Claims (9)

1. A model synchronization processing method is characterized by comprising the following steps:
when a model establishing instruction is detected, an icon view layer, a graph view layer and a Modelica language text view layer are respectively established; the icon view layer is used for packaging the built model assembly to obtain a style icon of the model assembly; the graphic view layer is used for visually building a model, and the pattern icons of the components in the model library are displayed on the graphic view layer; the Modelica language text view layer is used for editing and displaying Modelica language text of the model; the Modelica language text view layer comprises Modelica language text corresponding to content on a canvas of the icon view layer and Modelica language text corresponding to content on the canvas of the graphic view layer;
when the editing operation triggered by any one of the icon view layer and the graphic view layer is detected, the editing content corresponding to the editing operation is synchronized to the Modelica language text view layer, so that the content in the Modelica language text view layer is edited synchronously.
2. The method according to claim 1, wherein when an editing operation triggered based on any one of the icon view layer and the graphic view layer is detected, synchronizing an editing content corresponding to the editing operation to the Modelica language text view layer so that the content in the Modelica language text view layer is edited synchronously comprises:
when a first editing operation that a target component in a model library is dragged to a canvas of the graphic view layer based on the graphic view layer is detected, recording first editing content corresponding to the first editing operation based on a first data structure matched with the graphic view layer, wherein the first editing content at least comprises a storage path, a name identifier and a placement position of the target component on the canvas;
according to a mapping relation between the first data structure and a Modelica language text which is made in advance, converting first editing content recorded based on the first data structure into a first Modelica language text which accords with Modelica language specifications;
determining a first target position according to the first Modelica language text;
inserting the first Modelica language text into the first target position in the Modelica language text view layer.
3. The method according to claim 1, wherein when an editing operation triggered based on any one of the icon view layer and the graphic view layer is detected, synchronizing an editing content corresponding to the editing operation to the Modelica language text view layer so that the content in the Modelica language text view layer is edited synchronously comprises:
when a second editing operation that a connecting line is added between two existing components on the canvas of the graph and view layer is detected, recording second editing content corresponding to the second editing operation based on a first data structure matched with the graph and view layer, wherein the second editing content at least comprises respective name identifiers of the two components and a port identifier connected with the connecting line;
according to a mapping relation between the first data structure and a Modelica language text which is made in advance, converting second editing content recorded based on the first data structure into a second Modelica language text which accords with Modelica language specifications;
determining a second target position according to the second Modelica language text;
and inserting the second Modelica language text into the second target position in the Modelica language text view layer.
4. The method according to claim 1, wherein when an editing operation triggered based on any one of the icon view layer and the graphic view layer is detected, synchronizing an editing content corresponding to the editing operation to the Modelica language text view layer so that the content in the Modelica language text view layer is edited synchronously comprises:
when a third editing operation of drawing a component on the canvas of the icon view layer is detected, creating an instantiation object corresponding to the drawn component based on a Modelica language, and storing the instantiation object;
and inserting the instantiation object into a third target position in the Modelica language text view layer.
5. The method of claim 4, further comprising:
and synchronizing the drawn components to a model library and displaying the components on a menu bar of the graphic layer.
6. The method of claim 1, further comprising:
and when a fourth editing operation triggered based on the Modelica language text view layer is detected, synchronizing fourth editing content corresponding to the fourth editing operation to the graph view layer or to the graph view layer and the icon view layer, wherein the fourth editing content is Modelica language text.
7. The method according to claim 6, wherein the synchronizing fourth editing content corresponding to the fourth editing operation to the graphic view layer includes:
carrying out syntax analysis on the model text in the Modelica language text view layer;
if the model text is determined to have no grammar error, converting the model text into model data of a first data structure matched with the graphic layer;
generating content displayed in the graphic view layer based on model data of a first data structure that matches the graphic view layer.
8. An electronic device, characterized in that the electronic device comprises:
a processor and a memory;
the processor is configured to perform the steps of the model synchronization processing method according to any one of claims 1 to 7 by calling a program or instructions stored in the memory.
9. A computer-readable storage medium characterized by storing a program or instructions for causing a computer to execute the steps of the model synchronization processing method according to any one of claims 1 to 7.
CN202210934806.2A 2022-08-05 2022-08-05 Model synchronous processing method, device and storage medium Pending CN115016777A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210934806.2A CN115016777A (en) 2022-08-05 2022-08-05 Model synchronous processing method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210934806.2A CN115016777A (en) 2022-08-05 2022-08-05 Model synchronous processing method, device and storage medium

Publications (1)

Publication Number Publication Date
CN115016777A true CN115016777A (en) 2022-09-06

Family

ID=83065409

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210934806.2A Pending CN115016777A (en) 2022-08-05 2022-08-05 Model synchronous processing method, device and storage medium

Country Status (1)

Country Link
CN (1) CN115016777A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106406890A (en) * 2016-09-23 2017-02-15 江西洪都航空工业集团有限责任公司 A method of constructing robot modules by using multiple languages
CN110837362A (en) * 2019-11-01 2020-02-25 无锡数信互融科技发展有限公司 Method, system and editor for editing rule of guide type visual graphic modularization
CN114840196A (en) * 2022-07-06 2022-08-02 中国汽车技术研究中心有限公司 Modelica language model processing method, device and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106406890A (en) * 2016-09-23 2017-02-15 江西洪都航空工业集团有限责任公司 A method of constructing robot modules by using multiple languages
CN110837362A (en) * 2019-11-01 2020-02-25 无锡数信互融科技发展有限公司 Method, system and editor for editing rule of guide type visual graphic modularization
CN114840196A (en) * 2022-07-06 2022-08-02 中国汽车技术研究中心有限公司 Modelica language model processing method, device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
曾杨涛: "基于Modelica平台的三维可视化技术", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Similar Documents

Publication Publication Date Title
CN104216691B (en) A kind of method and device for creating application
Foley et al. An object based graphical user interface for power systems
US7096454B2 (en) Method for gesture based modeling
US7765529B1 (en) Transforming graphical objects in a graphical modeling environment
CN111400899B (en) Processing method, system and storage medium for cable laying modeling
CN112035101A (en) Method, apparatus, medium, and device for creating command library by combining RPA and AI
CN111553129B (en) SVG and echarts graph fusion method based on canvas
CN114840196B (en) Modelica language model processing method, device and storage medium
Jensen et al. Computer tools for coloured Petri nets
CN113901367A (en) BIM (building information modeling) mass model display method based on WebGL + VR (WebGL + VR)
US8745537B1 (en) Graphical interface for managing and monitoring the status of a graphical model
JP2021532497A (en) Visualization method, equipment and recording medium for multi-source earth observation image processing
Goldman et al. The ISI visual design editor generator
CN114398071A (en) Control logic configuration implementation method and system of control system
CN110889013A (en) Data association method, device, server and storage medium based on XML
US8700374B1 (en) System and method of using an active link in a state programming environment to locate an element in a graphical programming environment
CN117369811A (en) Method, device and storage medium for generating monitoring system software interface
CN110764750B (en) Energy economy simulation system development method based on individual model
CN115016777A (en) Model synchronous processing method, device and storage medium
JP4813639B2 (en) Feature-type macro language for defining customized analysis and customized graphics functions
JP4902567B2 (en) Work procedure manual creation system and work procedure manual creation program
CN115857930A (en) Prototype rapid design method and system based on real-scene model
CN107135095B (en) Visual editing method and system for virtual machine network topology
US9372844B2 (en) Automatically generating a business process flow GUI using a symbolic annotation language
CN115840564A (en) Integrated model construction method, device and system based on multi-frame construction model language

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination