Lightweight display method of Modelica model based on development lifecycle collaboration service

Through the method based on the development life cycle collaboration service, the problem of Modelica model structure query and conversion is solved, the lightweight display and visualization of the Modelica model is realized, and the data integration efficiency of complex system development and the analysis capabilities of multi-domain models are improved.

CN114969868BActive Publication Date: 2024-10-11INFORMATION CENT OF CHINA NORTH IND GRP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210555441.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-19
Publication Date
2024-10-11
Estimated Expiration
2042-05-19

AI Technical Summary

Technical Problem

Existing technology is difficult to effectively query and convert complex Modelica model structures, resulting in insufficient complexity analysis capabilities for multi-domain models in the entire life cycle of complex system development, and the query and visualization capabilities of Modelica model elements are weak, affecting data integration efficiency. .

Method used

Adopting a method based on development life cycle collaboration services, through the construction and storage of Modelica model library, model acquisition and preprocessing, OSLC element mapping and generation of visual data, the OSLC adapter is used to convert the Modelica model into JSON format, and the XML format is generated through MxGraph , to achieve lightweight display and visualization of Modelica models.

Benefits of technology

It improves the query and visualization capabilities of Modelica model elements, enhances the efficiency of data integration, supports the overall query and conversion of multiple model elements, reduces the development cost and complexity in traditional model integration methods, and realizes the decentralization of Modelica models. A quick demonstration of versatility on the platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114969868B_ABST
    Figure CN114969868B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of system engineering and complex system design, and specifically relates to a lightweight display method of Modelica model based on development lifecycle collaborative service. The method includes: model construction and storage; model acquisition and preprocessing; OSLC element mapping; generating and displaying visual data; based on the OSLC specification that provides a specified REST API interface, the method provides a standardized interface for the structural information interoperation of the Modelica model, enhances the query capability of the Modelica model elements, and constructs a complex model structure composed of multi-level elements from the element information in the Modelica model structure, but increases the visualization capability of the description model and improves the integration efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of system engineering and complex system design, and in particular to the technical field related to the development and integration of complex equipment research and development platforms, and specifically to a lightweight display method of Modelica models based on development lifecycle collaborative services. Background Art

[0002] Model-based system engineering (MBSE) is an emerging technology that supports the development of complex systems. MBSE uses formalized models to describe functional activities such as requirements, design, analysis, verification and validation throughout the life cycle of system development, and drives system development with models as the core. In the entire life cycle of product development, various heterogeneous data are involved, and the data structures are different from each other, making it impossible to achieve effective data integration. At present, intermediate conversion standards are often used to achieve data integration between life cycle data and integrated development platforms. The Modelica language has a huge influence in MBSE. It is specifically used to support multi-domain modeling and simulation of complex equipment and is widely used in the fields of aviation and aerospace. At present, in the process of complex equipment development, in order to support the integration of Modelica models and modeling platforms, model integration methods are usually adopted, that is, platform integration is achieved by saving model files. This method is difficult to understand the relevant information in the model, and it is impossible to understand the data structure and semantics in the model, and it is difficult to cope with the complexity analysis of multi-domain models throughout the life cycle of complex system development; mainstream integration methods such as file storage methods are relatively simple to query Modelica model elements, and lack the ability to query and convert complex model structures as a whole, thus reducing conversion efficiency.

[0003] At present, a large number of data keying technologies are widely used in data integration in the industrial field. Among them, OSLC is recommended by multiple international industrial organizations and has formed a complete industrial data standard system. The full name of OSLC is "Open Service for Lifecycle Collaboration", which is a set of technical specifications for solving lifecycle tool integration problems. Its core idea is to link data, that is, to identify things through HTTP URIs, to obtain information expressed in a standard form through requests, and to allow links between things. The service interface in the OSLC technical specification is obtained by layer-by-layer parsing by the client through service discovery. OSLC service discovery includes service provider catalogs, service providers, and services. These three core elements can be used to describe the various elements of data and models and their relationships. The core element corresponding to each data is identified as a unique and independent URI, and the URI can be used to access and interoperate related data.

[0004] The Chinese patent with patent number CN112465958A discloses a lightweight display method of BIM models based on WebGL. The method is to first develop the Revit-JSON interface and design the JSON format middleware format, where the JSON middleware format includes geometric data, material data and attribute data; secondly, secondary development of Revit is carried out to extract model information data, which is specifically manifested in traversing Revit nodes, obtaining model geometry, material, attribute data, obtaining temporary object files, formatting temporary object files, and converting them into JSON files; then the model is lightweight displayed, by parsing the JSON file, reconstructing and rendering on the Web side.

