Disclosure of Invention
The application provides a method, a device, computing equipment and a storage medium for creating a digital twin model, which can improve the development efficiency of the digital twin model. The technical scheme is as follows:
in a first aspect, a method for creating a digital twin model is provided, the method comprising:
responding to a model creation instruction aiming at a target object, acquiring a digital twin modeling language DTML meta-model of the target object, wherein the model creation instruction carries a functional description of the target object;
obtaining a digital twin model of the target object according to the function parameters of the multiplexing object indicated by the object information of the multiplexing object in the function description and the function parameters of the DTML meta-model; and/or the number of the groups of groups,
A model application program interface API of the digital twin model is generated according to a method unit and a function description in a plurality of function units included in the DTML meta-model.
In the process of creating the digital twin model of the target object, at least one of multiplexing the functions of the multiplexed object and generating the model API can be realized. On the one hand, the function parameters of the DTML meta-model can be updated based on the object information of the multiplexing object to obtain a digital twin model of the target object, so that the digital twin model of the target object multiplexes the function of the multiplexing object; on the other hand, the synchronous creation of the model API can be completed through a newly added method unit in the basic model architecture of the DTML meta-model. Because in the process of creating the digital twin model, the function parameters can be updated directly based on the object information of the multiplexing object, the existing functions are not required to be multiplexed by copying a large amount of codes of the multiplexing object or by a pointer link jump mode; the creation logic of the model API is provided by the method unit in the DTML meta-model, and the model API with consistency with the model can be efficiently generated, so that the development efficiency of the digital twin model is greatly improved.
In one possible implementation manner, according to the function parameters of the multiplexing object indicated by the object information of the multiplexing object in the function description and the function parameters of the DTML meta-model, a digital twin model of the target object is obtained, including:
according to the object information of the multiplexing object carried by the function description, updating the function parameters of the multiplexing object indicated by the object information into the function parameters of the DTML meta-model to obtain a digital twin model of the target object; or alternatively, the first and second heat exchangers may be,
According to the function description, the function parameters of the DTML meta-model are updated into the function parameters of the multiplexing object, and the digital twin model of the target object is obtained.
The two multiplexing modes can respectively realize direct multiplexing of the existing functional parameters into the model to be created and expansion of the model to be created as a function into the released model corresponding to the multiplexing object, so that bidirectional multiplexing is realized, and the development efficiency of the model is effectively improved.
In one possible implementation manner, the multiplexing object corresponds to a published digital twin model, the object information includes a model identifier of the published digital twin model, and according to the object information of the multiplexing object carried by the function description, the function parameters of the multiplexing object indicated by the object information are updated into the function parameters of the DTML meta-model, including:
And updating the content of a first variable in the DTML meta-model according to a first model identifier included in the object information, wherein the first model identifier indicates a multiplexed first digital twin model, and the first variable is used for enabling the digital twin model to realize the function of the first digital twin model.
Through the technical scheme, the model can be directly used as granularity for multiplexing, and in the process of creating a new model, the integral multiplexing of the functions of the released model is realized, so that multiplexing logic which is concise, standard and convenient to use is provided, and the efficiency of creating the digital twin model corresponding to the target object is effectively improved.
In one possible implementation manner, the multiplexing object corresponds to a published digital twin model, the object information includes reference information of a first function parameter, and according to the object information of the multiplexing object carried by the function description, the function parameter of the multiplexing object indicated by the object information is updated into the function parameter of the DTML meta-model, including:
And updating the content of a second variable in the DTML meta-model according to the reference information of the first functional parameter, wherein the reference information indicates the first functional parameter which is referenced in the second digital twin model, and the second variable is used for enabling the digital twin model to realize the function of the first functional parameter in the second digital twin model.
Through the technical scheme, the function parameters in the model can be directly used as granularity for multiplexing, in the process of creating a new model, the accurate multiplexing of partial functions in the released model is realized, the related code quantity of the model is reduced, and a simple, standard and convenient-to-use multiplexing logic is provided, so that the efficiency of creating the digital twin model corresponding to the target object is effectively improved.
In one possible implementation, after updating the content of the second variable in the DTML meta-model according to the reference information of the first functional parameter, the method further includes:
If the second variable corresponds to the multiplexing keyword, acquiring the first functional parameter into the functional parameter of the digital twin model;
And if the second variable corresponds to the replacement keyword, replacing the functional parameter indicated by the replacement keyword in the digital twin model with the first functional parameter.
The two keywords can respectively refer to the existing function parameters of the model to be created and update the function parameters with the same name in the model to be created. Based on the method, convenient function upgrading and logic expansion can be provided for different service scenes, and the development efficiency of the model is effectively improved.
In one possible implementation, the multiplexing object corresponds to a published digital twin model, the object information includes a model identification of the published digital twin model, and updating the function parameters of the DTML meta-model into the function parameters of the multiplexing object according to the function description includes:
And according to a third model identifier included in the object information, updating the functional parameters of the DTML meta-model into the functional parameters of the third digital twin model, wherein the third model identifier indicates the multiplexed third digital twin model, and the digital twin model operates as a sub-model of the third digital twin model.
By the technical scheme, a simple and convenient model upgrading and expanding logic is provided for different service scenes, the published model can be efficiently upgraded or expanded, and the development efficiency of the model is effectively improved.
In one possible implementation, the multiplexing object is a second functional parameter in the digital twin model to be created, and the object information includes reference information of the second functional parameter; according to the object information in the function description, updating the function parameters of the DTML meta-model, including:
and updating the content of a fourth variable in the DTML meta-model according to the reference information of the second functional parameter, wherein the fourth variable is used for enabling the digital twin model to reference the second functional parameter in the digital twin model.
Based on the method, the multiplexed object can be a sub-model function parameter of the model to be created, multiplexing logic is richer, more development requirements are covered, and development efficiency of the model is further improved.
In one possible implementation, the method unit in the DTML metamodel is configured to multiplex functional parameters of other functional units in the DTML metamodel, where the other functional units include at least one of a command unit, an event unit, an attribute unit, a component unit, a relationship unit, and a data unit.
Logic for multiplexing the function parameters of the model to be created can be contained in a newly created method unit, and a convenient parameter multiplexing mode is provided for the function development of the model, so that the development efficiency of processes such as generating a model API, creating the model and the like is improved.
In one possible implementation, generating a model application program interface API of the digital twin model according to a method unit and a function description of a plurality of function units included in the DTML meta model includes:
According to the API function information carried by the function description, determining input parameters and output parameters of a model API of the digital twin model from the function parameters of a plurality of function units according to an API configuration format described by a method unit so as to generate at least one model API, wherein the API function information indicates the function parameters related to the model API.
In one possible implementation manner, according to the API function information carried by the function description, determining, according to the API configuration format described by the method unit, input parameters and output parameters of a model API of the digital twin model from the function parameters of the plurality of function units, includes:
Under the condition that the API function information indicates that the model API is of an access type, according to an API configuration format, mapping the function parameters of the attribute units in the DTML meta-model into output parameters of the model access API, mapping the function parameters of the object model corresponding to the target object into input parameters of the model access API, and enabling the object model to comprise at least one of a command unit, an attribute unit and a component unit.
Through the technical scheme, the model access API with high consistency with the model self architecture can be generated aiming at the example data generated by the model operation in the model creation process, the consistency problem is reduced while the writing workload of the model API is reduced, the user experience is improved, and the development efficiency of the model is comprehensively improved.
In one possible implementation manner, according to the API function information carried by the function description, determining, according to the API configuration format described by the method unit, input parameters and output parameters of a model API of the digital twin model from the function parameters of the plurality of function units, includes:
Under the condition that the API function information indicates that the model API is of a management type, according to an API configuration format, mapping the function parameters of the attribute units and the function parameters of the command units in the DTML meta-model into output parameters of the model management API, and mapping the parameters of the component units and the parameters of the command units in the DTML meta-model into input parameters of the model management API.
Through the technical scheme, the model management API with high consistency with the architecture of the model itself can be generated aiming at the model management requirements possibly related in the subsequent application process in the model creation process, the consistency problem is reduced while the writing workload of the model API is reduced, the user experience is improved, and a layered management interface is provided for model asset management, so that the development efficiency of the model can be comprehensively improved.
In one possible implementation, the API configuration format includes a request format and a response format; the request format indicates the content of the API request, which includes: request type, model identification and response mode;
the response format indicates the content of the API response, which includes: response status, model identification, and response content.
By the technical scheme, the flexibly configurable API format is integrated in the creation flow of the digital twin model, and the standard configuration standard is provided for the request content and the response content of the model API, so that the generation of the model API can be automatically realized in the model creation process, the writing workload of the model API is reduced, and the model development efficiency is improved.
In one possible embodiment, the method further comprises:
in response to receiving an API request for the digital twin model, acquiring the content of an API response from the functional parameters of at least one functional unit corresponding to the output parameters of the model API according to the input parameters of the model API carried by the API request, so as to return the API response.
Based on the method, standard and accurate model instance data can be provided according to the request of the user, a reliable interface is provided for the user to perform data analysis or model asset management, and the efficiency of the user to perform model development is improved.
In one possible embodiment, the method unit refers to:
Any one of a command unit, an event unit, an attribute unit, a component unit, a relationship unit, and a data unit of the DTML meta-model; or, a subclass of any of a command unit, an event unit, an attribute unit, a component unit, a relationship unit, and a data unit; or, functional units in the DTML metamodel other than command units, event units, attribute units, component units, relationship units, and data units. Based on the method, rich function unit realization granularity is provided, so that functions of the newly expanded method units can be realized according to expansion requirements in different application scenes, and the method can be flexibly applied to various model development architectures.
In a second aspect, there is provided an apparatus for creating a digital twin model, the apparatus comprising a plurality of functional modules for performing corresponding steps in the method for creating a digital twin model as provided in the first aspect.
In a third aspect, there is provided a computing device comprising a processor and a memory, the processor of the computing device being operable to execute instructions stored in the memory of the computing device to cause the computing device to perform the method of creation of a digital twin model as provided in the first aspect.
In a fourth aspect, there is provided a computer readable storage medium comprising computer program instructions which, when executed by a computing device, perform the method of creating a digital twin model as provided in the first aspect.
In a fifth aspect, there is provided a computer program product containing instructions which, when executed by a computing device, cause the computing device to perform the method of creating a digital twin model as provided in the first aspect.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
Before the technical scheme provided by the embodiment of the application is introduced, related concepts related to the application are introduced.
Digital twinning (DIGITAL TWIN, DT) refers to a process and method that uses digital techniques to describe and model the characteristics, behavior, formation processes, performance, etc. of physical entity objects.
The digital twin technology is effectively applied to digital construction in the fields of digital city, medical treatment, electric power, communication, environmental protection and the like. The digital twin network (DIGITAL TWIN network, DTN) constructed for the communication field can transmit information and data codes in the physical world to the digital world through the internet of things perception technology. Digital twin networks, also known as Network Digital Twin (NDT), simulate the functional characteristics of a physical communication network, such as the geometry, operating state, internal operating mechanisms, and interactive behavioral logic with the environment, etc., of the network device by creating a digital twin model corresponding to a physical entity (e.g., network device) in the physical communication network.
The digital twin modeling language (DIGITAL TWIN modelling language, DTML) provides a canonical standard for digital twin modeling. Among them, DTML supports 6 functional units of commands, events, attributes, components, relationships, and data formats, which can be used to complete modeling of most networks. Any of several functional units provided by the DTML described above may constitute a DTML meta-model. The DTML metamodel describes a generic model architecture, which is equivalent to providing associations between the individual functional units that make up the model. Fig. 1 is a schematic diagram of a DTML metamodel provided in the present application, where the DTML metamodel includes functional units of components, behaviors (events/commands), attributes, and relationships, which are used to describe functional characteristics of objects (corresponding to a model instance), respectively, where the behaviors can be defined by the two functional units of events or commands.
Digital twin development platforms typically provide model development services based on digital twin engines (DIGITAL TWIN ENGINE, DTE). The DTE provides a software architecture system for digital twin model development, and can provide a series of code class libraries and core components involved in digital twin model development and digital twin network system construction. The developer can efficiently create a model and lay down the model by using DTE. Typically, a developer describes a digital twin model to be created through DTML, DTE parses, compiles and executes the acquired DTML statements, schedules class libraries and related components to run the digital twin model.
However, in some application scenarios, the model architecture provided by the DTML meta-model provided in fig. 1 is relatively simple, and the efficiency of model development based on the architecture provided in fig. 1 is low. In view of the above, the application provides a method for creating a digital twin model, which can effectively improve the efficiency of developing the digital twin model.
The application scenario of the digital twin model creation method provided by the application is described below.
Application scene 1, model multiplexing.
In some scenarios, in order to save code repetition rate, a developer multiplexes the created digital twin model (referred to as published model for short) in the process of creating the digital twin model. In the related art, a jump to the released model by means of pointer link is provided, and the normal use of the released model by other users is affected by modification, reuse and other changing operations on the released model. In other related technologies, in order to avoid affecting other users, a mode of copying the released model code is provided to reuse the model, and the mode has the problems of large copy quantity, high code repetition rate and the like, so that the model development efficiency is low.
Application scenario 2, model instance data management.
In some scenarios, model instance data of a digital twin model can be used for data analysis. And a developer needs to access the operation data of the released model, so that a corresponding API needs to be created on the basis of the released model according to the access requirement, the process has great workload and low model development efficiency. Moreover, in the above-described method, the two processes of creating the digital twin model and creating the model API are independently completed, if the model API and the model API are developed in parallel by different development teams, the problem of consistency of the model API and the model is likely to occur, so that the usability of the model API is affected.
An embodiment of the present application provides a schematic diagram of an implementation environment, and fig. 2 is a schematic diagram of an implementation environment provided by an embodiment of the present application, referring to fig. 2, where the implementation environment includes a server 201 and a terminal 202.
The server 201 is configured to run a digital twin engine DTE, and is capable of providing a development service of a digital twin model.
Wherein the terminal 202 is configured to provide a digital twinning development platform. The terminal 202 illustratively has a digital twin modeling client running therein, which may be an application running in the terminal or a web application accessed through a browser, as the application is not limited in this regard. The server 201, as a server for running the digital twin engine, can provide a code class library and core components for digital twin model development and system construction.
In an embodiment of the present application, terminal 202 can send a model creation instruction for the target object to instruct server 201 to create a digital twin model of the target object. The server 201 can obtain a digital twin modeling language DTML meta-model of the target object in response to a model creation instruction for the target object, the model creation instruction carrying a functional description of the target object; obtaining a digital twin model of the target object according to the function parameters of the multiplexing object indicated by the object information of the multiplexing object in the function description and the function parameters of the DTML meta-model; and/or generating a model application program interface API of the digital twin model according to the function description and method units in the plurality of function units included in the DTML meta-model. The target object may be a network device, such as a network card, a switch, a router, or the like, or may be a communication network formed by a plurality of network devices, such as a campus area network, a data center network, or the like. In the above technical solution, the server 201 may implement at least one of multiplexing the functions of the multiplexing object and generating the model API in the process of creating the digital twin model.
By the scheme, in the process of creating the digital twin model of the target object, at least one of multiplexing the functions of the multiplexing object and generating the model API can be realized. On the one hand, the digital twin model of the target object can be obtained based on the object information of the multiplexing object and the functional parameters of the DTML meta-model, so that the digital twin model of the target object multiplexes the functions of the multiplexing object; on the other hand, the synchronous creation of the model API can be completed through a newly added method unit in the basic model architecture of the DTML meta-model. Because in the process of creating the digital twin model, the function parameters can be updated directly based on the object information of the multiplexing object, the existing functions are not required to be multiplexed by copying a large amount of codes of the multiplexing object or by a pointer link jump mode; the creation logic of the model API is provided by the method unit in the DTML meta-model, and the model API with consistency with the model can be efficiently generated, so that the development efficiency of the digital twin model is greatly improved.
In some embodiments, the server 201 may be a server cluster or a distributed file system formed by a server or a plurality of physical servers, or a cloud server cluster that provides cloud storage and cloud services, cloud databases, cloud computing, cloud functions, network services, cloud communication, middleware services, domain name services, security services, content delivery network (content delivery network, CDN), basic cloud computing services such as big data and artificial intelligence platform, which is not limited in this application. Terminal 202 may be, but is not limited to, a smart phone, tablet, notebook, desktop, etc. computing device.
In some embodiments, the method for creating a digital twin model provided by the application can be implemented in the form of a calculation example. The computing instance may be executed in the server 201 as a virtual machine, a container, or a process, but is not limited thereto.
The server 201 and the terminal 202 may be communicatively connected via a wired network or a wireless network. In some embodiments, the wireless network or wired network uses standard communication techniques and/or protocols. The networks include, but are not limited to, any combination of data center networks (DATA CENTER networks), storage area networks (storage area network, SAN), local area networks (local area network, LAN), metropolitan area networks (metropolitan area network, MAN), wide area networks (wide area network, WAN), mobile, wired or wireless networks, private networks, or virtual private networks. In some implementations, the data exchanged over the network is represented using techniques and/or formats including hypertext markup language (hyper text markup language, HTML), extensible markup language (extensible markup language, XML), and the like. In addition, all or part of the links can be encrypted using conventional encryption techniques such as secure sockets layer (secure sockets layer, SSL), transport layer security (transport layer security, TLS), virtual private network (virtual private network, VPN), internet protocol security (internet protocol security, IPsec), etc. In other embodiments, custom and/or dedicated data communication techniques can also be used in place of or in addition to the data communication techniques described above.
Next, a method for creating a digital twin model according to the embodiment of the present application will be described in detail based on the application scenario and the implementation environment.
Fig. 3 is a flowchart of a method for creating a digital twin model according to an embodiment of the present application, which can be executed by the server 201, and referring to fig. 3, the method includes the following steps 301 to 303.
301. The server responds to a model creation instruction aiming at the target object to acquire a DTML meta-model of the target object, wherein the model creation instruction carries a functional description of the target object.
Wherein the target object is a physical entity and has certain functional characteristics. In some embodiments, the target object may be an electronic device, for example, a network device such as a network card, a switch, a router, or the like, or may be a system formed by a plurality of electronic devices, for example, a communication network such as a campus area network or a data center network formed by a plurality of network devices. It should be noted that this example of the network device is directed to the communication field, and the target object may be other physical entities in other fields, for example, in the power field, the target object may be a measurement device, a power transmission device, or the like in the power supply network, and the present application is not limited thereto.
The DTML meta-model is equivalent to a standard template used when the digital twin model is created, and the server can update the DTML meta-model based on the acquired function description and related parameters so as to realize the function laying of the digital twin model and the creation of model instances. The DTML metamodel and the description of its multiple functional units are referred to above and will not be described in detail herein.
In some embodiments, the server provides a digital twin model development service, and the developer can describe the functional characteristics of the target object using DTML in the terminal, which instructs the server to perform model creation by sending a model creation instruction.
In the embodiment of the application, the model obtained by updating at least one functional unit in the DTML meta-model based on the functional description is the object model corresponding to the target object. It is understood that the DTML metamodel is equivalent to a class (data type) used to describe physical entities. A class is a definition of an object that describes the functionality that an object possesses and the manner in which the functionality is implemented, i.e., instantiation of the class is an object. Correspondingly, the object model obtained by updating the functional parameters of the DTML meta-model with the information in the functional description is a model instance obtained by instantiating the DTML meta-model for the functional characteristics of the target object, that is, a digital twin model which can be used for simulating the functional characteristics of the target object.
In some embodiments, the functional description is represented in the form of a DTML statement that defines functional parameters of functional units of the DTML metamodel. A developer submits a functional description (for example, a code formed by a section of DTML statement) aiming at a target object through a client, and triggers a terminal to send a model creation instruction to a server; the server responds to the model creation instruction, acquires the function description submitted in the client to update the DTML meta-model to obtain an object model represented by the DTML statement, and further analyzes, compiles and executes the object model represented by the DTML statement by the digital twin engine to run
302. And the server obtains a digital twin model of the target object according to the function parameters of the multiplexing object indicated by the object information of the multiplexing object in the function description and the function parameters of the DTML meta-model.
Wherein the description of the multiplexed object refers to the description of the target object. The target object and the multiplexing object have a functional association relation, for example, a traffic model in a park network is created for the target object, traffic information needs to be acquired from a corresponding communication interface when traffic monitoring is performed, and a published model corresponding to the multiplexing object is referred to as an interface model.
In some embodiments, the multiplexing object corresponding to a published digital twin model (simply published model) means that the digital twin model of the multiplexing object has been created. The method provided by the application can multiplex the functions of the released model of the multiplexing object in the process of creating the digital twin model of the target object so as to improve the efficiency of creating the digital twin model corresponding to the target object.
The function description carries object information, and the object information is used for indicating the function parameters of the multiplexing object. In some embodiments, the object information is carried in a multiplexing field for the method unit within the function description, and the server can determine that the object information is a function parameter for the multiplexing function in the method unit by parsing the function description.
In an embodiment of the present application, the DTML metamodel includes a plurality of functional units. The plurality of functional units comprise basic functional units of commands, events, attributes, components, relationships and data formats, and the method units are newly added in the technical scheme provided by the application.
In the embodiment of the application, the model obtained by updating the parameters of the functional units in the DTML meta-model based on the functional description is the object model corresponding to the target object. It is understood that the DTML metamodel is equivalent to a class (data type) used to describe physical entities. A class is a definition of an object that describes the functionality that an object has and the manner in which the functionality is implemented, i.e., an instantiation of the class is an object. Accordingly, the object model obtained by updating the functional parameters of the DTML meta-model with the information in the functional description, that is, instantiating the DTML meta-model, to obtain the digital twin model for simulating the target object.
In some embodiments, the functional description includes functional units of the DTML metamodel involved in modeling the target object and functional parameters of the functional units involved. Illustratively, the functional description is represented in the form of a DTML statement. The DTML statement is used to define the functional parameters of the functional units of the DTML metamodel.
In some embodiments, the target object is a network device, and a traffic monitoring model for collecting traffic with message timing information may be created for the functional characteristics of the target object, and one possible example of the functional description is described below by taking a component functional unit as an example. The functional description of the target object may indicate component (components) functional units and their functional parameters, which may then indicate the message timing information collected by the target object when performing traffic monitoring. The parts of the functional description for the component functional units are exemplified as follows:
In the above example, the basic logic of the component functional unit is provided by the DTML meta-model, and the server can update the functional parameters of the component functional unit based on the obtained functional description. The process of updating other functional units based on the functional description is the same as that of the component functional units, and will not be described herein.
In an embodiment of the application, the functional units involved in the model to be created are specified by a functional description, which is related to the functional characteristics of the target object. In some embodiments, creating a digital twin model of a target object requires at least simulating the behavior of the target object, and thus the target functional unit includes at least two functional units, an event and a command, for defining the behavior; in other embodiments, creating the digital twin model of the target object also requires simulating the way the target object interacts with other objects, and thus the target functional unit further comprises a relationship unit capable of indicating a relationship between the digital twin model of the target object (object model) and the digital twin model of the other objects, e.g. an associative relationship, an inheritance relationship, etc.
In some embodiments, in the process of creating the digital twin model, the server can update the content of the corresponding variable in the DTML meta-model according to the object information carried by the model creation instruction, so that the obtained digital twin model has the function realized by the function parameters of the multiplexing object indicated by the object information.
In the embodiments of the present application, the functions of the published model may be multiplexed in a plurality of ways, and in the following, a multiplexing manner one and a multiplexing manner two are described in some embodiments.
Multiplexing mode one, the function parameter of the released model is updated to the new digital twin model.
In some embodiments, the reuse object corresponds to a published model. Taking as an example a case where a developer involves a function of a published model when creating a new digital twin model, the developer can realize the function of multiplexing the published model to generate the new digital twin model by indicating the multiplexed published model in a functional description of creating the new digital twin model. In some embodiments, the server can update the function parameters of the multiplexing object indicated by the object information into the function parameters of the DTML meta-model according to the object information of the multiplexing object carried by the function description, so as to obtain the digital twin model of the target object.
In some embodiments, multiplexing one includes multiplexing both the entire published model and multiplexing a portion of the published model functionality.
The whole model is multiplexed in case one.
In some embodiments, the object information includes an identification of the published model that is multiplexed. In the case of multiplexing the entire model, the process of updating the functional parameters of the DTML meta-model based on the functional parameters indicated by the object information includes: updating the content of a first variable in the DTML meta-model according to a first model identifier included in the object information; wherein the first model identification indicates a multiplexed first digital twin model, the first variable being used to cause the digital twin model to implement a function of the first digital twin model based on a functional parameter of the first digital twin model.
In some embodiments, the first variable in the method element corresponds to a key (field) in the "class" that indicates multiplexing logic, e.g., the key is "multiple". Accordingly, the content of the first variable indicates the object for which the multiplexing logic is directed. Multiplexing the functionality of the first digital twin model may be indicated by adding the multiplexed first model identification to the first variable.
In some embodiments, the created digital twin model of the target object has independent functional units of properties, components, behaviors (commands/events), methods, relationships, etc. and their functional parameters. The first variable may be comprised in any of the functional units described above, e.g. a relational unit. This example corresponds to extending keywords that implement multiplexing functions within the relational element. A schematic example (method unit equivalent) is provided below, in which a first variable (exemplified by "multiplex") is contained in a relational unit.
Through the technical scheme, the model can be directly used as granularity for multiplexing, and in the process of creating a new model, the integral multiplexing of the functions of the released model is realized, so that multiplexing logic which is concise, standard and convenient to use is provided, and the efficiency of creating the digital twin model corresponding to the target object is effectively improved.
And in the second case, multiplexing part of functions of the released model.
In some embodiments, the object information includes reference information for a first functional parameter in the multiplexed published model. In the case of multiplexing a part of functions of the published model, the process of updating the function parameters of the DTML metamodel based on the object information includes: updating the content of a second variable in the DTML meta-model according to the reference information of the first functional parameter, the reference information indicating the first functional parameter referenced in the second digital twin model, the second variable being used to enable the digital twin model to implement the function of the first functional parameter in the second digital twin model.
In some embodiments, the reference information includes the name of the referenced functional parameter and the functional unit in which it is located, e.g., component units (components).
In some embodiments, the second variable corresponds to a key (field) in the class that indicates multiplexing logic, e.g., the key is "attach". Accordingly, the content of the second variable indicates the object for which the multiplexing logic is directed. Multiplexing the first functional parameter may be indicated by adding the reference information of the first functional parameter multiplexed in the second digital twin model to the second variable.
In some embodiments, the multiplexing of the first functional parameter may have a variety of logic. Illustratively, the second variable corresponds to a different key for implementing a different logic. For example, the multiplexing key "multiplex" indicates that the first functional parameter in the published model is directly referenced; the replacement key "override" indicates that a certain functional parameter in the model to be created is replaced with a first functional parameter of the same name in the published model. Wherein, the same name parameter refers to the same name (or identification) of the functional parameter. In some embodiments, the digital twin model is composed of a plurality of sub-models, each having a unique identification in its model network, the first functional parameter may be a functional parameter of the sub-model, and correspondingly, the reference information of the first functional parameter may be an identification of the sub-model. For example, the published model is a network layering model 1 (dtml: network: layer; 1), the sub-model includes a network layering 1 (sublayer 1), a network layering 2 (sublayer 2), and the sub-model identification of the network layering 1 may be "sublayer1".
A schematic example of including a second variable (exemplified by the keyword "override") in a method unit is provided below.
After this step 302 is completed, the different keywords corresponding to the second variable can instruct the server to complete the multiplexing of the first functional parameter by adopting the corresponding operation. In some embodiments, if the second variable corresponds to a multiplexing keyword, the server obtains the first functional parameter as a functional parameter of the digital twin model; in other embodiments, the functional parameter indicated by the replacement key in the digital twin model is replaced with the first functional parameter if the second variable corresponds to the replacement key.
The two modes can respectively refer to the existing function parameters for the model to be created and update the function parameters with the same name in the model to be created. Based on the method, convenient function upgrading and logic expansion can be provided for different service scenes, and the development efficiency of the model is effectively improved.
In other embodiments, the created digital twin model of the target object has independent functional units of properties, components, behaviors (commands/events), methods, relationships, and the like, and their functional parameters. The second variable may be contained in any functional unit.
In some embodiments, the model identifier of the second digital twin model may also be carried in a functional unit such as an attribute, a component, a behavior (command/event), etc. to indicate multiplexing of the second digital twin model; and further carrying a second variable (the variable content is the name of the first functional parameter) in the method unit or the relation unit to indicate the detailed multiplexing logic for the second digital twin model.
A principle example of a model identification carrying a second digital twin model in an attribute unit is provided below. The first functional parameter is a functional parameter of the multiplexed network layered model, and the attribute unit of the digital twin model of the target object contains a model identifier (dtml: network: layer; 1) of the multiplexed network layered model.
Through the technical scheme, the function parameters in the model can be directly used as granularity for multiplexing, in the process of creating a new model, the accurate multiplexing of partial functions in the released model is realized, the related code quantity of the model is reduced, and a simple, standard and convenient-to-use multiplexing logic is provided, so that the efficiency of creating the digital twin model corresponding to the target object is effectively improved.
In other embodiments, the multiplexed object is a second functional parameter in the digital twin model to be created, and the object information includes reference information for the second functional parameter. In some embodiments, the second functional parameter is a functional parameter of any functional unit in the model to be created, i.e. the functional parameter defined by the model itself to be created may be multiplexed in the process of creating the digital twin model. In such an example, the server may update the contents of a fourth variable in the DTML meta-model based on the reference information of the second functional parameter, the fourth variable being used to cause the digital twin model to reference the second functional parameter in the digital twin model.
In some embodiments, the reference information includes the name of the target function parameter being referenced and the functional unit in which it is located, e.g., component units (components). In some embodiments, the fourth variable may be a key such as "self" or "this" that is used to reference the functional parameters defined by the model itself. This process corresponds to multiplexing part of the functionality of the model itself to be created.
Based on the method, the multiplexed object can be the functional parameter of the model to be created, multiplexing logic is richer, more development requirements are covered, and development efficiency of the model is further improved.
And the multiplexing mode II expands the functions of the released model.
In some embodiments, the reuse object corresponds to a published model. Taking the case of a developer upgrading or expanding the published model as an example, the developer can describe the functional characteristics that need to be added, modified or deleted by writing a DTML statement.
In some embodiments, the server updates the functional parameters of the DTML metamodel to the functional parameters of the multiplexed object according to the functional description to obtain a digital twin model of the target object. Based on this, the digital twin model of the target object is an extension to the published model. The object information may comprise a model identification of the multiplexed published digital twin model, the server being capable of updating the functional parameters of the DTML meta-model into the functional parameters of a third digital twin model in dependence on a third model identification comprised by the object information, the third model identification being indicative of the multiplexed third digital twin model, the digital twin model operating as a sub-model of the third digital twin model.
In some embodiments, the third variable in the DTML metamodel corresponds to a key (field) in the "class" that refers to multiplexing logic, e.g., the key is "attach". Accordingly, the content of the third variable indicates the object for which the multiplexing logic is directed. The digital twin model to be created can be indicated to operate as a sub-model of the third digital twin model by adding the multiplexed third model identification to the third variable, based on which the server updates the functional parameters of the DTML meta-model to the functional parameters of the third digital twin model according to the indication of the third variable, so as to realize the functional expansion of the third digital twin model.
In some embodiments, the created digital twin model of the target object has independent functional units of properties, components, behaviors (commands/events), methods, relationships, etc. and their functional parameters. The third variable may be included in any of the above functional units, and corresponds to an expansion key for implementing a function of expanding a function of the published model. A principle example (method unit same) is provided below in which a third variable (exemplified by the keyword "attach") is contained in a relationship unit.
Wherein "belonging device interface" means that the third model identification indicates a published device interface model, i.e. the digital twin model to be created is an extended model of the published device interface model, e.g. the digital twin model to be created is a traffic model as a device interface model, which is attached or associated to a device interface model in the campus network for simulating traffic simulation. The functional association relation exists between the target object and the multiplexing object described above.
By the technical scheme, a simple and convenient model upgrading and expanding logic is provided for different service scenes, the published model can be efficiently upgraded or expanded, and the development efficiency of the model is effectively improved.
In order to facilitate understanding, the application provides a schematic diagram of model multiplexing, referring to fig. 4, in a new model 1 to be created, a first multiplexing mode is adopted, and a model identifier of a released model a is carried in a keyword 1 of an arbitrary functional unit for indicating multiplexing logic to multiplex the released model a; in the new model 2 to be created, the model identifier of the released model B is carried in the keyword 2 of any functional unit for indicating multiplexing logic by adopting the multiplexing mode II, and the released model B is multiplexed; the multiplexing mode one and the multiplexing mode two are different in that the multiplexing mode one is equivalent to the use of introducing the function parameters in the released model a into one new model 1, and the multiplexing mode two is equivalent to the function expansion of the released model B by creating one new model 2.
The two multiplexing modes can respectively realize that the existing functional parameters are directly multiplexed into the model to be created and the model to be created is used as a function to be expanded into the released model corresponding to the multiplexing object, so that the two-way multiplexing of the model to be created and the released model is realized, and the development efficiency of the model is effectively improved.
In some embodiments, the method unit may include at least one of the first variable, the second variable, the third variable, and the fourth variable to implement the corresponding functions, that is, the logic for multiplexing the functions of the multiplexing object in step 302 may be included in the newly created method unit, but the application is not limited thereto.
303. The server generates a model application program interface API of the digital twin model according to a method unit and the function description in a plurality of function units included in the DTML meta-model.
This step 303 may be performed after step 301 is completed. The server is capable of determining input parameters and output parameters of a model API of the digital twin model from the functional parameters of the plurality of functional units according to the API function information carried by the function description and the API configuration format described by the method unit to generate at least one model API, wherein the API function information indicates the functional parameters related to the model API.
In the embodiment of the application, the method unit is used for generating a model application program interface API corresponding to the digital twin model. The function description carries API function information. In some embodiments, the API function information is carried in an API generation field for the method unit in the function description, and the server may determine that the API function information is a function parameter for the API generation function in the method unit by parsing the function description.
FIG. 5 is a schematic diagram of a model API generating principle provided by the present application, referring to FIG. 5, in some embodiments, after step 303 is performed, the server parses, compiles, and performs operations such as executing the digital twin engine on the object model (refer to the description in step 301) represented by DTML, so as to generate at least one model API when running the digital twin model of the target object.
In some embodiments, the API configuration format includes a request format and a response format. The request format indicates the content of the API request, which includes: request type, model identification, and response mode. The response format indicates the content of the API response, which includes: response status, model identification, and response content.
Illustratively, the content of the API request may include a number of request parameters provided below:
Request parameter 1), action (action), which indicates the request type, for example, the action may include create (create), query (query), delete (delete), modify (update), and the like.
Request parameter 2), a model identification, which may be a model instance identification, which indicates an instantiation model of the digital twin model when it is actually running, e.g., may be represented by the string "deviceModel 001". In some embodiments, the model identifier is not carried in the model creation instruction, and when the model creation is completed, the model identifier is carried in a response to the model creation instruction to the creator, and the model identifier is carried in other requests after the model creation is completed. In some embodiments, the model identification may also be carried in the following request, to which the present application is not limited.
Request parameter 3), request content (content), the input parameter indicating the manner in which the API request is responded to. For example, the parameter ranges referred to by the model API. The requested content illustratively contains a model identification of the requested digital twin model and the input parameters and output parameter ranges involved.
In some embodiments, the input parameters involved as well as the output parameter ranges are indicated in the request content by a parameter range selection field. The input parameters and output parameters refer to functional parameters in the model functional unit (attribute/component/relationship/behavior), for example. For example, the parameter range selection field includes "input" and "output", the "input" indicating a selection range of an input parameter, and the "output" indicating a selection range of an output parameter. The different meanings corresponding to the different values of the fields may include: the value is "-" which indicates that the functional parameters of the functional unit are not limited, and the user can freely select the functional unit and the functional parameters thereof provided by the model; the value is ". Times". Shows that all the function parameters in the function unit are selected; the value "#" indicates that the functional parameter in the functional unit is not included, and is equivalent to the value being null.
In some embodiments, a combination of a reference field, e.g., the reference field being "items", and a model identification, which may be indicated with "@ id", is used in the method element to indicate multiplexing of the functional parameters of the published model, but the application is not limited thereto.
In some embodiments, the API request may also include user-defined parameters, which may be carried in content, and may also be carried in an added keyword (e.g., user-specific parameter "). The role of the custom parameter may be specified by the user, e.g., an entry count limit function indicated by "count", indicating the instance entries that are most contained when the API response is returned; the slicing function, indicated by "frag", indicates that slicing of data is allowed upon return of an API response.
Illustratively, the content of the API response may include a number of request parameters provided below:
Response parameter 1), response status, for indicating the status of the current API request. For example, the response status code may be a status code, where a status code of 200 indicates that the response of the API request is successful; the status code is not 200, which indicates that the response of the API request fails or otherwise.
Response parameter 2), model identification, reference to the model identification in request parameter 2), and will not be described in detail herein. In some embodiments, the model identification may also be carried in the following response content, to which the present application is not limited.
Response parameters 3), response content (content), including the requested model instance data, corresponds to the input parameters defined in the request content parameters of the API request.
The following provides a schematic example of a format indicating the input parameters and output parameters of a model API in a method unit, wherein the digital twin model is a time-series flow model 1 (dtml: flow: time_based_stream; 1), and the default (default) model API format in the method unit is as follows:
In some embodiments, the input parameter indicates the type of model instance data to be acquired, the output parameter is the model instance data corresponding to the type, for example, the model API is a model access API for the flow data in the time sequence flow model, the action in the API request is a query (indicating query flow data), the model identifier indicates the model instance to which the request indicates, and the type of the model instance data to be acquired indicated by the input parameter in the request content includes a quintuple and a timestamp. Correspondingly, in the response content of the API response, the output parameters are collected quintuple and timestamp instance data.
By the technical scheme, the flexibly configurable API format is integrated in the creation flow of the digital twin model, and the standard configuration standard is provided for the request content and the response content of the model API, so that the generation of the model API can be automatically realized in the model creation process, the writing workload of the model API is reduced, and the model development efficiency is improved.
In an embodiment of the present application, the API function information indicates different combinations of function parameters for implementing different types of API functions. The detailed process of generating the multiple types of model APIs in step 303 is described below in connection with the multiple specific model instance data management scenarios included in application scenario 2 above.
Application scenario 2-1, access model instance data.
In some embodiments, a user may access instance data corresponding to the digital twin model to analyze the data. Fig. 6 is a schematic diagram of a model instance data management scenario provided in the present application, referring to fig. 6, in a modeling design phase, a user performs digital modeling through DTML, and in a data storage/access phase, a client may access, through a model access API for a database, instantiation data generated based on online data during operation of a model stored in the database.
In some embodiments, in the case where the API function information indicates that the model API is of an access type, the server maps the function parameters of the attribute units in the DTML meta-model to the output parameters of the model access API, and maps the function parameters of the object model provided by the DTML meta-model to the input parameters of the model access API, the object model including at least one of a command unit, an attribute unit, and a component unit, according to an API configuration format.
In some embodiments, the attribute unit of the digital twin model is used to define the features of the model, the functional parameters in the attribute unit generally describe various features involved in implementing the functions of the model, and the content corresponding to the various functional parameters in the running process of the model is the example data that can be provided for the user to analyze, for example, the model is a time sequence flow model, and the functions in the attribute unit include flow analysis results such as message arrival time intervals, message time interval distribution, message period and the like. A principle example of the individual functional parameters in the attribute unit is provided below:
through the technical scheme, the model access API with high consistency with the model self architecture can be generated aiming at the example data generated by the model operation in the model creation process, the consistency problem is reduced while the writing workload of the model API is reduced, the user experience is improved, and the development efficiency of the model is comprehensively improved.
Application scenario 2-2, management model asset.
In some embodiments, the user may manage the digital twinning model, for example, model integration of multiple sub-models, or model presentation. Fig. 7 is a schematic diagram of another model instance data management scenario provided in the present application, referring to fig. 7, in a modeling design stage, a user performs digital modeling through DTML, in a data asset management stage, a network element model is a sub-model, and the user calls the network element model to perform multi-model integration through a model management API for the network element model to obtain a network model, and further calls the network model to perform multi-model integration through a model management API for the network model to obtain a more complex service model. Based on this, hierarchical model asset management is achieved. Accordingly, the model management API may also provide sub-model decomposition functionality.
In some embodiments, in the case where the API function information indicates that the model API is of a management type, the server maps the function parameters of the attribute unit and the function parameters of the command unit in the DTML meta-model to output parameters of the model management API, and maps the parameters of the component unit and the parameters of the command unit in the DTML meta-model to input parameters of the model management API according to the AP configuration format. Wherein the model API of the management type relates to events, commands or notifications etc. triggered by the outside of the model, controlling the behavior decisions of the model, whereby its input and output parameters relate to the functional parameters of the command unit.
Through the technical scheme, the model management API with high consistency with the architecture of the model itself can be generated aiming at the model management requirements possibly related in the subsequent application process in the model creation process, the consistency problem is reduced while the writing workload of the model API is reduced, the user experience is improved, and a layered management interface is provided for model asset management, so that the development efficiency of the model can be comprehensively improved.
In some embodiments, the method element provides functionality for generating multiple APIs. The server can concurrently generate a plurality of model APIs which belong to different types and can realize different functions according to the function description and the API configuration format provided by the method unit. Illustratively, referring to the following principle examples, the function description includes API function information indicating data_api_1 of the access type, data_api_2 of the access type, mgmt_api_1 of the management type, and mgmt_api_2 of the management type; the method unit (method) contains the configuration information of the 4 APIs through the parsing of the digital twin engine.
Referring to the above principle example, the data_api_1 is multiplexed with the timing traffic model 1, the input parameters of the data_api_1 include all parameters of the component units (components) ("indicated by a" "), and the output parameters of the data_api_1 include all parameters of the attribute units (properties) (" indicated by a ""). As a model access API generated by the corresponding embodiment of the application scenario 2-1, the input parameters of the data_api_2 include a functional parameter "five-tuple and a timestamp" in the component unit, and the output parameters of the data_api_2 include a part energy parameter "packet arrival time interval size" in the attribute unit. The model management API generated by the corresponding embodiment of the application scenario 2-2 is similar and will not be described here.
In various examples of step 303, the functional parameters in the respective functional units are referenced as input parameters or output parameters of the model API in a manner that the reference key "item" and the model identification "@ id" are combined. In other embodiments, a key such as "self" or "this" that can reference its own parameters may also be used to reference the functional parameters in each functional unit as input parameters or output parameters of the model API. A schematic example is provided below:
In some embodiments, the contents of the reference key "self" include: the name of the referenced function parameter and the function sheet in which it is located. For example, component units (components), time stamps (timestamps). Taking the above "data_api_2" as an example, another expression of the request content is:
"content", (content) ", (
"Input parameters (input)": {
"Source IP Address": "self. Components". Source IP Address (srcIP) ",
"Destination IP address": "self. Components". Destination IP address (dstIP) ",
"Transport protocol": "self. Components". Transport protocol (transProto) ",
"Timestamp": "self. Components:. Timestamp:" timestamp:
},
"output parameter (output)": {
"Source IP Address": "self. Property (properties). Message arrival time Interval size (packet_ arrivetime _interval)",
}
}
Based on the method, simple and easy self-parameter reference logic is provided for generating the model API, and the development efficiency of the model is further improved.
In some embodiments, the output parameters and input parameters of the model API may also be referenced from the published model. Referring to the principle of multiplexing published model function parameters in step 302, the function parameters in the published model can be referenced by indicating the reference information to reference the function parameters in the relevant configuration of the model API. In some embodiments, a reference to "model identification" + "parameter name" may be used to reference a portion of the functional parameters in the published model as input parameters or output parameters of the API. For example, the reference format may be: the model is abbreviated as function unit. Illustratively, taking the example that the model to be created is a flow analysis model for a target network model, the model API to be created is an API for acquiring a data source, the target network model is the data source for which flow analysis is performed, and thus may be indicated by a model identification of the target network model when defining input parameters. Reference is made to the following schematic examples, wherein datacenter is a model abbreviation for the target network model.
"Content (content)": {
"Input parameters (input)": {
"Parameter name (displayName)", "model abbreviation datacenter1. Component components parameter name displayName",
"Source IP Address": "self. Components". Source IP Address (srcIP) ",
"Destination IP address": "self. Components". Destination IP address (dstIP) ",
"Transport protocol": "self. Components". Transport protocol (transProto) ",
"Timestamp": "self. Components:. Timestamp:" timestamp:
},
"output parameter (output)": {
"Source IP Address": "self. Property (properties). Message arrival time Interval size (packet_ arrivetime _interval)",
}
}
In some embodiments, a model abbreviation may be defined in a global variable, with reference to the following example, in which the content of include is used to define the global variable. datacenter 1 is a model abbreviation for the target network model.
"@include":[
{“@id”:"dtml:network:interface;1"},
{ "@ Id": "dtml: datacenter;1"," abbreviation (name) "," datacenter1",
]
Through the technical scheme, the method for acquiring the parameters of the released model as the related parameters of the model API can efficiently take the released model as a data source or an output target to generate the corresponding model API, so that a simple and easy-to-use interface with high consistency is provided for development requirements of model asset management such as multi-model integration, sub-model decomposition and the like, and the development efficiency of the model is improved.
In order to facilitate understanding, the present application provides a schematic diagram of another model API generating principle, referring to fig. 8, where the digital twin engine obtains corresponding functional parameters from a component unit, an attribute unit, and a command unit included in an object model represented by DTML, and generates a model access API "api_0", a model access API "api_1", and a model management API "api_2", where input parameters of "api_0" are functional parameters of the component unit, output parameters are functional parameters of the attribute unit, and api_1 is the same as api_0; the input parameters of the API_1 are the functional parameters of the component unit and the command unit, and the output parameters are the functional parameters of the attribute unit and the command unit.
In some embodiments, after generating at least one model API through step 303, in response to receiving an API request for the digital twin model, the server obtains, from the functional parameters of at least one functional unit corresponding to the output parameters of the model API, the content of the API response according to the input parameters of the model API carried by the API request, to return the API response. With reference to the model API format defined by the method unit described above, since the correspondence between the input parameters and the output parameters has been established in the API generating process, the model API generated by using the above method can automatically obtain, from each functional unit of the digital twin model of the target object, the corresponding data as the output parameters in the response content of the API response according to the input parameters carried by the API request.
Based on the method, standard and accurate model instance data can be provided according to the request of the user, a reliable interface is provided for the user to perform data analysis or model asset management, and the efficiency of the user to perform model development is improved.
In the above embodiment, the method unit may be a functional unit other than a command unit, an event unit, an attribute unit, a component unit, a relationship unit, and a data unit in the DTML meta-model; the method unit may also be extended within any existing functional unit. Illustratively, the method element may be any one of a command element, an event element, an attribute element, a component element, a relationship element, and a data element of the DTML meta-model; or the method element may be a sub-class of any of a command element, an event element, an attribute element, a component element, a relationship element, and a data element. Wherein, the subclass can inherit the attribute, relation, behavior and other characteristics of the parent class. Based on the method, rich function unit realization granularity is provided, so that functions of the newly expanded method units can be realized according to expansion requirements in different application scenes, and the method can be flexibly applied to various model development architectures. For example, the functionality of a method element may be extended within its existing functional element without wanting to destroy the functional element partitioning logic of the existing DTML meta-model; in case it is desired to ensure the independence of the functions of the method units, an independent method unit may be added.
In other embodiments, the functionality of the method elements may be integrated in other possible software/hardware functional modules for different protocols, programming languages, software or hardware used for the definition of model functions, as the application is not limited in this respect.
In some embodiments, the method elements in the DTML metamodel are used to multiplex functional parameters for other functional elements in the DTML metamodel, including at least one of command elements, event elements, attribute elements, component elements, relationship elements, and data elements. Based on this feature, the server may complete multiplexing of its own parameters by defining the reference information of the multiplexed functional parameters (including its own functional unit and parameter name) in the method unit when executing step 302. The server may complete multiplexing of its own parameters by defining the input parameters and output parameters (by defining the function unit and parameter name where the function parameters reside) referred to by the model API in the method unit when executing step 303.
In some embodiments, multiplexing the functional parameters of other functional units by the above-described method unit includes a plurality of cases. In some embodiments, the server performs multiplexing of the functional parameters according to the reference information of the functional parameters defined in the method unit (including the functional unit and the parameter name where the server is located).
In some embodiments, the multiplexed function parameters may be architecture class parameters, for example, referring to the attribute units shown above, the architecture parameters refer to parameters of implementation logic for constructing the function units such as "function description", "variable name", "data type DATASCHEMA"; the multiplexed functional parameters may also be data class parameters, for example, referring to the attribute units shown above, the data class parameters refer to parameters of the class "five tuple", "timestamp" for defining specific data.
Based on the method, a developer can multiplex the existing functional units in multiple dimensions through the newly added method units, so that the development efficiency of the model is effectively improved.
Based on the method, logic for multiplexing the function parameters of the model to be created can be contained in a newly created method unit, and a convenient parameter multiplexing mode is provided for the function development of the model, so that the development efficiency of processes such as generating a model API, creating the model and the like is improved.
It should be noted that, after the above step 301, only the step 302 may be executed to implement multiplexing of the functions of the multiplexing object in the model creation process; step 303 alone may also be performed to synchronously generate the model APIs during model creation; step 302 and step 303 may also be performed to multiplex the functionality of the multiplexed objects and generate the model API during the model creation process. That is, these two functions may be selectively implemented during the model creation process, which is not limited by the present application.
In the technical scheme, because multiplexing of the multiplexing object function parameters can be directly realized based on the object information of the multiplexing object in the process of creating the digital twin model, a large number of codes of the multiplexing object are not required to be copied or the existing functions are multiplexed in a pointer link jump mode; the creation logic of the model API is provided by the method unit in the DTML meta-model, and the model API with consistency with the model can be efficiently generated, so that the development efficiency of the digital twin model is greatly improved. And dynamic model multiplexing logic is provided for different service scenes, and multiple logics for multiplexing the models can be specified through multiple keywords, so that the released models are efficiently upgraded and expanded, or new digital twin models are generated by fusion, the repeated utilization rate of the disclosed models is improved, and the development efficiency of the models is effectively improved.
Further, in the process of creating the model, a model API with high consistency with the architecture of the model itself can be generated according to the instance data generated by the model operation and the model management requirements possibly related in the subsequent application process, so that the consistency problem is reduced while the writing workload of the model API is reduced, and the user experience is improved; and a concise and easy-to-use data access interface can be provided for the user to analyze the model data, and a hierarchical management interface is provided for the user to manage the model assets, so that the development efficiency of the model can be comprehensively improved.
In order to facilitate understanding of the technical solutions provided in the above steps 301 to 303, the present application provides a functional schematic diagram of a method unit, referring to fig. 9, where the method unit (method) is capable of providing multiple functions including a model association method, a model management method, a model instance data generation method, a model construction method, and an analysis decision method in the process of creating an executable digital twin model. Referring to fig. 9, the model association method refers to creating a multiplexing relationship between the digital twin model and the published model on the basis of the DTML meta-model by the implementation provided in step 302 above, so as to multiplex the published model; the model management method is that on the basis of the DTML meta-model, a model management API is generated by the implementation manner provided in step 303, so as to provide a function of model asset management for a user on the operation and maintenance side, and the digital twin model is stored as a model asset in a model asset management library; the model instance data generating method is to generate a model access API through the implementation provided in the step 303, so as to provide a function of accessing model instance data for a user on a service side, and the instance data generated by running the digital twin model is stored in a model resource instance database; the analysis decision method is to analyze and decide according to the running state of the model, trigger an event, command or notification aiming at the outside to control the corresponding equipment or system; the model construction method provides a function of importing relevant original data in the model creation process. The description of the DTML metamodel and other functional units included therein refers to the relevant content (such as the content corresponding to fig. 1) in the foregoing, and will not be described herein.
Fig. 10 is a schematic structural diagram of a device for creating a digital twin model according to an embodiment of the present application. Referring to fig. 10, the digital twin model creation apparatus includes: an acquisition module 1001 and a creation module 1002.
An obtaining module 1001, configured to obtain a digital twin modeling language DTML meta model of a target object in response to a model creation instruction for the target object, where the model creation instruction carries a functional description of the target object;
a creating module 1002, configured to obtain a digital twin model of the target object according to the function parameters of the multiplexing object indicated by the object information of the multiplexing object in the function description and the function parameters of the DTML meta model; and/or the number of the groups of groups,
A model application program interface API of the digital twin model is generated according to a method unit and a function description in a plurality of function units included in the DTML meta-model.
In one possible implementation, the creating module 1002 is configured to:
according to the object information of the multiplexing object carried by the function description, updating the function parameters of the multiplexing object indicated by the object information into the function parameters of the DTML meta-model to obtain a digital twin model of the target object; or alternatively, the first and second heat exchangers may be,
According to the function description, the function parameters of the DTML meta-model are updated into the function parameters of the multiplexing object, and the digital twin model of the target object is obtained.
In one possible implementation, the multiplexed object corresponds to a published digital twin model, the object information includes a model identification of the published digital twin model, and the creating module 1002 includes:
And the first multiplexing unit is used for updating the content of a first variable in the DTML meta-model according to a first model identifier included in the object information, wherein the first model identifier indicates a multiplexed first digital twin model, and the first variable is used for enabling the digital twin model to realize the function of the first digital twin model.
In one possible implementation, the multiplexing object corresponds to a published digital twin model, the object information includes reference information of a first functional parameter, and the creating module 1002 includes:
And the second multiplexing unit is used for updating the content of a second variable in the DTML meta-model according to the reference information of the first functional parameter, wherein the reference information indicates the first functional parameter which is referenced in the second digital twin model, and the second variable is used for enabling the digital twin model to realize the function of the first functional parameter in the second digital twin model.
In one possible implementation, the second multiplexing unit is further configured to:
If the second variable corresponds to the multiplexing keyword, acquiring the first functional parameter into the functional parameter of the digital twin model;
And if the second variable corresponds to the replacement keyword, replacing the functional parameter indicated by the replacement keyword in the digital twin model with the first functional parameter.
In one possible implementation, the multiplexed object corresponds to a published digital twin model, the object information includes a model identification of the published digital twin model, and the creating module 1002 includes:
And the third multiplexing unit is used for updating the functional parameters of the DTML meta-model into the functional parameters of the third digital twin model according to a third model identifier included in the object information, wherein the third model identifier indicates the multiplexed third digital twin model, and the digital twin model operates as a sub-model of the third digital twin model.
In one possible implementation, the multiplexing object is a second functional parameter in the digital twin model to be created, and the object information includes reference information of the second functional parameter; a creation module 1002 comprising:
and the fourth multiplexing unit is used for updating the content of a fourth variable in the DTML meta-model according to the reference information of the second functional parameter, and the fourth variable is used for enabling the digital twin model to reference the second functional parameter in the digital twin model.
In one possible implementation, the method unit in the DTML metamodel is configured to multiplex functional parameters of other functional units in the DTML metamodel, where the other functional units include at least one of a command unit, an event unit, an attribute unit, a component unit, a relationship unit, and a data unit.
In one possible implementation, the creating module 1002 is configured to:
According to the API function information carried by the function description, determining input parameters and output parameters of a model API of the digital twin model from the function parameters of a plurality of function units according to an API configuration format described by a method unit so as to generate at least one model API, wherein the API function information indicates the function parameters related to the model API.
In one possible implementation, the creating module 1002 includes:
The first generating unit is configured to map, according to an API configuration format, a function parameter of an attribute unit in the DTML meta-model to an output parameter of the model access API, and map a function parameter of an object model corresponding to the target object to an input parameter of the model access API when the API function information indicates that the model API is of an access type, where the object model includes at least one of a command unit, an attribute unit, and a component unit.
In one possible implementation, the creating module 1002 includes:
and the second generating unit is used for mapping the functional parameters of the attribute units and the functional parameters of the command units in the DTML meta-model into the output parameters of the model management API according to the API configuration format and mapping the parameters of the component units and the parameters of the command units in the DTML meta-model into the input parameters of the model management API under the condition that the API function information indicates that the model API is of a management type.
In one possible implementation, the API configuration format includes a request format and a response format; the request format indicates the content of the API request, which includes: request type, model identification and response mode;
the response format indicates the content of the API response, which includes: response status, model identification, and response content.
In one possible embodiment, the apparatus further comprises:
And the API response module is used for responding to the received API request aiming at the digital twin model, acquiring the content of the API response from the functional parameters of at least one functional unit corresponding to the output parameters of the model API according to the input parameters of the model API carried by the API request, and returning the API response.
In one possible embodiment, the method unit refers to:
any one of a command unit, an event unit, an attribute unit, a component unit, a relationship unit, and a data unit of the DTML meta-model; or, a subclass of any of a command unit, an event unit, an attribute unit, a component unit, a relationship unit, and a data unit; or, functional units in the DTML metamodel other than command units, event units, attribute units, component units, relationship units, and data units.
In the technical scheme, because multiplexing of the multiplexing object function parameters can be realized directly based on the object information of the multiplexing object in the process of creating the digital twin model, a large number of codes of the multiplexing object are not required to be copied or the existing functions are multiplexed in a pointer link jump mode; the creation logic of the model API is provided by the method unit in the DTML meta-model, and the model API with consistency with the model can be efficiently generated, so that the development efficiency of the digital twin model is greatly improved. And dynamic model multiplexing logic is provided for different service scenes, and multiple logics for multiplexing the models can be specified through multiple keywords, so that the released models are efficiently upgraded and expanded, or new digital twin models are generated by fusion, the repeated utilization rate of the disclosed models is improved, and the development efficiency of the models is effectively improved.
Further, in the process of creating the model, aiming at example data generated by model operation and model management requirements possibly related in the subsequent application process, a model API with high consistency with the architecture of the model is generated, so that the workload of writing the model API is reduced, the consistency problem is reduced, and the user experience is improved; and a concise and easy-to-use data access interface can be provided for the user to analyze the model data, and a hierarchical management interface is provided for the user to manage the model assets, so that the development efficiency of the model can be comprehensively improved.
Wherein, the obtaining module 1001 and the creating module 1002 may be implemented by software, or may be implemented by hardware.
Module as an example of a software functional unit, creation module 1002 may include code that runs on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container, among others. Further, the above-described computing examples may be one or more. For example, creation module 1002 may include code running on multiple hosts/virtual machines/containers. It should be noted that, multiple hosts/virtual machines/containers for running the code may be distributed in the same region (region), or may be distributed in different regions. Further, multiple hosts/virtual machines/containers for running the code may be distributed in the same availability zone (availability zone, AZ) or may be distributed in different AZs, each AZ comprising one data center or multiple geographically close data centers. Wherein typically a region may comprise a plurality of AZs.
Also, multiple hosts/virtual machines/containers for running the code may be distributed in the same virtual private cloud (virtual private cloud, VPC) or may be distributed in multiple VPCs. In general, one VPC is disposed in one region, and a communication gateway is disposed in each VPC for implementing inter-connection between VPCs in the same region and between VPCs in different regions.
Module as an example of a hardware functional unit, creation module 1002 may include at least one computing device, such as a server or the like. Or creation module 1002 may be a device implemented using an application-specific integrated circuit (ASIC), a programmable logic device (programmable logic device, PLD), or the like. The PLD may be implemented as a complex program logic device (complex programmable logical device, CPLD), a field-programmable gate array (FPGA) GATE ARRAY, a general-purpose array logic (GENERIC ARRAY logic, GAL), or any combination thereof.
Multiple computing devices included in creation module 1002 may be distributed in the same region or may be distributed in different regions. The multiple computing devices included in creation module 1002 may be distributed among the same AZ or may be distributed among different AZ. Likewise, multiple computing devices included in creation module 1002 may be distributed in the same VPC or may be distributed among multiple VPCs. Wherein the plurality of computing devices may be any combination of computing devices such as servers, ASIC, PLD, CPLD, FPGA, and GAL.
It should be noted that, when implementing the corresponding steps, the creation device of the digital twin model provided in the foregoing embodiment only uses the division of the foregoing functional modules to illustrate, in practical application, the foregoing functional allocation may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device for creating a digital twin model provided in the above embodiment and the method embodiment for creating a digital twin model belong to the same concept, and detailed implementation processes of the device are shown in the method embodiment, and are not described herein.
The following describes a hardware structure of a computing device according to an embodiment of the present application.
The embodiment of the application provides a computing device which can be configured as the server. Referring to fig. 11, fig. 11 is a schematic hardware structure of a computing device according to an embodiment of the present application. As shown in fig. 11, the computing device 1100 includes a memory 1101, a processor 1102, a communication interface 1103 and a bus 1104. The memory 1101, the processor 1102, and the communication interface 1103 are communicatively connected to each other through a bus 1104.
The memory 1101 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (random access memory, RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-only memory, EEPROM), a compact disc read-only memory (compact disc read-only memory) or other optical disk storage, a compact disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), a magnetic disk storage medium, or any other magnetic storage device that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The processor 1102 implements the method in the above or below embodiments by reading the program code stored in the memory 1101, or the processor 1102 implements the method of creating the digital twin model in the above or below embodiments by internally storing the program code. In the case where the processor 1102 implements the creation method of the digital twin model in the above or below embodiments by reading the program code stored in the memory 1101, the memory 1101 stores the program code for implementing the creation method of the digital twin model provided by the embodiment of the present application.
The processor 1102 may be a network processor (network processor, NP), a central processing unit (central processing unit, CPU), an application-specific integrated circuit (ASIC), or an integrated circuit for controlling the execution of programs in accordance with aspects of the present application. The processor 1102 may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The number of the processors 1102 may be one or a plurality. The communication interface 1103 enables communication between the computing device 1100 and other devices or communication networks using a transceiver module, such as a transceiver. For example, data may be acquired through the communication interface 1103.
The memory 1101 and the processor 1102 may be separately provided or may be integrated.
A bus 1104 may include a path to transfer information between various components of the computing device 1100 (e.g., the memory 1101, the processor 1102, the communication interface 1103).
It should be noted that, the information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, presented data, etc.), and signals related to the present application are all authorized by the user or are fully authorized by the parties, and the collection, use, and processing of the related data is required to comply with the relevant laws and regulations and standards of the relevant countries and regions. For example, the information such as the function description, the database and the released model related to the present application are obtained under the condition that the user is fully authorized.
The terms "first," "second," and the like in this disclosure are used for distinguishing between similar elements or items having substantially the same function and function, and it should be understood that there is no logical or chronological dependency between the terms "first," "second," and "n," and that there is no limitation on the amount and order of execution. It will be further understood that, although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another element. For example, the first digital twin model may be referred to as a second digital twin model, and similarly, the second digital twin model may be referred to as a first digital twin model, without departing from the scope of the various described examples. The first digital twin model and the second digital twin model may both be digital twin models and, in some cases, may be separate and distinct digital twin models.
The term "at least one" in the present application means one or more, the term "plurality" in the present application means two or more, for example, a plurality of functional units means two or more.
The foregoing description is merely illustrative of the present application, and the scope of the present application is not limited thereto, and any equivalent modifications or substitutions will be apparent to those skilled in the art within the scope of the present application, and are intended to be included within the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a program product. The program product includes one or more program instructions. When loaded and executed on a computing device, produces a flow or functionality in accordance with embodiments of the application, in whole or in part.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the above storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the application.