Disclosure of Invention
In industrial, medical, commercial, government affairs and other scenes, various systems are used for carrying out function integration and data integration by using message middleware, and particularly, the integration problem among heterogeneous systems in a network scene can be solved, so that the system design capacity is greatly improved.
If the characteristics of cross-system, cross-language and flexible configuration of the message middleware are fully utilized, the message middleware is embedded into each software module, and data exchange between the modules is realized by messages, the strong coupling of interfaces between the modules can be released; on the other hand, the start-stop mode, the operation parameters, the message data between the modules and the like of the modules are all configured by the database, the whole software function can be defined by the database to a certain degree, and the adjustment of the software function can be realized by modifying the database.
According to the above idea, the present invention provides a development framework for a data processing program of a physical device component, comprising: the system comprises a management module, a data distribution service, a database editing tool and a plurality of functional modules, wherein the functional modules have a data processing function, the management module is used for managing configuration information, loading/unloading the functional modules and monitoring system running states, the data distribution service is used for centralized message distribution, the database editing tool can define the types, the number and the running parameters of the functional modules to be run, the data formats to be processed by the system and the global mapping relation of system message subscription/publication among the modules/systems through the configuration information, message subscription/publication interfaces are arranged in the functional modules, and the functional modules are packaged by an object-oriented method and run in an independent thread/process mode.
This design creates development and execution environment conditions for process or thread level based program reuse.
To facilitate centralized control management, the management module preferably includes a control domain capable of centrally distributing messages and a message stack capable of managing configuration information, loading/unloading the function modules, and monitoring system operation states.
Further, the function module serves as a client, the message stack serves as a server, and both the function module and the message stack are configured with communication interfaces.
Preferably, the functional modules can be programmed by adopting different high-level languages, and each high-level language program can realize data interaction by encapsulating matched message middleware.
Compared with the prior art, the invention has the following beneficial effects: an effective standardized data interaction mechanism of the software functional module is provided, the software functional module is further packaged and decoupled, repeated development is reduced to a greater extent, the inheritance, flexibility and stability of the technology are enhanced, and the software development efficiency is improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, and the described embodiments are some embodiments, but not all embodiments, of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any new work, are within the scope of the present invention.
Referring to fig. 1-4 of the present specification, an overall framework of a data processing program of a physical device component is first planned, and the overall framework includes a management module 101, a function module 201 and a database editing tool, i.e., a configuration information editing tool 117 in the figure, which are communicatively connected to each other.
The management module 101 is configured to manage each specific functional module and a data distribution service thread, edit the configuration information database 119 using the configuration information editing tool 117, integrate the development and operation environment 118, and distribute various types of information through the data distribution service 102; and creates instances of the respective functional modules 201 in turn. After each instance of the functional module 201 is created, configuration information is sent to them separately. In the software running process, the management module 101 periodically monitors the system running environment (information such as the online condition of each service, the occupancy rate of the CPU, the memory, the hard disk, and the network), and the state of the function module 201. Reporting the abnormal system operation environment, restarting or shutting down the system according to the remote control instruction, and performing self-recovery processing on the functional module 201 which operates abnormally.
The data distribution service 102 implements message data distribution among modules in the local computer, and is composed of a message publishing terminal 301, a message subscribing terminal 302 and a message queue 303. The message publishing end 301 publishes the message through the TCP protocol by using a message publishing mechanism of the message middleware, and a publisher of the message may be other modules or an application program. The message subscription terminal 302 subscribes to messages of various publishing points by using a message subscription mechanism of the message middleware, and a subscriber of the messages can be other modules or application programs.
The configuration information editing tool 117 defines network nodes which need to be developed or need to communicate in the system by using a text or formalization tool with a fixed format, gives message definitions between software configuration items and between software modules, gives format definitions of communication data, gives definitions of communication modes and parameters, gives definitions of data using methods such as numerical value conversion, threshold judgment, type enumeration and display modes, and gives definitions of control instruction data formats. And editing, checking and resolving the data definitions, and storing the data definitions in a configuration information database.
The development and execution environment 118 employs multiple high-level language development platforms, multiple operating system platforms, as long as the operating conditions of the message middleware and related communication protocols are met.
The configuration information database 119 performs configuration information management based on a relational database, which can be accessed through local and remote networks. The system mainly comprises a total system composition table, an equipment configuration table, a message table, a state data table, a process controller communication data table, a sensor information data table and other information data tables.
The functional module 201 includes 14 mutually decoupled submodules, and this frame has the openness, can increase and decrease new submodule according to the demand, specifically includes:
and the remote publishing module 103 is used for realizing remote publishing of messages with a network host, receiving the messages sent by the functional module 201 according to the related message contents defined in the configuration table and publishing the messages to the network.
And the remote subscription module 104 is used for implementing remote subscription of messages with the network host, subscribing the messages published on the network according to the related message contents defined in the configuration table, and sending the subscribed messages to the function module 201.
The UDP module 105, which uses UDP for communication, may receive, may send one-to-one, one-to-many, sends out the UDP packet packaged by the protocol parsing module 115, and transmits the received UDP packet to the protocol parsing module 115 for processing, and cooperates with the protocol parsing module 115 to implement configurable UDP communication.
The TCP module 106 may implement both the server function and the client function. The method is mainly used for receiving and sending TCP data messages, and is matched with the protocol analysis module 115 to realize configurable TCP communication.
The Modbus module 107 is matched with the protocol analysis module 115 to realize configurable Modbus communication with the field control equipment.
The EIP module 108, in cooperation with the protocol parsing module 115, implements configurable EIP mode communication with the field control device.
The interface module 109 displays the status data of each device in real time, issues the operation instruction in real time, and the human-computer interface process subscribes the status data or issues the instruction data to each function module 201 through the inter-host message.
And the real-time database module 110 is used for receiving the real-time data issued by other modules, caching the real-time data to a real-time database, and archiving the real-time data by utilizing the persistence function of the real-time database. And receiving operation requests of other modules for adding, deleting, modifying and checking the database.
And the relational database module 111 is used for receiving the archived data issued by other modules and receiving operation requests of other modules for increasing, deleting, modifying and checking the database.
The UART module 112, in cooperation with the protocol parsing module 115, implements configurable communication with the UART device.
The SNMP module 113, in cooperation with the protocol parsing module 115, implements configurable SNMP communication with the network management type network switch device.
The DDS interface module 114, cooperating with the protocol parsing module, implements communication with an external network device in a configurable DDS manner.
The protocol analysis module 115 receives data streams from various communication modules, analyzes various data from the data streams according to the configuration information, and sends the data streams to the related function module 201 in the system for further processing; on the other hand, the data sent by the relevant function module 201 is received, is packaged into a protocol message according to the configuration information, and is sent to the relevant communication module according to the configuration for sending.
And the other/custom module 116 adds functions needing to be packaged or service functions customized by a user according to needs, and packages the message publishing terminal (301) and the message subscribing terminal (302) so as to exchange data with other modules. The module can be written in cross-language, and if a certain programming language realizes the same message middleware as the framework, the module can be developed on the programming language, so that the module can run in the framework.
After the framework is planned, according to the principle that information is comprehensive and unique, programming links are simplified, software reuse is emphasized, and configuration information is simplified, a software framework configuration information template is designed, controlled and maintained, 7 types of configuration forms are included, the description of a configuration information database 119 is defined according to the description, the information mainly includes information in aspects of whole system network composition, overall architecture of each software, data format, data flow direction, state data alarm condition and the like, the information can be edited by editing software such as EXCEL and the like, or a form file is defined by a formal development tool and then exported, the file is shared with an interface design document, the file can be directly imported into a database for program reading, and reasonable configuration is carried out on data and information, so that the flow of the information between software configuration items and between software modules can be completed.
Then, interface functions and background business logic are designed in the custom module, and the system can simultaneously comprise a plurality of different custom modules.
Code writing generally follows the following principles:
if the data subscription from the management module is needed, firstly subscribing the measuring point name of the current equipment in the program, wherein the measuring point name corresponds to the configuration information edited previously;
in the service process, if the current data needs to be published, the measurement point publishing needs to be carried out in the corresponding service logic function;
and designing a data response processing function according to the business requirements of the user, and when the module monitors that the subscribed measuring point has a response value, receiving the value to perform further business processing.
And compiling and running a general software framework program, a background service program and an interface program in sequence to realize the current service process.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that changes may be made in the embodiments and/or equivalents thereof without departing from the spirit and scope of the invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.