[0005] The Chinese patent with the patent number CN103593513A discloses a unified reading and lightweight display tool for CAE and physical test data. It includes a data import subsystem, a lightweight display subsystem, a three-dimensional display subsystem, etc. For the data import subsystem, for different CAE model file formats, different keyword lists are established in the dynamic link library, the CAE file is read and the keyword comparison is performed, and the data is transmitted after consistency; secondly, the transmitted CAE data is lightweight processed to generate streaming visualization data, and converted into a unified data format, which is the specified HSF format here, and the data in the unified data format is transmitted to the three-dimensional display subsystem. The three-dimensional display subsystem is used to process the display of visualization data in a unified interface. It is developed using the HOOPS graphics display engine, accesses the HSF file through the toolkit, converts it into the required display data, and then completes the viewing of the CAE model.

[0006] Existing model integration technologies are highly proprietary and usually build model integration tools for specific target middleware for specific domain models or data files. They are not very scalable and versatile, and lack the ability to deeply analyze Modelica multi-domain models involved in the development of complex products. The supported Modelica information interfaces also usually do not have universal data parsing capabilities and cannot support the fast and universal lightweight display of Modelica models in decentralized platform systems. Summary of the invention

[0007] 1. Technical issues to be resolved

[0008] The technical problem to be solved by the present invention is: how to enhance the query capability of Modelica model elements, increase the visualization capability of describing the model, and improve the integration efficiency.

[0009] (II) Technical solution

[0010] In order to solve the above technical problems, the present invention provides a lightweight display method of Modelica model based on development lifecycle collaboration service, and the method specifically comprises the following steps:

[0011] Step 1: Model construction and storage;

[0012] Use the Modelica model library to build a Modelica model, and store it in the Modelica model instance library of the corresponding technical field according to the technical field, and generate a .mo file;

[0013] Step 2: Model acquisition and preprocessing;

[0014] Get all models in the Modelica model instance library, parse the attribute information of the Modelica model library and Modelica models through data preprocessing, and generate data in the specified JSON format;

[0015] Step 3: OSLC element mapping;

[0016] Define the mapping between the Modelica model library and the OSLC elements of the Modelica model attribute information through JSON format data, and develop an OSLC adapter to support the generation of service provider catalogs, service providers, and service OSLC element information;

[0017] Step 4: Generate and display visual data;

[0018] Extract OSLC element information and transform it to generate the XML format required by the visualization framework MxGraph; load XML data and automatically generate lightweight Modelica model visualization data services.

[0019] Wherein, the step 1 specifically includes the following sub-steps:

[0020] Step 11: Use the Modelica modeling tool to build a Modelica model. The model building uses the Modelica graphical modeling method. Select the model component in the Modelica model library and drag it to the component view, and connect it with the corresponding component in the form of a port or a connector to complete the modeling of the physical system.

[0021] The generated model consists of Modelica elements, including instances of input terminals, output terminals, model components, connectors, model ports, constraint equations, and model parameters;

[0022] Among them, the model component is the basic component of the model and the core module in each model. Its semantics in the Modelica model is Block;

[0023] Step 12: According to different technical fields, the established Modelica models are stored in the Modelica model instance library corresponding to different technical fields, and a .mo file is generated.

[0024] Among them, the technical fields include the fields of mechanical technology, electrical technology, electronic technology, and hydraulic technology.

[0025] Wherein, the step 2 specifically includes the following sub-steps:

[0026] Step 21: Model acquisition, identifying and reading all model file information ending with .mo suffix in the Modelica model instance library;

[0027] Step 22: Model preprocessing: Use batch file method to preprocess the .mo model file and the model component information contained therein, traverse all Modelica components in the model file, including input terminals, output terminals, model components, connectors, model ports, constraint equations, and model parameter information, and preprocess the .mo file by calling the conversion template and assembling it, generate JSON format data and store it in the JSON file.

[0028] Wherein, the step 3 specifically includes the following steps:

[0029] Step 31: Model library mapping: According to the OSLC core specification, the OSLC service provider directory is used as a container to discover OSLC service providers, which helps simplify the configuration of tools integrated with service providers; Modelica model instance libraries divided according to different technical fields are respectively mapped to the service provider directories in the OSLC element, and a specific URI is generated for each OSLC service provider directory, which is used as an interface for discovering OSLC service providers;

