Disclosure of Invention
The invention provides a modeling method and a modeling device based on information system data, which can solve the problems of large workload caused by customized development for access equipment, long period and difficult support of complex application caused by general equipment type access in the prior art.
In order to achieve the above purpose, the present invention provides the following technical solutions:
a modeling method based on information system data, comprising:
based on the device information in the information system data, taking the attribute, the component and the behavior as dimensions, establishing a device model of each device accessed to the information system;
extracting repeatedly occurring attributes, components and behaviors in the equipment models as parent models, wherein each equipment model is a child model consisting of at least one parent model; the parent model generates child models through inheritance, assembly, expansion and instantiation, and each parent model and each child model have respective unique identifications.
Optionally, the modeling method further includes:
modeling the equipment of the information system to be accessed according to the equipment information of the equipment to be accessed, the father model and the child model, finally obtaining a child model which is obtained by taking one or more father models as the start, inheriting, assembling, expanding and instantiating, taking the child model as the equipment model of the equipment, and accessing the information system in a mode that the father model and the child model are accessed to the information system.
Optionally, the parent model generates the child model by inheritance, including:
the child model obtains all information of the parent model.
Optionally, the parent model generates the child model by assembling, including:
and assembling a plurality of parent models to obtain the child models.
Optionally, the parent model generates the child model through expansion, including:
and adding extension information on the basis of the parent model to obtain the child model.
A modeling apparatus based on information system data, comprising:
the establishing unit is used for establishing a device model of each device accessed to the information system by taking the attribute, the component and the behavior as dimensions based on the device information in the information system data;
an extraction unit, configured to extract, as a parent model, repeatedly occurring attributes, components, and behaviors in the device models, where each device model is a child model composed of at least one parent model; the parent model generates child models through inheritance, assembly, expansion and instantiation, and each parent model and each child model have respective unique identifications.
Optionally, the modeling apparatus further includes:
the access unit is used for modeling the equipment of the information system to be accessed according to the equipment information of the equipment of the information system to be accessed and the father model and the child model, finally obtaining a child model which is obtained by taking one or more father models as the start, inheriting, assembling, expanding and instantiating, taking the child model as the equipment model of the equipment, and accessing the information system in a mode that the father model and the child model are accessed to the information system.
Optionally, the extracting unit is configured to obtain all information of the parent model by using the child model.
Optionally, the extracting unit is configured to assemble a plurality of parent models to obtain the child model.
Optionally, the extracting unit is configured to add extension information on the basis of the parent model to obtain the child model.
According to the technical scheme, the invention discloses a modeling method and a modeling device based on information system data, which are used for establishing a model of each device accessed to an information system by taking attributes, components and behaviors as dimensions based on device information in the information system data; extracting repeatedly occurring attributes, components and behaviors in equipment models as parent models, wherein each equipment model is a child model consisting of at least one parent model; the parent model generates the child model by inheritance, assembly, extension, and instantiation. Therefore, the device is modeled by the device which is accessed to the information system, each device is split into the device model formed by the father model and the child model, when a new device is accessed to the information system, the device model can be modeled according to the device information, then the information system is accessed in the same mode of the father model and the child model, a device interface is not required to be redeveloped, and meanwhile, the complexity of the device model is enough to support complex application requirements.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As known from the background art, the existing device access method mainly includes two methods due to numerous device types and different functions: one method is to adapt to a certain equipment model, if other types of equipment need to be accessed, customized development is needed, so that the workload is large, the implementation period is long, the type of the accessed equipment is limited, and the cost is high; in another method, different types of equipment are abstracted into general equipment types for access, only common characteristics are extracted, and although the access efficiency is guaranteed, the equipment model is simpler, and complex application is difficult to support.
In view of the above, the invention provides a modeling method and device based on information system data, which can solve the problems of large workload caused by custom development for access equipment, long period and difficult support of complex application caused by general equipment type access in the prior art.
As shown in fig. 1, the embodiment of the invention discloses a modeling method based on information system data, which comprises the following steps:
s101, based on the device information in the information system data, establishing a device model of each device accessed to the information system by taking the attribute, the component and the behavior as dimensions.
It should be noted that, for information systems, a device or device composition typically contains attributes, components, and behaviors, where an attribute describes some aspect of a model, such as the model number of a motor model; the component is a part of the model, the component can have a structure, the rotor is a component, and the rotor comprises coils; behavior describes the dynamic capabilities of the model, such as start and stop of the motor.
S102, extracting repeatedly occurring attributes, components and behaviors in equipment models as parent models, wherein each equipment model is a child model consisting of at least one parent model; the parent model generates the child model by inheritance, assembly, extension, and instantiation.
It should be noted that in step S102, each of the parent model and the child model has a respective unique identifier. That is, each model corresponds to a same type of device or device composition, such as a model of a device or a model of a motor in a device.
Optionally, the parent model generates the child model by inheritance, including:
the child model obtains all information of the parent model.
It should be noted that information obtained from the parent model by the child model includes, but is not limited to, structures, components, attributes, and the like.
Optionally, the parent model generates the child model by assembling, including:
and assembling a plurality of parent models to obtain the child models.
The sub-model assembled from a plurality of parent models can form a layered model structure, for example, an automobile is composed of a body and a transmitter, and an engine is composed of a housing and a crankshaft.
Optionally, the parent model generates the child model through expansion, including:
and adding extension information on the basis of the parent model to obtain the child model.
After the child model inherits the parent model, in addition to the components, attributes, and methods inherited from the parent model, the child model may also extend its own components, attributes, methods, and so on to form another model based on the parent model, but different from the parent model.
Alternatively, instantiation refers to generating an instance that is structured, property-identical, and method-identical to a model from the model, where the instance has a unique identifier, and the instance may be further modified, such as modifying the value of the property, adding new components, methods, and so forth.
For ease of understanding, fig. 2 is a schematic diagram illustrating model construction and instantiation in the modeling method based on information system data disclosed in the present invention.
Wherein 201 is model a,202 is attribute a of model a,203 is behavior a of model a,204 is model B, inheritance from model a,205 is attribute a inheritance from model a by model B from model a,206 is component B inherited from model a by model B, 207 is component B developed by model B,208 is model C assembled by model B, 209 is attribute C of model C,210 is behavior C of model C,211 is instance B of model C, instantiated by model B, 212 is attribute a of instance B, derived from model a,213 is behavior a of instance B, derived from model a,214 is component B of instance B, derived from model B.
It should be noted that, through the above model construction strategy, two types of models can be derived from the models generated by the information system data: an access model and an information model.
The access model comprises a gateway model, a channel model, a device model, a measuring point model and the like, wherein the information system analyzes an access message when the device is accessed, and a gateway example is reconstructed on the system side, and the measuring point comprises information for acquiring data of the measuring point of the device.
The information model is constructed through the inheritance, assembly and expansion mechanisms, and finally a series of models with definite business meanings, such as factories, production lines, equipment and the like, are formed, wherein the equipment can be organized according to different dimensions, such as types, brands, working principles and the like, and the equipment contains variables which are placeholders of equipment data sources.
Specifically, for example, the rotation speed of a motor is a variable, and the variable can store various types of data, such as static data: a manufacturer of the machine; dynamic data, such as the time series value of the motor speed (1000 revolutions at 19:00 minutes; 19:05 minutes, 1200 revolutions) is called the placeholder for the source of the device data because the data can be read from the variables.
Based on the instantiation and expansion of the information model, a complex equipment ledger can be constructed.
By binding the equipment instance in the equipment ledger and the access equipment in the gateway, when the value of a certain variable is queried from the equipment ledger, the access equipment label can be found through the association relation, and finally the data is acquired.
Optionally, the modeling method further includes:
modeling the equipment of the information system to be accessed according to the equipment information of the equipment to be accessed, the father model and the child model, finally obtaining a child model which is obtained by taking one or more father models as the start, inheriting, assembling, expanding and instantiating, taking the child model as the equipment model of the equipment, and accessing the information system in a mode that the father model and the child model are accessed to the information system.
It should be noted that, in a specific embodiment, the access of a new device involves multiple models, as shown in fig. 3, which is a schematic diagram of device access and data binding in the modeling method based on information system data disclosed in the present invention.
The physical/logical gateway 301 is connected to the information system through a message queue telemetry transport (Message Queuing Telemetry Transport, MQTT) protocol, the information system 303, the physical/logical gateway 304 is instantiated as a result of the gateway G1, 305 being instantiated by a channel model in the information system, network connection information of the physical gateway is reflected, the mapping of the physical device D1 in the information system is reflected, the label 307 can be used for acquiring data of a device according to the label, an attribute of a certain dimension of the physical device is identified, such as a current running state, 308 a factory 1, is instantiated by a factory model to obtain, 309 a production line 1, is instantiated by a production line model to obtain, 310 a special device D1, is instantiated by a special device model 318, and is associated with 306 a general device to obtain data, 311 variables, describes a certain maintenance attribute of the special device, such as a current running state, corresponds to the label 301, that is, the data source of the variables is the label 312-319 model list, wherein 312 is a network management model, and 313 is a channel model. 314 is a generic device model, 315 is a label model, 316 is a factory model, 317 is a production line model, 318 is a dedicated device model, 319 is a variable model.
It should be noted that, the physical device accesses the system through the gateway, the gateway implements the MQTT access protocol, and rebuilds the system side in the form of a logical entity to organize devices and tags, and the rebuilding process is based on a general model, such as a gateway model, a channel model and a device model.
According to the modeling method based on the information system data, based on the equipment information in the information system data, the attribute, the component and the behavior are used as dimensions, and a model of each equipment accessed to the information system is built; extracting repeatedly occurring attributes, components and behaviors in equipment models as parent models, wherein each equipment model is a child model consisting of at least one parent model; the parent model generates the child model by inheritance, assembly, extension, and instantiation. Therefore, the device is modeled by the device which is accessed to the information system, each device is split into the device model formed by the father model and the child model, when a new device is accessed to the information system, the device model can be modeled according to the device information, then the information system is accessed in the same mode of the father model and the child model, a device interface is not required to be redeveloped, and meanwhile, the complexity of the device model is enough to support complex application requirements.
Based on the modeling method based on information system data disclosed in the embodiment of the present invention, fig. 4 specifically discloses a modeling apparatus based on information system data applying the modeling method based on information system data.
As shown in fig. 4, another embodiment of the present invention discloses a modeling apparatus based on information system data, the apparatus comprising:
a building unit 401 is configured to build a device model of each device accessing the information system, based on the device information in the information system data, with the attribute, the component, and the behavior as dimensions.
An extracting unit 402, configured to extract, as a parent model, repeatedly occurring attributes, components, and behaviors in the device models, where each device model is a child model composed of at least one parent model; the parent model generates child models through inheritance, assembly, expansion and instantiation, and each parent model and each child model have respective unique identifications.
Optionally, the modeling apparatus further includes:
the access unit is used for modeling the equipment of the information system to be accessed according to the equipment information of the equipment of the information system to be accessed and the father model and the child model, finally obtaining a child model which is obtained by taking one or more father models as the start, inheriting, assembling, expanding and instantiating, taking the child model as the equipment model of the equipment, and accessing the information system in a mode that the father model and the child model are accessed to the information system.
Optionally, the extracting unit 402 is configured to obtain all information of the parent model by using the child model.
Optionally, the extracting unit 402 is configured to assemble a plurality of parent models to obtain the child model.
Optionally, the extracting unit 402 is configured to add extension information on the basis of the parent model, to obtain the child model.
The specific working processes of the establishing unit 401 and the extracting unit 402 in the modeling apparatus for information system data disclosed in the above embodiments of the present invention may refer to the corresponding contents in the modeling method for information system data disclosed in the above embodiments of the present invention, and will not be described herein.
The modeling device based on the information system data disclosed by the embodiment establishes a model of each device accessed to the information system by taking the attribute, the component and the behavior as dimensions based on the device information in the information system data; extracting repeatedly occurring attributes, components and behaviors in equipment models as parent models, wherein each equipment model is a child model consisting of at least one parent model; the parent model generates the child model by inheritance, assembly, extension, and instantiation. Therefore, the device is modeled by the device which is accessed to the information system, each device is split into the device model formed by the father model and the child model, when a new device is accessed to the information system, the device model can be modeled according to the device information, then the information system is accessed in the same mode of the father model and the child model, a device interface is not required to be redeveloped, and meanwhile, the complexity of the device model is enough to support complex application requirements.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.