Disclosure of Invention
In view of the above technical problems, the present application provides a data conversion system, which can solve at least one of the above technical problems.
The technical scheme adopted by the application is as follows:
an embodiment of the present application provides a data conversion system, including: the server comprises one or more processors and a storage medium storing a computer program, and the memory, the m data acquisition devices and the first message forwarding device are in communication connection with the server;
the ith data acquisition device is used for acquiring a plurality of monitoring data of ni monitored equipment and sending the acquired monitoring data and the ID of the ith data acquisition device to the first message forwarding device in a data packet mode, wherein the value of i is 1 to m, the value of ni is 1 to N, and N is the number of the monitored equipment; each monitoring data comprises a monitoring value of a monitoring point, an ID of corresponding monitored equipment, a corresponding monitoring value identifier and a timestamp;
the first message forwarding device is used for sending the received data packet to the processor;
a first configuration file and a second configuration file are stored in the memory, wherein m pieces of configuration information are stored in the first configuration file, and N pieces of configuration information are stored in the second configuration file; wherein the ith piece of configuration information in the first configuration file comprises (MID)i,EGIDi),MIDiFor the ID, EGID, of the ith data acquisition deviceiAs MIDiID set, EGID, of corresponding monitored devicei=(EIDi1,EIDi2,…,EIDini),EIDiuIs EGIDiThe value of u is 1 to ni of the u-th monitored equipment;
second configurationThe j-th configuration information in the file includes (EID)j,Flagj),EIDjFor ID, Flag, of jth monitored devicejIs an EIDjCorresponding target data identification set, Flagj=(Flagj1,Flagj2,…,Flagjk),FlagjrIs FlagjWherein, the value of r is 1 to k, the value of k is 1 to Hj, and Hj is EIDjThe number of the monitoring points of the corresponding monitored equipment, and the value of j is 1 to N;
for any received data packet, the processor is configured to execute a computer program to perform the following steps:
s100, acquiring the ID of a data acquisition device S in the current data packet, wherein the value of S is 1 to m;
s200, searching in the first configuration file and the second configuration file by using the acquired ID of the data acquisition device S to obtain an associated search set A = (A1, A2, …, Ap), wherein At = (EID)t,Flagt) T is 1 to p, p is 1 to ns, and ns is 1 to N;
s300, for each At, obtaining and Flag in the current data packettThe monitoring data corresponding to all the target data identifications in the target data list are used as target monitoring data;
and S400, encoding the data format of the target monitoring data to convert the data format into a set standard data format, and generating a corresponding data packet t, wherein the data packet t comprises the target monitoring data with the set data format, and the ID and the time stamp of the corresponding monitored equipment t.
The application has at least the following technical effects: under the condition of not changing an original monitoring system, the acquired monitoring data of the monitored equipment is processed in a unified format, so that the processed data have the same data format, the data are convenient for a user to call, interface programs of the user are reduced, the working efficiency is improved, and the monitoring cost can be saved.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The technical idea of the data conversion system provided by the embodiment of the application is that the monitoring data of the monitored equipment acquired by the data acquisition device is extracted according to a target data identification bit set by the user's requirement, and the extracted data is subjected to unified format processing, so that the output data has the same data format, and thus, the time of the user on data format unification can be saved. In the embodiment of the present application, the monitored equipment may be production equipment, for example, a numerical control machine tool or the like. The monitoring data may include production process parameters such as temperature, humidity, voltage, current, motor speed, and operating parameters.
As shown in fig. 1, in the embodiment of the present application, the data conversion system may include: the server comprises one or more processors and a storage medium storing a computer program.
In this embodiment, the data acquisition device may be an edge gateway device. For the monitoring point condition of the monitored equipment needing to be monitored, a corresponding data acquisition device can be set, and the data acquisition device can correspond to one monitored equipment or a plurality of monitored equipment. Specifically, the ith data obtaining device is configured to obtain multiple pieces of monitoring data Qi of the corresponding ni pieces of monitored equipment (that is, obtain Qi pieces of monitoring data altogether) and send the obtained monitoring data and the ID of the obtained monitoring data to the first message forwarding device in the form of a data packet, where a value of i is 1 to m, and ni is greater than or equal to 1.
In this embodiment of the application, each data obtaining device may obtain monitoring data according to a preset sampling period and send the monitoring data to the first message forwarding device. Because the manufacturers of each data acquisition device are different and even if the data acquisition devices produced by the same manufacturer are different in the type of the acquired data, the communication protocols of the used data interfaces are different, that is, the monitoring data acquired by the data acquisition devices have different data formats, so that various multi-source heterogeneous data are formed.
In one exemplary embodiment, the monitoring data may include a monitoring value of the monitoring point, an ID of the corresponding monitored device, an identification of the corresponding monitoring value, and a time stamp (acquisition time of the monitoring data).
In the embodiment of the application, all monitoring data are in a JSON string format, so that the monitoring data are easy to read and write by people, are easy to analyze and generate, and effectively improve the network transmission efficiency.
In this embodiment of the application, the data acquisition device may acquire corresponding monitoring data through a plurality of data acquisition devices arranged on the monitored equipment. The data acquisition device may be a sensor device, such as a temperature sensor, a humidity sensor, a circuit breaker, a voltage sensor, a current sensor, and the like. Each data acquisition device is accessed into the corresponding data acquisition device through the corresponding data interface. The data acquisition device can be used for acquiring the monitoring data of the monitored equipment in real time.
Further, in the embodiment of the present application, a data receiving device such as a CNC controller, a PLC, etc. may be further included. The data acquisition device can be integrated on the data receiving device, and the data receiving device is connected with a plurality of corresponding data acquisition devices and is used for acquiring and processing the monitoring data acquired by the data acquisition devices. The data acquisition device acquires monitoring data from the corresponding data receiving device.
In this embodiment of the present application, the first message forwarding apparatus is configured to send the received data packet to the processor. The first message forwarding device may be an EMQ.
In the embodiment of the present application, the memory stores a first configuration file and a second configuration file. The first configuration file stores the mapping relation between the data acquisition device and the monitored equipment, and the second configuration file stores the mapping relation between the monitored equipment and the target data identifier.
Specifically, m pieces of configuration information are stored in a first configuration file, and N pieces of configuration information are stored in a second configuration file; wherein the ith piece of configuration information in the first configuration file comprises (MID)i,EGIDi),MIDiFor the ID, EGID, of the ith data acquisition deviceiAs MIDiID set, EGID, of corresponding monitored devicei=(EIDi1,EIDi2,…,EIDini),EIDiuIs EGIDiThe value of u is 1 to ni for the u-th monitored device.
The j-th configuration information in the second configuration file includes (EID)j,Flagj),EIDjFor ID, Flag, of jth monitored devicejIs an EIDjCorresponding target data identification set, Flagj=(Flagj1,Flagj2,…,Flagjk),FlagjrIs FlagjWherein, the value of r is 1 to k, the value of k is 1 to Hj, and Hj is EIDjThe number of the monitoring points of the corresponding monitored equipment, and the value of j is 1 to N; the target data identification is the data identification of the monitoring data which needs to be monitored by the user, and the number of the monitoring points of each monitored device and the corresponding target data identification are determined according to the user requirements.
In the embodiment of the application, the processor is used for processing the received data packet in real time, specifically, the processor performs protocol analysis and data preprocessing on the received data packet, performs format unification and semantic analysis on various acquired multi-source heterogeneous data, performs operations such as data elimination, compression and caching, and transmits the data to the cloud.
Specifically, for any received data packet, the processor is configured to execute the computer program, and implement the following steps:
s100, acquiring the ID of a data acquisition device S in the current data packet, wherein the value of S is 1 to m.
In this step, the processor decodes the acquired data packet to obtain a decoded data packet, where the decoded data packet includes Qs pieces of monitoring data.
S200, searching in the first configuration file and the second configuration file by using the acquired ID of the data acquisition device S to obtain an associated search set A = (A1, A2, …, Ap), wherein At = (EID)t,Flagt) T is 1 to p, p is 1 to ns, and ns is 1 to N.
In this step, the processor searches the first profile and the second profile for the IDs of the data acquisition devices acquired from the decoded data packet, and since one data acquisition device may be associated with one or more monitored apparatuses, the IDs of a plurality of monitored apparatuses and corresponding target identifier sets are obtained, so as to form an associated search set.
Specifically, the associated search set may be obtained by:
s201, searching in a first configuration file by using the acquired ID of the data acquisition device to obtain the corresponding ID set of the monitored equipment;
s202, for the ID of each monitored device in the monitored device set, searching in a second configuration file by using the corresponding ID to obtain a corresponding target data identifier;
and S203, obtaining the associated retrieval set according to the S201 and the S202.
S300, for each At, obtaining and Flag in the current data packettThe monitoring data corresponding to all the target data identifications in the target data list are used as target monitoring data.
Specifically, Flag is identified for any target data in AttqThe following steps are executed:
s301, traversing the current data packet, if Flag in the xth monitoring datax=FlagtqAnd EIDx=EIDtAnd taking the x-th monitoring data as target monitoring data, wherein the value of x is from 1 to Qs, the value of q is from 1 to Ht, and Ht is the number of monitoring points of the monitored equipment t.
And S400, encoding the data format of the target monitoring data to convert the data format into a set standard data format, and generating a corresponding data packet t, wherein the data packet t comprises the target monitoring data with the set data format, and the ID and the time stamp of the corresponding monitored equipment t.
For each target monitoring data, it may be encoded and converted into a set standard data format, and those skilled in the art know that the existing method may be adopted to convert the target monitoring data into the set standard data format.
All multi-source heterogeneous data are converted into a standard data format in a coding mode, so that the data format can be unified on the premise of not changing an original monitoring system, the conversion cost can be saved, and the data acquisition efficiency of a user can be improved.
Further, as shown in fig. 1, the system provided in the embodiment of the present application further includes a data publishing platform in communication connection with the server. The processor is further configured to execute the computer program to perform the steps of:
and S500, sending the generated data packet t to the data publishing platform.
And the data publishing platform is used for performing visual presentation based on the acquired data packet.
The content visually presented by the data publishing platform comprises each monitored device, a target monitoring value and the acquisition time of the target monitoring value. The existing visual presentation mode can be adopted for presentation. The user can obtain the required monitoring data from the data publishing platform.
Further, in the embodiment of the present application, a second message forwarding apparatus is further included; and the second message forwarding device is used for sending the received data packet to the data publishing platform.
In one exemplary embodiment, the first message forwarding device and the second message forwarding device may be the same device. Thus, cost can be saved by multiplexing the message forwarding devices.
In another exemplary embodiment, the first message forwarding device and the second message forwarding device may be different devices. Thus, data transfer efficiency can be improved.
Further, the system provided by the embodiment of the application further comprises a persistent database;
the processor is further configured to execute the computer program to perform the steps of:
s600, sending the generated data packet t to the persistent database. Therefore, all monitoring data can be stored, and subsequent calling is facilitated.
Although some specific embodiments of the present application have been described in detail by way of illustration, it should be understood by those skilled in the art that the above illustration is only for purposes of illustration and is not intended to limit the scope of the present application. It will also be appreciated by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present application. The scope of the disclosure of the present application is defined by the appended claims.