[0030] Step 32: Model mapping: According to the OSLC core specification, the OSLC service provider provides products or online services that implement one or more OSLC services, and the service itself implements different OSLC field specifications; after entering through the URI of the upper-level OSLC service provider directory, read all model names under the model library corresponding to the service provider directory, map each model to the service provider concept in the OSLC element, and generate a specific URI for each OSLC service provider, which is used as an interface for discovering OSLC services;

[0031] Said step 33: operation interface mapping: according to the OSLC core specification, an OSLC service is a set of functions that enables a Web client to create, retrieve, update and delete resources managed by an online service provider and is associated with an OSLC domain; after entering from the URI of the upper-level OSLC service provider, the query interface for the Modelica model is mapped to the service concept in the OSLC element, the Modelica model information in JSON format is read through the query interface, and a specific URI is generated for each service as an interface for managing OSLC resources;

[0032] The step 34: model component mapping: according to the OSLC core specification, OSLC resources are managed by OSLC services, are the smallest units of OSLC data services, have attributes and can be linked to other resources; then the model components are mapped to resource concepts in OSLC elements.

[0033] Wherein, in step 34, the model component information includes geometric information and attribute information: the geometric information includes shape information and position information; the attribute information includes ID, label, attribute value and / or input and output information.

[0034] Wherein, in step 34, the model component is defined using the data structure of RDF triples:

[0035] That is, the triple consisting of subject, predicate and object is regarded as the smallest unit constituting the topological structure of Modelica model. A triple contains the connection between a model component and a connector, so as to realize the lightweight display of Modelica model graphics;

[0036] The subject and object in the triple are defined as Modelica components, including input terminals, output terminals, model components, connectors, model ports, constraint equations, and model parameters. The predicate is the attribute description and connection between the subject and the object.

[0037] The subject, object and predicate in the triple are mapped to Modelica components and their associations, and at the same time, the links between triples are realized by the Modelica components as subjects and objects, supporting the definition of data resources in OSLC.

[0038] Wherein, the step 4 specifically includes the following sub-steps:

[0039] Step 41: extract OSLC element information and convert it, from the RDF data of OSLC, that is, all Modelica components in the triple data, including input terminals, output terminals, model components, connectors, model ports, constraint equations, and model parameter information, by calling the conversion template and assembling, realize the processing of the data expressed by OSLC, generate the XML format required by the visualization framework MxGraph, and complete the mapping from OSLC data to XML format;

[0040] Step 42: The visualization framework loads the XML data and automatically generates a lightweight Modelica model graphic visualization data service to visualize the Modelica model topology structure.

[0041] The method is used to extract Modelica model structure data and generate a model structure for web display, and also supports effective integration of Modelica data with other tool platforms.

[0042] The original input of the method is: a Modelica model library, which is used for modeling in a Modelica modeling tool;

[0043] The processing actions of the method include:

[0044] (1) Use the Modelica modeling tool to reference the general model in the Modelica model library to build a domain-specific Modelica model and save the model as a .mo file;

[0045] (2) Generate RDF data corresponding to OSLC, i.e. triple data, through the OSLC adapter;

[0046] The final output of the method is: through the lightweight model display technology, the RDF data of OSLC, that is, the triple data, is imported, and the network-side display of the Modelica model topology diagram is performed, which is finally used for other tools to call the Modelica model data.

[0047] (III) Beneficial effects

[0048] Compared with the prior art, the present invention has the following beneficial effects:

[0049] (1) The present invention provides a method for supporting the interoperability and visualization of Modelica model structure and integration platform, using development lifecycle collaboration service for specification definition, developing Modelica model interpretation tool, and querying and converting the complex model structure composed of multiple model elements (including packages, classes, connections, etc.) as a whole. At present, in the traditional data integration process, the Modelica model is translated into a specified format, such as XML, and then imported into other tools to realize the reading of Modelica information. With this solution, on the one hand, through the generated specified OSLC data, a standardized data interface is provided for Modelica data integration on other platforms, and there is no need to define the data structure by itself; on the other hand, through the model visualization method, the user only needs to view the model structure through the URI, without the need to translate the Modelica data into a specified format through a specific Modelica tool, thereby improving user friendliness and enhancing the ability and efficiency of data integration; in addition, the present invention proposes a Modelica element extraction technology based on development lifecycle collaboration service, which can screen the specific display details of the Modelica model according to user needs, such as parameters, and realize the visualization of Modelica data through query service.

