Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
At present, connection and control of automation devices is generally realized through configuration software. The configuration software is upper computer software. After the configuration software realizes the connection of the automation equipment, the operation data of the automation equipment is monitored and processed, OPC and OPC-UA, webService, restful services are provided for the outside through the interface, and the client develops corresponding upper-layer application through engineering files and interface description of the configuration software.
In the above manner of implementing connection and control of an automation device through configuration software, because of complex and diverse interface formats, services provided by an interface, and the like, data processing and instruction processing are mixed, when the automation device is controlled, interface access, data processing, instruction processing, and the like can consume a great deal of time, so that the real-time control of the automation device and the convenience of monitoring and analysis are difficult to ensure.
The present disclosure is directed to the above-mentioned problems, and provides a method for managing an automation device. According to the method for managing the automation equipment, firstly, the automation equipment to be managed is obtained, a metadata table of the automation equipment is created by combining a preset metadata table template, then a data model of the automation equipment is created by combining the metadata table of the automation equipment and a preset data model template, then an interface of the automation equipment is created by combining the data model of the automation equipment and a preset interface format definition text, then a service corresponding to the interface is generated by combining the interface of the automation equipment and a preset encoding template, the service is deployed on an automation equipment platform, then a client encoding corresponding to the service is generated by combining the service and the interface format definition text, and the client encoding is compiled and packaged to generate management software of the automation equipment so as to manage the automation equipment through the management software. Therefore, the management software of the automation equipment is generated by combining the preset metadata table template, the data model template, the interface format definition text and the encoding template, and the automation equipment is managed through the generated management software of the automation equipment, so that the real-time control of the automation equipment and the convenience of monitoring and analysis can be ensured.
The following describes a management method, a device, an electronic device and a storage medium of an automation device according to an embodiment of the present application with reference to the accompanying drawings.
Fig. 1 is a flow chart illustrating a method of managing an automation device in accordance with an exemplary embodiment.
The execution subject of the embodiment of the present disclosure may be a management apparatus of an automation device, and the management apparatus of the automation device may be a hardware device, or software installed in the hardware device, or the like.
As shown in fig. 1, the method of managing an automation device may include the following steps 101-105.
In step 101, an automation device to be managed is acquired, and a metadata table of the automation device is created in combination with a preset metadata table template.
The automation equipment may be, for example, equipment such as coal excavation equipment in mine construction.
In an exemplary embodiment, a metadata template may be preset, so that after the automation device to be managed is acquired, metadata of the automation device to be managed may be consolidated by combining with a preset metadata table template, and a metadata table of the automation device may be created.
In an exemplary embodiment, the metadata table template may include names and metadata descriptions of each metadata, and accordingly, the metadata table of the automation device may be created by combining a preset metadata table template in the following manner:
judging whether the automation equipment is configured with metadata or not according to each metadata in the metadata table template;
If metadata is configured in the automation equipment, the metadata is used as first metadata;
and generating a metadata table of the automation equipment according to each first metadata and the corresponding metadata description.
For example, a metadata table template shown in the following table 1 may be preset, for metadata corresponding to each metadata name in the metadata table template, it may be determined whether the automation device is configured with the metadata, if so, the metadata is used as first metadata, and according to the metadata and the corresponding metadata description, the metadata is recorded in a corresponding position in the metadata table template until all metadata configured by the automation device is recorded in the metadata table template, thereby generating a metadata table of the automation device.
Table 1 metadata Table template
In an exemplary embodiment, the metadata table created may be in the form shown in FIG. 2.
It should be noted that after the metadata table of the automation device is created, the content in the metadata table may be checked, and the incorrect content in the metadata table may be corrected, so as to obtain a more accurate metadata table.
In step 102, a data model of the automation device is created in combination with a metadata table of the automation device and a preset data model template.
In an exemplary embodiment, a data model template may be preset so that a data model of an automation device may be created in conjunction with a metadata table of the created automation device and the preset data model template.
It will be appreciated that the metadata of the automation device may include real-time status data of the automation device, event data of status changes reported by the automation device, and command data issued to the automation device for execution. The real-time state data are, for example, running state, function switch, gear state, etc., the event data are, for example, alarm, gear, change of switching value, etc., and the command data are, for example, command parameters, return values, etc.
Accordingly, in an exemplary embodiment, the data model template may be preset to include: a status data model template, an event data model template, and a command data model template.
Wherein, the state data model template comprises: each state variable model template, wherein the state variable model templates comprise: respective metadata associated with the state variables;
The event data model template comprises the following steps: each event model template, a threshold type model template of an event in the event model templates and a parameter model template of a threshold type;
The command data model template comprises: each command model template, and parameter model templates in the commands.
Referring to fig. 3, the state data model templates may include therein respective state variable model templates, wherein, as shown on the right side of fig. 3, each state variable model template may include therein a variable number, and the following respective metadata names associated with the state variables: variable english name, variable chinese name, variable storage type, variable storage address, variable register address, initial value, maximum value, minimum value, variable enabled state, etc.
The event data model templates can include various event model templates, threshold type model templates of events and parameter model templates of threshold types. As shown in the middle part of fig. 3, each event model template may include an event number, and the following metadata names related to the event: event english name, event chinese name, event type, event text, parent event number, event enabled status, etc. Each threshold type model template of an event may include a threshold type number, and the following metadata names associated with the threshold type: threshold type english names, threshold type chinese names, threshold type enabled states, etc. Each parametric model template of the threshold type may include therein a threshold parameter variation, and the following metadata associated with the threshold parameter: the value, the threshold type number to which it belongs, the event number to which it belongs.
The command data model templates may include various command model templates, as well as parameter model templates in commands. As shown on the left side of fig. 3, each command model template may include a command number, and the following metadata names related to the command: command english name, command chinese name, command enable status. Each of the parameter model templates in the command may include a command parameter number, and the following metadata associated with the command parameter: parameter type, parameter register number, parameter command number, etc.
In the specific implementation, for each metadata name in the data model template, whether the metadata table has the corresponding metadata or not can be judged, if so, the metadata is recorded in the corresponding position in the data model template until all metadata in the metadata table are recorded in the data model template, so that a data model of the automation equipment is generated. The generated data model of the automation equipment can comprise the following three types: a state data model, an event data model, a command data model.
In an exemplary embodiment, when the number of automation devices is plural, referring to fig. 3, the data model template may further include: the device model template is shown on the upper side of fig. 3, where the device model template may include a device name, a device number, and the like, the device name may include a device chinese name, a device english name, and the device number may include a device number of the current device and a number of a parent device of the current device. Correspondingly, the state variable model template, the event model template and the command model template can also comprise the equipment number of the equipment.
By setting the equipment model templates in the preset data model templates, the equipment numbers of the equipment are respectively included in the equipment model templates, the state variable model templates, the event model templates and the command model templates, so that when a plurality of automation equipment are provided, metadata of the plurality of automation equipment can be simultaneously input into the data model templates according to metadata tables of the plurality of automation equipment, and high-frequency data acquisition of the plurality of automation equipment is realized.
In step 103, an interface of the automation device is created in combination with the data model of the automation device and the preset interface format definition text.
In an exemplary embodiment, the interface format definition text may be generated in advance according to all writable variables of the automation device, where an entry in the interface format definition text may be a writable variable list and an exit may be an execution result state. Thus, after the data model of the automation device is created, the text can be defined by combining the data model of the automation device and a preset interface format, and an interface of the automation device is created.
In an exemplary embodiment, the format items in the interface format definition text and descriptions of the format items may be as shown in table 2 below.
Table 2 contains entries and descriptions
In step 104, a service corresponding to the interface is generated in combination with the interface of the automation device and a preset coding template, and the service is deployed on the automation device platform.
In an exemplary embodiment, a code template capable of generating a service corresponding to an interface may be preset, so that after the interface of the automation device is created, the service corresponding to the interface may be generated by combining the interface of the automation device with the preset code template, and then the service may be deployed on the automation device platform.
In an exemplary embodiment, the interface of the automation device may include information such as an interface name and a parameter, and when the specific implementation is performed, a service corresponding to the interface may be generated by combining the interface of the automation device with a preset encoding template in the following manner:
Combining the interface name and the parameter of the automation equipment, replacing the interface name and the parameter in the coding template, and generating a service code;
Compiling and packaging the service codes to generate the executable files of the services corresponding to the interfaces.
Specifically, the information such as the interface name and parameters of the automation equipment can be combined, the information such as the interface name and parameters in the coding template can be replaced, service codes can be generated, the service codes are compiled and packaged, executable files of the services corresponding to the interfaces are generated, the executable files are stored in preset storage positions, the automation equipment platform is subjected to hot loading, the interfaces are issued to the automation equipment platform, the services are deployed on the automation equipment platform, and therefore the automation equipment platform can realize the services corresponding to the interfaces by calling the interfaces.
In step 105, the text is defined in combination with the service and the interface format, the client code corresponding to the service is generated, and the client code is compiled and packaged, so that the management software of the automation device is generated, and the automation device is managed by the management software.
In an exemplary embodiment, after a service is deployed on an automation device platform, a text can be defined by combining the service and an established interface format, a client code corresponding to the service is generated, and the client code is compiled and packaged to generate management software of the automation device, so that the automation device can be managed through the management software.
In an exemplary embodiment, the client code corresponding to the service may be generated based on the https restful service of Java, in combination with the service and the created interface format definition text.
In an exemplary embodiment, the management software communicates with the automation device platform and may perform bidirectional authentication using https security certificate bidirectional authentication.
Specifically, an https security certificate bidirectional authentication mode can be adopted to carry out identity authentication on management software and an automation equipment platform and carry out security encryption on communication content. The management software and the automation equipment platform can exchange the security certificates in an offline mode, and the respective security certificates of the management software and the automation equipment platform are imported into a certificate warehouse of the other party for storage after being agreed by the two parties. Therefore, the communication security between the management software and the automation equipment platform is ensured.
In addition, the management software and the automation equipment platform are respectively communicated with the cloud or the third party system, and can perform identity authentication and encryption of communication contents in a mode of adding a digital signature to a security certificate, so that the communication security between the management software and the automation equipment platform and the external cloud or the third party system is ensured.
In an exemplary embodiment, as shown in fig. 4, the automation device may be managed by using a multi-node cooperation distributed cache.
Wherein, as shown in fig. 4, the automation device platform and the database server may together provide services to the client. The client and the automation equipment platform can be deployed in multiple layers, so that the computing and processing capacity can be infinitely expanded, metadata tables and metadata and other data in the metadata tables can be stored in a distributed cache, and the metadata tables and metadata storage and access of a large amount of data are realized. In addition, load balancing can be realized between the client and the automation equipment platform through a load balancer.
It may be understood that in the embodiment of the present application, by combining a preset metadata table template, a metadata table of an automation device is created, all metadata of each automation device may be sorted, by combining a metadata table and a data model template, a data model of the automation device is created, all metadata of each automation device may be divided into corresponding data models, so as to implement unification of the data models, by combining the data models and interface format definition text, an interface of the automation device is created, and unification of the interface format may be implemented.
The management software of the automation equipment is generated by combining the created interface of the automation equipment and the preset coding template to generate the service corresponding to the interface, then combining the service and the interface format definition text to generate the client code corresponding to the service, compiling and packaging the client code, and the interface format of the automation equipment is uniform. In addition, the management method of the automatic equipment provided by the application does not need manual operation, avoids the condition of manual operation errors, does not need a large amount of investigation, development and test work, and enables remote docking and development to be possible.
According to the method for managing the automation equipment, firstly, the automation equipment to be managed is obtained, a metadata table of the automation equipment is created by combining a preset metadata table template, then a data model of the automation equipment is created by combining the metadata table of the automation equipment and a preset data model template, then an interface of the automation equipment is created by combining the data model of the automation equipment and a preset interface format definition text, then a service corresponding to the interface is generated by combining the interface of the automation equipment and a preset coding template, the service is deployed on an automation equipment platform, further a client code corresponding to the service is generated by combining the service and the interface format definition text, and the client code is compiled and packaged to generate management software of the automation equipment, so that the automation equipment is managed by the management software, the management software of the automation equipment is generated by combining the preset metadata table template, the data model template, the interface format definition text and the coding template, and the automation equipment is managed by the generated management software of the automation equipment, and the control and the real-time monitoring convenience and the convenience of the automation equipment can be ensured.
In order to achieve the above embodiments, an embodiment of the present disclosure proposes a management apparatus of an automation device.
Fig. 5 is a block diagram illustrating a management apparatus of an automation device according to an exemplary embodiment, and referring to fig. 5, the management apparatus 100 of an automation device may include: the first creation module 110, the second creation module 120, the third creation module 130, the processing module 140, and the generation module 150.
The first creating module 110 is configured to obtain an automation device to be managed, and combine a preset metadata table template to create a metadata table of the automation device;
a second creating module 120, configured to create a data model of the automation device in combination with a metadata table of the automation device and a preset data model template;
a third creating module 130, configured to define a text in combination with a data model of the automation device and a preset interface format, and create an interface of the automation device;
the processing module 140 is configured to combine an interface of the automation device with a preset encoding template, generate a service corresponding to the interface, and deploy the service on the automation device platform;
And the generating module 150 is used for combining the service and the interface format definition text, generating a client code corresponding to the service, compiling and packaging the client code, and generating management software of the automation equipment so as to manage the automation equipment through the management software.
Optionally, the metadata table template includes: the name of each metadata and metadata description;
accordingly, the first creation module 150 is specifically configured to:
judging whether the automation equipment is configured with metadata or not according to each metadata in the metadata table template;
If metadata is configured in the automation equipment, the metadata is used as first metadata;
and generating a metadata table of the automation equipment according to each first metadata and the corresponding metadata description.
Optionally, the data model template includes: a status data model template, an event data model template, and a command data model template;
Wherein, the state data model template comprises: each state variable model template, wherein the state variable model templates comprise: respective metadata associated with the state variables;
The event data model template comprises the following steps: each event model template, a threshold type model template of an event in the event model templates and a parameter model template of a threshold type;
The command data model template comprises: each command model template, and parameter model templates in the commands.
Optionally, the number of the automation devices is multiple, and the data model template further includes: an equipment model template; the device model template includes: device name and device number;
the state variable model template, the event model template and the command model template also comprise the equipment number of the equipment.
Optionally, the interface of the automation device includes: interface name and parameters;
The processing module 140 is specifically configured to:
Combining the interface name and the parameter of the automation equipment, replacing the interface name and the parameter in the coding template, and generating a service code;
Compiling and packaging the service codes to generate the executable files of the services corresponding to the interfaces.
Optionally, the management software communicates with the automation equipment platform by adopting an https security certificate bidirectional authentication mode to perform bidirectional authentication.
It should be noted that, the implementation process and the technical principle of the management apparatus of the automation device in this embodiment refer to the foregoing explanation of the management method of the automation device in the embodiment of the disclosure, and are not repeated herein.
According to the management device of the automation equipment, firstly, the automation equipment to be managed is obtained, a metadata table of the automation equipment is created by combining a preset metadata table template, then a data model of the automation equipment is created by combining the metadata table of the automation equipment and a preset data model template, then an interface of the automation equipment is created by combining the data model of the automation equipment and a preset interface format definition text, then a service corresponding to the interface is generated by combining the interface of the automation equipment and a preset coding template, and the service is deployed on an automation equipment platform, further a client code corresponding to the service is generated by combining the service and the interface format definition text, and the client code is compiled and packaged to generate management software of the automation equipment, so that the management software of the automation equipment is managed by the management software, the management software of the automation equipment is generated by combining the preset metadata table template, the data model template, the interface format definition text and the coding template, and the management software of the automation equipment is managed by the generated, and the control and real-time convenience and the monitoring of the automation equipment can be ensured.
In order to achieve the above embodiments, the embodiments of the present disclosure further provide an electronic device.
Wherein, electronic equipment includes:
A processor;
A memory for storing processor-executable instructions;
wherein the processor is configured to execute instructions to implement the method of managing an automation device as described above.
As an example, fig. 6 is a block diagram of an electronic device 200 for managing an automation device according to an exemplary embodiment, and as shown in fig. 6, the electronic device 200 may further include:
A memory 210 and a processor 220, a bus 230 connecting the different components (including the memory 210 and the processor 220), the memory 210 storing a computer program which when executed by the processor 220 implements the method of managing an automation device according to an embodiment of the present disclosure.
Bus 230 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 200 typically includes a variety of electronic device readable media. Such media can be any available media that is accessible by electronic device 200 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 210 may also include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 240 and/or cache memory 250. Server 200 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 260 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard disk drive"). Although not shown in fig. 6, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 230 via one or more data medium interfaces. Memory 210 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the various embodiments of the disclosure.
Program/utility 280 having a set (at least one) of program modules 270 may be stored in, for example, memory 210, such program modules 270 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 270 generally perform the functions and/or methods in the embodiments described in this disclosure.
The electronic device 200 may also communicate with one or more external devices 290 (e.g., keyboard, pointing device, display 291, etc.), one or more devices that enable a user to interact with the electronic device 200, and/or any device (e.g., network card, modem, etc.) that enables the electronic device 200 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 292. Also, electronic device 200 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 293. As shown, network adapter 293 communicates with other modules of electronic device 200 over bus 230. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 200, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processor 220 executes various functional applications and data processing by running programs stored in the memory 210.
It should be noted that, the implementation process and the technical principle of the electronic device in this embodiment refer to the foregoing explanation of the management method of the automation device in the embodiment of the disclosure, and are not repeated herein.
The electronic device provided by the embodiment of the disclosure can be used for generating the management software of the automation device by combining the preset metadata table template, the data model template, the interface format definition text and the encoding template, and managing the automation device through the generated management software of the automation device, so that the real-time control of the automation device and the convenience of monitoring and analysis can be ensured.
In order to implement the above-described embodiments, the present disclosure also proposes a storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method of managing an automation device as described previously.
To achieve the above embodiments, the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor of an electronic device, enables the electronic device to perform the method of managing an automation device as described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.