[0050] (2) The present invention provides an open lifecycle collaboration service (OSLC) method that supports Modelica model structure conversion, develops an OSLC adapter, solves the problem of poor integration between other modeling tools and Modelica, and can define OSLC templates according to user needs to generate various types of Modelica adapters with high flexibility; the present invention can query both a single model element and a model structure composed of multiple elements, use appropriate model element query services, and can provide a lightweight model topology network display. The traditional file-based model integration method uses intermediate files as a transmission medium to achieve mutual integration between models. In comparison, the present method does not need to convert other model files into intermediate files, but only needs to generate a network call service corresponding to local file data through an OSLC adapter to support operations on local data. Therefore, in the process of calling Modelica model data on other platforms, it is beneficial to obtain Modelica model data through a smaller number of script codes, thereby improving the development efficiency in the integration process of other tool platforms.

[0051] (3) Compared with the existing Modelica web service query method, the present invention provides a web service query method for a Modelica model structure based on the OSLC standard specification, extends the REST API interface based on the development lifecycle collaboration service OSLC, proposes a web-based interoperability interface API, and realizes interoperability applications in the data integration process. The traditional Modelica web integration method is to develop a Modelica editor and interpreter on the web platform, while the web service and query method provided by the present method are highly flexible and do not require the development of independent data interface tools for intermediate files. In addition, the defined interface is based on the OSLC interface specification, so the interface reuse capability is effectively improved.

[0052] (4) Traditional integration methods usually use a centralized data integration platform to achieve data integration of heterogeneous data through private model integration rules. Compared with traditional methods, this method emphasizes the decentralized integration platform approach, and enhances the integration and call capabilities of other tools for Modelica model data through OSLC services generated by OSLC adapters and lightweight display technology when there is no data integration platform.

[0053] (5) The present invention provides a lightweight display method for Modelica models that supports web-side display, uses the development lifecycle collaboration service as a data transfer, supports the use of a web page URI to visualize a complex model structure composed of multiple Modelica model elements (including packages, classes, connections, etc.) as a whole, improves the data parsing capability for the Modelica model, and realizes the data integration capability of other tools for the Modelica model. Traditional model integration methods usually develop a specific visualization front end for the Modelica specification to display the Modelica model structure, and this process requires a lot of development time and effort. Compared with traditional model integration methods, this method provides a lightweight display of the model structure on the web side, without the need to develop a model structure display component on the integration side, thereby reducing the development cost of visualization components during the integration process. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 Schematic diagram of an example of triple pattern expression.

[0055] Figure 2 Build a storage and preprocessing diagram for a Modelica model.

[0056] Figure 3 This is a schematic diagram of OSLC element mapping.

[0057] Figure 4 This is a schematic diagram of the OSLC visualization module of the Modelica model. DETAILED DESCRIPTION

[0058] In order to make the purpose, content, and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the accompanying drawings and examples.

[0059] To achieve the technical objectives of the present invention, the present invention provides a Modelica lightweight visualization technology based on open lifecycle collaboration services, which can extract both single model elements and model structures composed of multiple elements, and uniformly convert them into designated open lifecycle collaboration service data, and then realize the visualization of Modelica models through lightweight display technology, which is conducive to reducing the workload in the Modelica integration process and improving the integration efficiency of the lifecycle research and development platform. Using data key connection technology with strong flexibility, adopting OSLC specifications based on development lifecycle collaboration services, it can support Modelica to generate RDF format (triple data, i.e. Resource Description Framework, is a set of markup language technical specifications proposed by the World Wide Web Consortium (W3C), based on XML syntax and XML Schema to describe and express network resources and their topological structures.) based on OSLC specifications to the target language, and provide the formulation of REST API interface to realize cross-platform Modelica data interoperability. At the same time, a visual display of a one-dimensional model structure is provided to support front-end integration with other platforms. Compared with the currently mainstream integration methods, this method is based on the OSLC specification that provides a specified REST API interface, provides a standardized interface for the structural information interoperability of the Modelica model, enhances the query capability of the Modelica model elements, and constructs a complex model structure composed of multi-level elements from the element information in the Modelica model structure, but increases the visualization capability of the description model and improves the integration efficiency.

[0060] In order to solve the above technical problems, the present invention provides a lightweight display method of Modelica model based on development lifecycle collaboration service, and the method specifically comprises the following steps:

[0061] Step 1: Model construction and storage;

[0062] Use the Modelica model library to build a Modelica model, and store it in the Modelica model instance library of the corresponding technical field according to the technical field, and generate a .mo file;

[0063] Step 2: Model acquisition and preprocessing;

[0064] Get all models in the Modelica model instance library, parse the attribute information of the Modelica model library and Modelica models through data preprocessing, and generate data in the specified JSON format;

[0065] Step 3: OSLC element mapping;

[0066] Define the mapping between the Modelica model library and the OSLC elements of the Modelica model attribute information through JSON format data, and develop an OSLC adapter to support the generation of service provider catalogs, service providers, and service OSLC element information;

[0067] Step 4: Generate and display visual data;

[0068] Extract OSLC element information and transform it to generate the XML format required by the visualization framework MxGraph; load XML data and automatically generate lightweight Modelica model visualization data services.

[0069] Wherein, the step 1 specifically includes the following sub-steps:

[0070] Step 11: Use the Modelica modeling tool to build a Modelica model. The model building uses the Modelica graphical modeling method. Select the model component in the Modelica model library and drag it to the component view, and connect it with the corresponding component in the form of a port or a connector to complete the modeling of the physical system.

[0071] The generated model consists of Modelica elements, including instances of input terminals, output terminals, model components, connectors, model ports, constraint equations, and model parameters;

[0072] Among them, the model component is the basic component of the model and the core module in each model. Its semantics in the Modelica model is Block;

[0073] Step 12: According to different technical fields, the established Modelica models are stored in the Modelica model instance library corresponding to different technical fields, and a .mo file is generated.

[0074] Among them, the technical fields include the fields of mechanical technology, electrical technology, electronic technology, and hydraulic technology.

[0075] Wherein, the step 2 specifically includes the following sub-steps:

[0076] Step 21: Model acquisition, identifying and reading all model file information ending with .mo suffix in the Modelica model instance library;

[0077] Step 22: Model preprocessing: Use batch file method to preprocess the .mo model file and the model component information contained therein, traverse all Modelica components in the model file, including input terminals, output terminals, model components, connectors, model ports, constraint equations, and model parameter information, and preprocess the .mo file by calling the conversion template and assembling it, generate JSON format data and store it in the JSON file.

[0078] Wherein, the step 3 specifically includes the following steps:

[0079] Step 31: Model library mapping: According to the OSLC core specification, the OSLC service provider directory is used as a container to discover OSLC service providers, which helps simplify the configuration of tools integrated with service providers; Modelica model instance libraries divided according to different technical fields are respectively mapped to the service provider directories in the OSLC element, and a specific URI is generated for each OSLC service provider directory, which is used as an interface for discovering OSLC service providers;

[0080] Step 32: Model mapping: According to the OSLC core specification, the OSLC service provider provides products or online services that implement one or more OSLC services, and the service itself implements different OSLC field specifications; after entering through the URI of the upper-level OSLC service provider directory, read all model names under the model library corresponding to the service provider directory, map each model to the service provider concept in the OSLC element, and generate a specific URI for each OSLC service provider, which is used as an interface for discovering OSLC services;

[0081] Said step 33: operation interface mapping: according to the OSLC core specification, an OSLC service is a set of functions that enables a Web client to create, retrieve, update and delete resources managed by an online service provider and is associated with an OSLC domain; after entering from the URI of the upper-level OSLC service provider, the query interface for the Modelica model is mapped to the service concept in the OSLC element, the Modelica model information in JSON format is read through the query interface, and a specific URI is generated for each service as an interface for managing OSLC resources;

[0082] The step 34: model component mapping: according to the OSLC core specification, OSLC resources are managed by OSLC services, are the smallest units of OSLC data services, have attributes and can be linked to other resources; then the model components are mapped to resource concepts in OSLC elements.

[0083] Wherein, in step 34, the model component information includes geometric information and attribute information: the geometric information includes shape information and position information; the attribute information includes ID, label, attribute value and / or input and output information.

[0084] Wherein, in step 34, the model component is defined using the data structure of RDF triples:

[0085] That is, the triple consisting of subject, predicate and object is regarded as the smallest unit constituting the topological structure of Modelica model. A triple contains the connection between a model component and a connector, so as to realize the lightweight display of Modelica model graphics;

[0086] The subject and object in the triple are defined as Modelica components, including input terminals, output terminals, model components, connectors, model ports, constraint equations, and model parameters. The predicate is the attribute description and connection between the subject and the object.

[0087] The subject, object and predicate in the triple are mapped to Modelica components and their associations, and at the same time, the links between triples are realized by the Modelica components as subjects and objects, supporting the definition of data resources in OSLC.

[0088] like Figure 1 As shown in the example of triple pattern expression, the single subject and object in the above triple can be defined as Modelica components. Through the data set of all triples, the unified information description of the Modelica model can be realized, thereby supporting lightweight display on the network side.

[0089] Wherein, the step 4 specifically includes the following sub-steps:

[0090] Step 41: extract OSLC element information and convert it, from the RDF data of OSLC, that is, all Modelica components in the triple data, including input terminals, output terminals, model components, connectors, model ports, constraint equations, and model parameter information, by calling the conversion template and assembling, realize the processing of the data expressed by OSLC, generate the XML format required by the visualization framework MxGraph, and complete the mapping from OSLC data to XML format;

[0091] Step 42: The visualization framework loads the XML data and automatically generates a lightweight Modelica model graphic visualization data service to visualize the Modelica model topology structure.

[0092] The method is used to extract Modelica model structure data and generate a model structure for web display, and also supports effective integration of Modelica data with other tool platforms.

[0093] The original input of the method is: a Modelica model library, which is used for modeling in a Modelica modeling tool;

[0094] The processing actions of the method include:

[0095] (1) Use the Modelica modeling tool to reference the general model in the Modelica model library to build a domain-specific Modelica model and save the model as a .mo file;

[0096] (2) Generate RDF data corresponding to OSLC, i.e. triple data, through the OSLC adapter;

[0097] The final output of the method is: through the lightweight model display technology, the RDF data of OSLC, that is, the triple data, is imported, and the network-side display of the Modelica model topology diagram is performed, which is finally used for other tools to call the Modelica model data.

[0098] Example 1

[0099] In order to make the technical personnel in this field better understand the present application scheme, the following will be combined with the appended examples of the present application. Figure 2-Figure 4 , clearly and completely describe the technical solutions in the embodiments of the present application.

[0100] Step S1: Figure 2 As shown, the Modelica model is constructed and stored. The core steps are as follows:

[0101] Step S11: Based on the Modelica model library, construct a Modelica model and save it into a .mo file;

[0102] Step S12: Store the established models in the Modelica model instance library according to different fields such as mechanics, electrical, electronic, hydraulic, etc., and generate .mo files.

[0103] Step S2: Figure 2 As shown in the figure, model acquisition and preprocessing. Obtain all model files in the Modelica model instance library, parse the model library and model attributes and other information through data preprocessing, and generate JSON files and REST interfaces. The relevant core steps are as follows:

[0104] Step S21: Identify and read the Modelica models in all the model files ending with .mo suffix stored in step S21;

[0105] Step S22: Develop an OSLC semantic parsing module to generate a semantic tree from the semantic parsing in the Modelica model; develop an OSLC data conversion template based on the OSLC core semantic specification; develop an OSLC data conversion module based on the OSLC data conversion template, which imports the Modelica semantic tree and generates a Json file and a REST interface that meet the OSLC specification template based on the OASIS OSLC library.

[0106] Step S3: Figure 3 As shown, OSLC element mapping. Read the JSON file generated in step S22, define the mapping of OSLC elements of information such as model library and model attributes, develop OSLC adapters, generate service provider directory, service provider and service interfaces, and the relevant core steps are as follows:

[0107] Step S31: Map the model libraries divided into different fields to the service provider directories in the OSLC element respectively, and generate a specific URI for each OSLC service provider directory for discovering the interface of the OSLC service provider;

[0108] Step S32: read all model names under the model library corresponding to the service provider directory, map each model to a service provider in the OSLC element, and generate a specific URI for each OSLC service provider for discovering the interface of the OSLC service;

[0109] Step S33: Map the operation interface of the Modelica model to the service concept in the OSLC element, read the Modelica model information in JSON format through the data interface, and generate a specific URI for each service as an interface for managing OSLC resources;

[0110] Step S34: Map the model component to a resource described by an OSLC RDF triple, where the model component information includes geometric information and attribute information: the geometric information includes shape information and position information; the attribute information includes ID, label, attribute value and / or input and output information.

[0111] Step S4: Figure 4 As shown, generate visualization data and display it. Extract OSLC element information and transform it to generate the XML format required by the visualization framework MxGraph. The Modelica web-side visualization interface loads XML data to visualize the Modelica model. The relevant core steps are as follows:

[0112] Step S41: extract OSLC element information and convert it, from all Modelica elements in OSLC RDF triple data, including input end, output end, model component, connector, model port, constraint equation, model parameter and other information, by calling conversion template and assembling, realize the processing of data expressed by OSLC, generate XML format data required by visualization framework MxGraph, and complete the mapping from OSLC data to XML format;

[0113] Step S42: The visualization framework loads the XML data and automatically generates a lightweight Modelica model graphic visualization data service to visualize the Modelica model topology structure.

[0114] In summary, the present invention provides a method for supporting the conversion of Modelica models into OSLC standard data and performing network visualization. According to the model elements to be displayed, the topology information in the original Modelica model is determined, and the information to be dynamically filled comes from the Modelica model in step S12; then, which model element (including class, association, etc.) information of the Modelica model in step S12 is determined, and the model structure where these information are located is determined, and the OSLC standard template defined in step S22 is selected according to the characteristics of this model structure, and the model structure is described using the template to obtain the type of each element in the template and the association relationship between the Modelica elements, and then the OSLCJson file and OSLC REST interface are generated through the OSLC data conversion module. Then, in step 3, the Json file generated in step S22 is read, the mapping of OSLC elements of information such as model library and model attributes is defined, an OSLC adapter is developed, a service provider directory, service provider and service interfaces are generated, and the model components are mapped to resources described by OSLC RDF triples. Then in step 4, the OSLC element information is extracted and transformed to generate the XML format required by the visualization framework MxGraph; the XML data is loaded to automatically generate a lightweight Modelica model visualization data service.

[0115] Compared with the existing data integration methods, the Modelica integration solution proposed in this invention has the following advantages:

[0116] (1) Supports the expression of Modelica model structures based on the Open Lifecycle Collaboration Services (OSLC) specification. It can describe the OSLC specification with a single model element or a model structure composed of multiple elements. Using the appropriate model transfer mode is helpful to reduce the amount of script code and improve conversion efficiency.

[0117] (2) Based on the OSLC specification, an OSLC specification conversion adapter is developed to define the rules and templates for conversion, freely match the required OSLC data types, and have strong reusability.

[0118] (3) Generate OSLC specification data from the Modelica model, provide a REST API with a unique identifier, and implement the add, delete, modify, and query operations for Modelica's OSLC data. The Modelica language model is parsed with underlying elements such as classes and modules to generate OSLC data specifications. The data is added, deleted, modified, and queried through the REST API of the defined OSLC data specifications, and a web-based visual model structure display platform is developed. The use of unified OSLC specification data and visual front-ends improves integration capabilities, reduces the learning cost of the Modelica language for system developers, and promotes interoperability between the modeling environment and the integration platform.

[0119] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A lightweight display method of Modelica model based on development lifecycle collaboration service, It is characterized in that The method specifically comprises the following steps: Step 1: Model construction and storage; Use the Modelica model library to build a Modelica model, and store it in the Modelica model instance library of the corresponding technical field according to the technical field, and generate a .mo file; Step 2: Model acquisition and preprocessing; Get all models in the Modelica model instance library, parse the attribute information of the Modelica model library and Modelica models through data preprocessing, and generate data in the specified JSON format; Step 3: OSLC element mapping; Define the mapping between the Modelica model library and the OSLC elements of the Modelica model attribute information through JSON format data, and develop an OSLC adapter to support the generation of service provider catalogs, service providers, and service OSLC element information; Step 4: Generate and display visual data; Extract OSLC element information and transform it to generate the XML format required by the visualization framework MxGraph; load XML data and automatically generate lightweight Modelica model visualization data services.

2. The lightweight display method of Modelica model based on development lifecycle collaborative service as claimed in claim 1, It is characterized in that The step 1 specifically includes the following sub-steps: Step 11: Use the Modelica modeling tool to build a Modelica model. The model building uses the Modelica graphical modeling method. Select the model component in the Modelica model library and drag it to the component view, and connect it with the corresponding component in the form of a port or a connector to complete the modeling of the physical system. The generated model consists of Modelica elements, including instances of input terminals, output terminals, model components, connectors, model ports, constraint equations, and model parameters; Among them, the model component is the basic component of the model and the core module in each model. Its semantics in the Modelica model is Block; Step 12: According to different technical fields, the established Modelica models are stored in the Modelica model instance library corresponding to different technical fields, and a .mo file is generated.

3. The lightweight display method of Modelica model based on development lifecycle collaborative service as claimed in claim 2, It is characterized in that The technical fields include the fields of mechanical technology, electrical technology, electronic technology and hydraulic technology.

4. The lightweight display method of Modelica model based on development lifecycle collaborative service as claimed in claim 2, It is characterized in that The step 2 specifically includes the following sub-steps: Step 21: Model acquisition, identifying and reading all model file information ending with .mo suffix in the Modelica model instance library; Step 22: Model preprocessing: Use batch file method to preprocess the .mo model file and the model component information contained therein, traverse all Modelica components in the model file, including input terminals, output terminals, model components, connectors, model ports, constraint equations, and model parameter information, and preprocess the .mo file by calling the conversion template and assembling it, generate JSON format data and store it in the JSON file.

5. The lightweight display method of Modelica model based on development lifecycle collaborative service as claimed in claim 4, It is characterized in that The step 3 specifically includes the following steps: Step 31: Model library mapping: According to the OSLC core specification, the OSLC service provider directory is used as a container to discover OSLC service providers, which helps simplify the configuration of tools integrated with service providers; the Modelica model instance libraries divided according to different technical fields are mapped to the service provider directory in the OSLC element, and a specific URI is generated for each OSLC service provider directory, which is used as an interface for discovering OSLC service providers; Step 32: Model mapping: According to the OSLC core specification, the OSLC service provider provides products or online services that implement one or more OSLC services, and the service itself implements different OSLC domain specifications; after entering through the URI of the upper-level OSLC service provider directory, read all model names under the model library corresponding to the service provider directory, map each model to the service provider concept in the OSLC element, and generate a specific URI for each OSLC service provider, which is used as an interface for discovering OSLC services; Step 33: Operation interface mapping: According to the OSLC core specification, an OSLC service is a set of functions that enables a Web client to create, retrieve, update, and delete resources managed by an online service provider and is associated with an OSLC domain; After entering through the URI of the upper-level OSLC service provider, the query interface for the Modelica model is mapped to the service concept in the OSLC element, the Modelica model information in JSON format is read through the query interface, and a specific URI is generated for each service as the interface for managing OSLC resources; Step 34: Model component mapping: According to the OSLC core specification, OSLC resources are managed by OSLC services, are the smallest units of OSLC data services, have attributes and can be linked to other resources; then map the model components to resource concepts in OSLC elements.

6. The lightweight display method of Modelica model based on development lifecycle collaborative service as claimed in claim 5, It is characterized in that In step 34, the model component information includes geometric information and attribute information: the geometric information includes shape information and position information; the attribute information includes ID, label, attribute value and / or input and output information.

7. The Modelica model lightweight display method based on development lifecycle collaborative service as claimed in claim 6, It is characterized in that In step 34, the model component is defined using the data structure of RDF triples: That is, the triple consisting of subject, predicate and object is regarded as the smallest unit constituting the topological structure of Modelica model. A triple contains the connection between a model component and a connector, so as to realize the lightweight display of Modelica model graphics; The subject and object in the triple are defined as Modelica components, including input terminals, output terminals, model components, connectors, model ports, constraint equations, and model parameters. The predicate is the attribute description and connection between the subject and the object. The subject, object and predicate in the triple are mapped to Modelica components and their associations, and at the same time, the links between triples are realized by the Modelica components as subjects and objects, supporting the definition of data resources in OSLC.

8. The Modelica model lightweight display method based on development lifecycle collaborative service as claimed in claim 7, It is characterized in that The step 4 specifically includes the following sub-steps: Step 41: extract OSLC element information and convert it, from the RDF data of OSLC, that is, all Modelica components in the triple data, including input terminals, output terminals, model components, connectors, model ports, constraint equations, and model parameter information, by calling the conversion template and assembling, realize the processing of the data expressed by OSLC, generate the XML format required by the visualization framework MxGraph, and complete the mapping from OSLC data to XML format; Step 42: The visualization framework loads the XML data and automatically generates a lightweight Modelica model graphic visualization data service to visualize the Modelica model topology structure.

9. The Modelica model lightweight display method based on development lifecycle collaborative service as claimed in claim 8, It is characterized in that The method is used to extract Modelica model structure data and generate a model structure for web display, and also supports effective integration of Modelica data with other tool platforms.

10. The lightweight display method of Modelica model based on development lifecycle collaborative service as claimed in claim 9, It is characterized in that The original input of the method is: a Modelica model library, which is used for modeling in the Modelica modeling tool; The processing actions of the method include: (1) Use the Modelica modeling tool to reference the general model in the Modelica model library to build a domain-specific Modelica model and save the model as a .mo file; (2) Generate RDF data corresponding to OSLC, i.e. triple data, through the OSLC adapter; The final output of the method is: through the lightweight model display technology, OSLC RDF data, that is, triple data, is imported, and the network-side display of the Modelica model topology diagram is performed, which is finally used for other tools to call the Modelica model data.