+

CN111294235B - Data processing method, device, gateway and readable storage medium - Google Patents

Data processing method, device, gateway and readable storage medium Download PDF

Info

Publication number
CN111294235B
CN111294235B CN202010058251.0A CN202010058251A CN111294235B CN 111294235 B CN111294235 B CN 111294235B CN 202010058251 A CN202010058251 A CN 202010058251A CN 111294235 B CN111294235 B CN 111294235B
Authority
CN
China
Prior art keywords
data
protocol
output
input
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010058251.0A
Other languages
Chinese (zh)
Other versions
CN111294235A (en
Inventor
许雄杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wensi Haihui Yuanhui Technology Wuxi Co ltd
Original Assignee
Wensi Haihui Yuanhui Technology Wuxi Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wensi Haihui Yuanhui Technology Wuxi Co ltd filed Critical Wensi Haihui Yuanhui Technology Wuxi Co ltd
Priority to CN202010058251.0A priority Critical patent/CN111294235B/en
Publication of CN111294235A publication Critical patent/CN111294235A/en
Application granted granted Critical
Publication of CN111294235B publication Critical patent/CN111294235B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/24Negotiation of communication capabilities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/16Gateway arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a data processing method, a device, a gateway and a readable storage medium, wherein an input interface corresponding to a target input protocol is started according to data input configuration parameters by receiving gateway configuration parameters, and an output interface corresponding to the target output protocol is started according to data output configuration parameters. And further acquiring data to be processed, which is transmitted from the input interface, calling an input protocol plug-in corresponding to the target input protocol according to the data input configuration parameters, analyzing the data to be processed to obtain analyzed data, calling an output protocol plug-in corresponding to the target output protocol according to the data output configuration parameters, packaging the analyzed data, and transmitting the analyzed data through the output interface. Therefore, a user can start corresponding input interfaces and output interfaces to perform corresponding data processing according to actual needs, such as different industrial scenes, so that the gateway has universality and meets the more and more complex and variable industrial needs to a certain extent.

Description

Data processing method, device, gateway and readable storage medium
Technical Field
The present application relates to the field of internet of things, and in particular, to a data processing method, a device, a gateway and a readable storage medium.
Background
With the continuous development of the internet of things technology, more and more devices for realizing network interconnection are realized. The gateway acts as a "translator" in the network, which plays an important role in ensuring efficient interaction of data between different devices. Currently, industrial devices are more and more, and when a gateway is used, requirements to be met are more and more changeable, and the existing gateway cannot meet the changeable requirements.
Disclosure of Invention
An objective of the embodiments of the present application is to provide a data processing method, a device, a gateway, and a readable storage medium, so as to solve the problem that the existing gateway cannot meet the changeable requirements.
The embodiment of the application provides a data processing method, which comprises the following steps:
receiving gateway configuration parameters, wherein the gateway configuration parameters comprise data input configuration parameters and data output configuration parameters; enabling an input interface corresponding to a target input protocol according to the data input configuration parameters, and enabling an output interface corresponding to a target output protocol according to the data output configuration parameters; acquiring data to be processed which is transmitted from the input interface, calling an input protocol plug-in corresponding to the target input protocol according to the data input configuration parameters, and analyzing the data to be processed to obtain analyzed data; and calling an output protocol plug-in corresponding to the target output protocol according to the data output configuration parameters, packaging the parsed data, and sending the parsed data through the output interface.
In practical applications, the gateway may integrate multiple input interfaces and multiple output interfaces. In the embodiment of the application, the gateway configuration parameters can be received, the input interface corresponding to the target input protocol is started according to the data input configuration parameters, and the output interface corresponding to the target output protocol is started according to the data output configuration parameters. And further acquiring data to be processed, which is transmitted from the input interface, calling an input protocol plug-in corresponding to the target input protocol according to the data input configuration parameters, analyzing the data to be processed to obtain analyzed data, calling an output protocol plug-in corresponding to the target output protocol according to the data output configuration parameters, packaging the analyzed data, and transmitting the analyzed data through the output interface. In this way, the user can start corresponding input interfaces and output interfaces according to actual needs, such as different industrial scenes, and further perform corresponding data processing, so that the gateway has universality, can be suitable for different industrial scenes, improves the adaptability of the gateway equipment to a certain extent, and meets the more and more complex and changeable industrial needs to a certain extent.
Further, the data input configuration parameters include: a first protocol identification corresponding to the target input protocol; the calling the input protocol plugin corresponding to the target input protocol according to the data input configuration parameter comprises the following steps: and according to the first protocol identifier, calling an input protocol plugin corresponding to the protocol identifier from a preset input protocol plugin set.
In the implementation process, the input protocol plug-in can be rapidly determined through the first protocol identifier corresponding to the target input protocol, so that the data processing efficiency is improved.
Further, the calling the input protocol plugin corresponding to the target input protocol according to the data input configuration parameter, and analyzing the data to be processed to obtain analyzed data, includes: instantiating the input protocol plugin as a data parsing object; and acquiring input protocol analysis parameters of the data to be processed through the data analysis object, and analyzing the data to be processed according to the input protocol analysis parameters to obtain the analyzed data.
In the implementation process, the input protocol plug-in is instantiated to be a data analysis object, the input protocol analysis parameters of the data to be processed are acquired through the data analysis object, and then the data to be processed is analyzed according to the input protocol analysis parameters, so that analyzed data is obtained, the analysis of the data to be processed is effectively realized, and the reliability of the scheme provided by the embodiment of the application is improved.
Further, the data output configuration parameters include: a second protocol identifier corresponding to the target output protocol; the calling the output protocol plug-in corresponding to the target output protocol according to the data output configuration parameter comprises the following steps: and extracting the output protocol plug-ins corresponding to the protocol identifications from the preset output protocol plug-in set according to the second protocol identifications.
In the implementation process, the output protocol plug-in can be rapidly determined through the first protocol identifier corresponding to the target output protocol, so that the data processing efficiency is improved.
Further, the encapsulating the parsed data to be processed includes: instantiating the output protocol plug-in as a data output object, and configuring output protocol parameters for the parsed data through the data output object to obtain packaging data corresponding to the target output protocol; the transmitting through the output interface includes: and sending the encapsulated data through the data output object according to the rule of the target output protocol through the output interface.
In the implementation process, the output protocol plug-in is instantiated to be a data output object, and then the output protocol parameters are configured for the analyzed data through the data output object, so that the packaged data are obtained, and then the packaged data are sent through the output interface according to the rules of the target output protocol, so that the package of the analyzed data is effectively realized, and the reliability of the scheme provided by the embodiment of the application is improved.
Further, the target input protocol is a plurality of, and the method further comprises: acquiring attribute information of the acquired equipment corresponding to each target input protocol in the plurality of target input protocols, wherein the attribute information at least comprises one of the following: the method comprises the steps of collecting the number of measuring points, data transmission mode, data collection frequency and data length; and configuring special memory resources for data acquisition for each target input protocol in the plurality of target input protocols according to the attribute information.
In the implementation process, the attribute information of the collected equipment corresponding to each target input protocol is obtained, so that the special memory resource for data collection is configured for each target input protocol, each target input protocol has the special memory resource, data collection can be carried out, and the reliability of the scheme provided by the embodiment of the application is improved.
Further, the method further comprises: storing the parsed data into a data cache queue to implement persistence of the parsed data; the encapsulating of the parsed data includes: and periodically acquiring the parsed data from the data cache queue for encapsulation.
In the implementation process, the persistence of the parsed data is realized by storing the parsed data into the data cache queue, and the encapsulation of the parsed data obtained from the data cache queue can ensure that the parsed data can be encapsulated and sent to the corresponding destination device, so that the reliability of the scheme provided by the embodiment of the application is improved.
The embodiment of the application also provides a data processing device, which comprises:
the receiving module is used for receiving gateway configuration parameters, wherein the gateway configuration parameters comprise data input configuration parameters and data output configuration parameters;
The starting module is used for starting an input interface corresponding to a target input protocol according to the data input configuration parameter and starting an output interface corresponding to a target output protocol according to the data output configuration parameter;
the analysis module is used for acquiring the data to be processed, which is transmitted from the input interface, calling an input protocol plug-in corresponding to the target input protocol according to the data input configuration parameters, and analyzing the data to be processed to obtain analyzed data;
and the output module is used for calling an output protocol plug-in corresponding to the target output protocol according to the data output configuration parameters, packaging the analyzed data and sending the data through the output interface.
In the implementation process, a user can start corresponding input interfaces and output interfaces according to actual needs, such as different industrial scenes, so as to perform corresponding data processing, so that the gateway has universality, can be suitable for different industrial scenes, improves the adaptability of the gateway equipment to a certain extent, and meets the more and more complex and changeable industrial needs to a certain extent.
The embodiment of the application also provides a gateway, which comprises: a plurality of input interfaces, a plurality of output interfaces, a processor, a memory, and a communication bus;
The communication bus is used for realizing connection communication among the input interface, the output interface, the processor and the memory;
the processor is configured to execute one or more programs stored in the memory to implement any of the data processing methods described above.
In the implementation process, the gateway has universality, and a user can start corresponding input interfaces and output interfaces according to actual needs, such as different industrial scenes, so as to perform corresponding data processing, so that the gateway has universality, can be suitable for different industrial scenes, improves the adaptability of gateway equipment to a certain extent, and meets the more and more complex and changeable industrial needs to a certain extent.
Further, the gateway also comprises a LoRa wireless module; the LoRa wireless module is in communication connection with the processor; the LoRa wireless module is used for receiving data to be processed, and sending the data to the processor for analysis and repackaging; the LoRa wireless module is also used for receiving the data sent by the processor and sending the data to a destination address of the data.
In the implementation process, the gateway is internally provided with the LoRa wireless module, so that wireless acquisition of data is realized through the LoRa wireless module, and complexity and cost of industrial field wiring are reduced.
Further, a database is arranged in the gateway; the database is connected with the processor and used for storing the data obtained by repackaging the processor.
In the implementation process, the gateway can realize the persistent storage of the data, so that the recoverability of the data is enhanced to a certain extent, and the risk of difficult recovery after the data is lost is reduced.
There is also provided in an embodiment of the present application a readable storage medium storing one or more programs executable by one or more processors to implement any one of the above-described data processing methods.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of a gateway according to an embodiment of the present application;
Fig. 2 is a schematic flow chart of a data processing method according to an embodiment of the present application;
fig. 3 is a schematic diagram of an external structure of a gateway according to an embodiment of the present application;
fig. 4 is a schematic diagram of an internal structure of a gateway according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a data processing apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
Embodiment one:
in order to meet the requirements of industrial development and meet the current and more variable gateway use requirements, a gateway and a corresponding method for adapting the gateway are provided in the embodiments of the present application. Referring to fig. 1, fig. 1 is a schematic structural diagram of a gateway provided in an embodiment of the present application.
In the embodiment of the present application, the gateway has a plurality of input interfaces 101 and a plurality of output interfaces 102. For example, a USB (Universal Serial Bus ) interface, an RS232 interface, an RS485 interface, an Audio interface, a network interface, an HDMI (High-Definition Multimedia Interface, high definition multimedia interface) interface, a VGA (Video Graphics Array ) interface, and the like may be included. It should be appreciated that for most interfaces, they may be used as both an input and an output, such as a USB interface, a portal, etc. The input interface 101 in the embodiment of the present application refers to an interface for inputting data when in use; correspondingly, the output interface 102 refers to an interface for output when in use. The gateway having a plurality of input interfaces 101 and a plurality of output interfaces 102 means that it has a plurality of interfaces that can be used for data input and a plurality of interfaces that can be used for data output.
In the embodiment of the present application, the gateway further has a processor 103 and a memory 104, and the processor 103 and the memory 104 are connected through a communication bus 105. In the embodiment of the present application, the memory 104 may store a corresponding program, and the processor 103 may implement, by executing the corresponding program stored in the memory 104, a corresponding method adapted by the gateway to be proposed in the embodiment of the present application.
The corresponding method for adapting the gateway provided in the embodiment of the present application includes a data processing method, which is used for implementing the use of the gateway. As can be seen in fig. 2, includes:
s201: receiving gateway configuration parameters;
it should be noted that, the gateway configuration parameters described in the embodiments of the present application include a data input configuration parameter and a data output configuration parameter. Wherein:
the data input configuration parameters are parameters required by the input interface to be started, which are selected by a user according to the current requirement, and the input interface to be started is input. The data input configuration parameters may include the model number of the device to which the input interface is to be connected, the name or interface identifier of the input interface, the protocol to be used, the IP address of the device to be connected, etc.
The data output configuration parameters are parameters required by the input interface which is required to be started and is selected by a user according to the current requirement, and the input interface is started and output. The data output configuration parameters may include the model number of the device to which the output interface is to be connected, the name or interface identifier of the output interface, the protocol to be used, the IP address of the device to be connected, etc.
In the embodiment of the application, the user can select the input interface and the output interface to be started according to the current requirement, and then input corresponding data input configuration parameters and data output configuration parameters.
S202: enabling an input interface corresponding to the target input protocol according to the data input configuration parameters, and enabling an output interface corresponding to the target output protocol according to the data output configuration parameters.
It should be understood that the configuration of the input interface and the output interface may be regarded as a configuration of channels. When configuring parameters, a user can implement configuration through external equipment (such as a computer and the like). For example, the user may connect the computer with the network management via the network cable, open the browser, input the gateway IP (Internet Protocol, protocol interconnected between networks) address, and enter the configuration interface to perform parameter configuration. The parameters configured include: the input interface or the output interface corresponds to the model of the equipment to be connected, the name or the interface identifier of the configured input interface or output interface, the protocol adopted by the input interface or the output interface, the IP address of the equipment to be connected by the input interface or the output interface, and the like. After the configuration is finished, the communication connection is established between the gateway and the equipment to be connected through the configured input interface or output interface, and the gateway can perform data interaction with the connected equipment.
S203: and acquiring the data to be processed, which is transmitted from the input interface, calling an input protocol plug-in corresponding to the target input protocol according to the data input configuration parameters, and analyzing the data to be processed to obtain analyzed data.
In this embodiment of the present application, an engineer may install in advance a plug-in corresponding to each protocol related to each input interface (i.e., an input protocol plug-in) in the gateway, and different input protocol plug-ins may parse encapsulated data using different protocols. For example, a ModBus input protocol plug-in may parse data encapsulated with the ModBus protocol, while an OPC-UA (Object Linking and Embedding for Process Control Unified Architecture, object connection and embedded unified architecture for process control) input protocol plug-in may parse data encapsulated with the OPC-UA protocol.
It should be noted that, in this embodiment of the present application, a correspondence between each input protocol plug-in and a protocol identifier of each protocol may be configured, and the data input configuration parameter includes a first protocol identifier corresponding to a target input protocol, so that according to the first protocol identifier, the input protocol plug-in corresponding to the first protocol identifier may be invoked from a preset input protocol plug-in set.
In the embodiment of the application, in order to realize analysis of the data to be processed, the input protocol plug-in may be instantiated as a data analysis object, and then the input protocol analysis parameters of the data to be processed are collected through the data analysis object, and the data to be processed is analyzed according to the input protocol analysis parameters, so as to obtain analyzed data. For example: the plug-in of ModBus RTU (REMOTE TERMINAL UNIT, remote measurement and control terminal) can obtain input protocol analysis parameters such as serial number, baud rate, data bit number, verification mode, stop bit number, function code, equipment ID, equipment start address, data length and the like through an object, and then analyze data to be processed according to the parameters to obtain analyzed data.
S204: and calling an output protocol plug-in corresponding to the target output protocol according to the data output configuration parameters, packaging the analyzed data, and sending the data through an output interface.
Correspondingly, in the embodiment of the application, the corresponding relation between each output protocol plug-in and the protocol identifier of each protocol can be configured. The data output configuration parameter includes a second protocol identifier corresponding to the target input protocol, and further, according to the second protocol identifier, an input protocol plug-in corresponding to the second protocol identifier can be called from a preset output protocol plug-in set.
Accordingly, in the embodiment of the present application, in order to implement encapsulation of parsed data, the output protocol plug-in may be instantiated as a data output object, and output protocol parameters are configured for the parsed data through the data output object, so as to obtain encapsulated data corresponding to the target output protocol, and then the encapsulated data is sent through the output interface according to rules of the target output protocol through the data output object.
It should be noted that in practical applications, it may be necessary for the gateway to have access to multiple input devices at the same time, or to have access to multiple output devices at the same time. At this time, the user needs to configure a plurality of input interfaces, or a plurality of output interfaces.
If a plurality of input devices are accessed at the same time, the data input configuration parameters corresponding to the input interfaces of the data to be processed can be received, and the input protocol plug-in corresponding to the data input configuration parameters is selected from the preset input protocol plug-in set to analyze the data to be processed.
Similarly, if multiple output devices are simultaneously connected, a required output interface may be determined according to a destination address of the data to be processed (i.e., an IP address of the device to be connected configured in the above example), and then, with a data output configuration parameter corresponding to the determined output interface, an output protocol plug-in corresponding to the data output configuration parameter is selected from preset output protocol plug-ins to encapsulate the parsed data, and the repackaged data to be processed is sent through the determined output interface.
In an exemplary possible implementation manner, in which the configuration parameters include protocol identifiers, matching may be performed in the data output configuration parameters of each output interface that is currently enabled according to the destination address in the data to be processed, so as to determine the required output interface, and further determine the protocol identifier in the data output configuration parameters of the output interface, and select an output protocol plug-in corresponding to the protocol identifier from preset output protocol plug-ins to implement encapsulation of the parsed data to be processed.
It should be understood that, when multiple input devices are simultaneously accessed (i.e. multiple input interfaces are currently enabled), in a feasible implementation manner of the embodiment of the present application, the input interfaces that receive the data to be processed may not be determined first, but a polling manner is adopted, and for each currently enabled input interface, the input protocol plugins corresponding to the data input configuration parameters of each input interface are invoked one by one to parse the data to be processed, and if a certain input protocol plugin is parsed successfully, the input protocol plugin is confirmed to be the input protocol plugin in the current use process.
In an exemplary possible implementation manner, in which the configuration parameters include protocol identifiers, it is assumed that there are three input interfaces A, B, C that are currently enabled, the protocol identifier in the first configuration information of the interface a is A1, the protocol identifier in the first configuration information of the interface B is B1, the protocol identifier in the first configuration information of the interface C is B1, the interface C is set to data to be processed (the protocol used by the data to be processed is B1 because the interface C receives the data), when polling, the first configuration information of the interface a is used to find the data to be processed corresponding to the interface a first, at this time, the analysis fails, the first configuration information of the interface B is called to find the data to be processed corresponding to the interface B1, at this time, the analysis is successful, the input protocol plug-in is marked as the input protocol plug-in the current use process of the interface C, and the data received by the interface C is limited to be analyzed by the input protocol plug-in.
Similarly, when multiple output devices are simultaneously accessed (i.e., multiple output interfaces are currently enabled), in a feasible implementation manner of the embodiment of the application, a polling mode may be adopted instead of determining the required output interfaces, and for each currently enabled output interface, an output protocol plug-in corresponding to a data output configuration parameter of each output interface is called one by one to repackage the parsed data, and an attempt is made to send the parsed data to a destination address of the data to be processed. And if the transmission fails, calling an output protocol plug-in corresponding to the data output configuration parameter of the next output interface to repackage the analyzed data, and attempting to transmit the data to the destination address of the data to be processed until the transmission is successful.
It should be noted that, in the embodiment of the present application, the user may not need to set the protocol identifier in the input data input configuration parameter and/or the data output configuration parameter when performing the interface configuration. The protocols that the interfaces should adapt to may be predefined in the gateway. In this way, when the data to be processed is received, an input interface for receiving the data to be processed can be obtained according to the source address information (i.e. the IP address of the device to be connected configured in the above example) in the data to be processed, and then a corresponding input protocol plug-in is found according to a predefined protocol of the interface.
It should be understood that, for some interfaces, data interaction may be allowed through multiple protocols, and then there are multiple protocols corresponding to the interface defined in the gateway in advance at this time, but in practical application, only one protocol is used. In order to determine which protocol is specifically used, in the embodiment of the present application, after determining the input interface for receiving the data to be processed, a polling mode may be adopted to acquire the input protocol plugins corresponding to the input interface one by one to parse the data to be processed, and if a certain input protocol plugin is successfully parsed, the input protocol plugin is confirmed to be the input protocol plugin in the current use process.
Similarly, for the output interface, after determining the required output interface according to the destination address of the data to be processed, the output protocol plug-ins corresponding to the output interface can be acquired one by one in a polling manner to encapsulate the parsed data and send the encapsulated data to the target device (i.e. the device with the destination address). If the feedback of the target equipment cannot be identified, the next output protocol plug-in corresponding to the output interface is adopted to package the analyzed data again, and the analyzed data is sent to the target equipment until the target equipment can be identified. And taking the output protocol plug-in which can be identified by the target equipment after repackaging as the output protocol plug-in the current use process.
It should be further noted that, in the embodiment of the present application, when a plurality of output interfaces are currently enabled, the number of target input protocols is plural, and at this time, attribute information of the acquired device corresponding to each target input protocol in the plurality of target input protocols may also be acquired, so that a dedicated memory resource for data acquisition is configured for each target input protocol in the plurality of target input protocols according to the attribute information of each acquired device.
In the embodiment of the present application, the attribute information of the collected device includes at least one of the following: the number of the collected measuring points, the data transmission mode, the data collection frequency, the data length and the like. For example, a certain large-scale device has 500 (more) acquisition stations, the data transmission mode is ethernet (fast), the acquisition frequency is 1 second (high frequency), and the data length is 50 bytes (large data), so that a large memory and a large buffer memory need to be allocated to the large-scale device to meet the acquisition requirement of high-speed large data volume. In the embodiment of the application, a corresponding evaluation standard can be set, for example, a comprehensive score of the acquired equipment can be calculated according to a preset formula according to the number of the acquired measuring points, the data transmission mode, the data acquisition frequency and the data length, and then the memory and the cache corresponding to the comprehensive score are allocated to the acquired equipment according to the comprehensive score.
It should also be noted that the acquisition measurement points described in the embodiments of the present application are data storage units on the acquired device. The user can configure the attribute of each acquisition measuring point in the gateway, wherein the attribute of each acquisition measuring point comprises a measuring point name, a data storage address, a data storage type, a data acquisition frequency and the like, so that the gateway can acquire correct data according to the attribute of each acquisition measuring point.
In this embodiment of the present application, the data analysis object instantiated by the foregoing input protocol plug-in may be an object with a three-layer structure formed by a collection channel, a collection group, and a collection measurement point, where the collection channel is a device to be collected, and the collection measurement points with the same or similar characteristics form the collection group, so as to obtain the data analysis object of the collection channel, the collection group, and the collection measurement point. And acquiring the input protocol analysis parameters according to the attribute information of the acquired equipment in the data analysis object and the attribute information of each acquisition measuring point.
In addition, in the embodiment of the present application, a data center may be set in the gateway, and after the data to be processed is collected and parsed, the parsed data may be stored in a data buffer queue. The data center can periodically obtain the parsed data from the data cache queue for encapsulation according to the configured output mode.
It should be understood that there are various ways to output data from the gateway, for example, output data to a file, a database, a public cloud platform or a private cloud platform, each output way has different output rules, and the required output interfaces may also be different. The output mode can be synchronously configured when the gateway configuration parameters are configured.
For example, if the configured output mode is database storage, the output to the file may be to periodically obtain the parsed data from the data cache queue for encapsulation, and establish a database and a data table according to the data structure of the encapsulated data, and then store the encapsulated data according to the database mode; if the output mode is a public cloud platform, the protocol is an MQTT (Message Queuing Telemetry Transport, message queue telemetry transport) protocol, and the MQTT is a message publishing/subscribing-based protocol, then the output rule may be to periodically obtain parsed data from the data cache queue for encapsulation, and publish the encapsulated data to the network in a message format, so that the subscribers can obtain the data when the communication is normal.
In addition, in a possible implementation manner of the embodiment of the present application, if an output manner is not configured, collected data temporarily placed in a data buffer queue may be directly deleted, so as to save data buffer resources.
It should be understood that in a practical application environment, there may be more lines, which are inconvenient to be laid. In order to solve the problem, in the embodiment of the application, the gateway can be internally provided with the LoRa wireless module, so that wireless acquisition of data is realized through the LoRa wireless module, and complexity and cost of industrial field wiring are reduced.
In addition, in order to improve the data recoverability, a database can be arranged in the gateway to meet the practical requirement of increasing complexity, and the data obtained by repackaging the processor can be stored in the database, so that the data can be quickly retransmitted when lost occurs in the data transmission process. Of course, in order to cope with the increasingly complex actual demands, other corresponding services may be configured in the gateway in the embodiment of the present application.
It will be appreciated that the foregoing gateway structure is merely illustrative and that the gateway may include more or fewer components. For example, the gateway may also include an antenna, a power interface, and the like.
In addition, the present embodiment also provides a readable storage medium, such as a floppy disk, an optical disk, a hard disk, a flash memory, a usb disk, an SD (Secure Digital Memory Card, secure digital Card) Card, an MMC (Multimedia Card) Card, or the like, in which one or more programs implementing the steps of fig. 2 are stored, and the one or more programs may be executed by one or more processors to implement the steps. And will not be described in detail herein.
In summary, according to the scheme provided by the embodiment of the application, a user can input relevant gateway configuration parameters according to actual needs, and enable a required input interface and an output interface, so that the gateway can acquire data to be processed, which are transmitted from the input interface, call an input protocol plug-in corresponding to a target input protocol according to the data input configuration parameters, parse the data to be processed to obtain parsed data, call an output protocol plug-in corresponding to the target output protocol according to the data output configuration parameters, package the parsed data, and transmit the parsed data through the output interface. In this way, the user can start corresponding input interfaces and output interfaces according to actual needs, such as different industrial scenes, and further perform corresponding data processing, so that the gateway has universality, can be suitable for different industrial scenes, improves the adaptability of the gateway equipment to a certain extent, and meets the more and more complex and changeable industrial needs to a certain extent.
Embodiment two:
the embodiment takes a more specific data acquisition gateway as an example on the basis of the first embodiment, and further illustrates the application.
Referring to the gateway structure shown in fig. 3, the gateway provides a power button 31, a usb interface 32, an rs232 interface 33, an audio interface 34, a network port 35, an hdmi interface 36, a vga interface 37, a power interface 38, and a wireless LoRa module with an antenna 39.
The gateway internal structure may be as described with reference to fig. 4, with the processor implementing an operating system and gateway application services carried on the operating system. The processor is connected to a memory (memory and a hard disk), where the memory may store a corresponding program (e.g., a program implementing the scheme of fig. 2 in the first embodiment) for execution by the processor, and the hard disk may be used to implement the database.
In the embodiment of the application, the data interface of the industrial equipment is commonly an RS232 interface, a network port and a USB interface, so that the product can support data acquisition. And because the LoRa wireless acquisition module is arranged in the wireless communication system, the data interaction with the field device can be realized through the LoRa wireless technology, and the cost and complexity of industrial field wiring are reduced.
In this embodiment of the present application, the gateway may collect data of various devices such as a device using ModBus protocol, a device using OPC protocol, a PLC (Programmable Logic Controller ), a CNC (Computerized Numerical Control, numerical control machine tool) through a USB interface, an RS232 interface, and a network port. And after analyzing and repackaging the collected data, the data is sent to corresponding target equipment or service. For example, it may be sent to a file service (e.g., stored in a file local to the gateway), to a database (e.g., stored in a database local to the gateway), to an application on a network such as an octoot Cloud (a Cloud platform), kafka (a streaming platform), MQTT (Message Queuing Telemetry Transport, message queue telemetry transport) application, etc.
It should be noted that, in the embodiment of the present application, an input protocol plug-in of a protocol that can be used by each input interface and an output protocol plug-in of a protocol that can be used by each output interface are preset in the gateway. And calling the corresponding input protocol plug-in and the corresponding output protocol plug-in is realized through configuration parameters configured by a user. Specifically, the user can connect the computer with the network management by using the network cable, open the browser to input the gateway IP (Internet Protocol, the protocol interconnected between networks) address, and enter the configuration interface to perform parameter configuration. The parameters configured include: the gateway can realize data interaction with the equipment through the configured input interface or output interface by establishing communication connection with the equipment to be connected through the configured input interface or output interface after the configuration is finished.
It should be noted that, in the embodiment of the present application, attribute information of the collected device connected to each enabled input interface is also obtained, including the number of collected measurement points, a data transmission mode, a data collection frequency, a data length, and the like, so that a dedicated memory resource for data collection is allocated to the collected device.
In addition, attribute information of each acquisition measuring point in the acquired equipment is acquired, wherein the attribute information comprises a measuring point name, a data storage address, a data storage type, a data acquisition frequency and the like. The gateway can collect the data to be processed from each collecting measuring point according to the attribute information of each collecting measuring point.
In addition, in the embodiment of the present application, an output manner may be configured, for example, output to a file, a database, a public cloud platform or a private cloud platform, etc.
In the embodiment of the application, after data to be processed is acquired through a certain input interface, a data analysis object with a three-layer structure formed by an acquisition channel, an acquisition group and an acquisition measuring point can be constructed, input protocol analysis parameters of the data to be processed are acquired through the data analysis object, and the data to be processed is analyzed according to the input protocol analysis parameters, so that analyzed data are obtained.
In this embodiment of the present application, after the parsed data is obtained, the parsed data may be stored in a data buffer queue, and according to a configured output manner, the parsed data is periodically obtained from the data buffer queue and packaged. During packaging, an input protocol plug-in can be determined according to a second protocol identifier set in the output configuration parameters, the output protocol plug-in is instantiated to be a data output object, the output protocol parameters are configured for the analyzed data through the data output object, so that packaging data corresponding to a target output protocol is obtained, and the packaging data is sent through an output interface according to rules of the target output protocol through the data output object.
Through the scheme, on hardware, the interface of the gateway basically covers the acquisition requirements of all devices, and has better universality. In software, when in use, the gateway can automatically call the corresponding input protocol plug-in and output protocol plug-in to correctly process data input and output only by carrying out parameter configuration on the input interface and the output interface. The gateway can meet the requirements of clients of different grades, and the reliability of the system is improved; for lightweight requirements, system costs can be reduced.
Embodiment III:
based on the same inventive concept, a data processing apparatus 500 is also provided in the embodiments of the present application. Referring to fig. 5, fig. 5 shows a data processing apparatus corresponding to the method shown in fig. 2 one by one. It should be appreciated that the specific functions of the apparatus 500 may be found in the above description, and detailed descriptions are omitted here as appropriate to avoid repetition. The device 500 includes at least one software functional module that can be stored in memory in the form of software or firmware or cured in the operating system of the device 500. Specifically:
referring to fig. 5, the apparatus 500 includes:
a receiving module 501, configured to receive gateway configuration parameters, where the gateway configuration parameters include a data input configuration parameter and a data output configuration parameter;
An enabling module 502, configured to enable an input interface corresponding to a target input protocol according to a data input configuration parameter, and enable an output interface corresponding to a target output protocol according to a data output configuration parameter;
the parsing module 503 is configured to obtain data to be processed, which is transmitted from the input interface, call an input protocol plug-in corresponding to the target input protocol according to the data input configuration parameter, and parse the data to be processed to obtain parsed data;
and the output module 504 is configured to invoke an output protocol plug-in corresponding to the target output protocol according to the data output configuration parameter, encapsulate the parsed data, and send the parsed data through the output interface.
In one possible implementation of the embodiments of the present application, the data input configuration parameters include: a first protocol identification corresponding to the target input protocol. The parsing module 503 is specifically configured to call, from a preset set of input protocol plugins, an input protocol plugin corresponding to the first protocol identifier according to the first protocol identifier.
In one possible implementation manner of the embodiment of the present application, the parsing module 503 is specifically configured to instantiate an input protocol plugin as a data parsing object; and acquiring the input protocol analysis parameters of the data to be processed through the data analysis object, and analyzing the data to be processed according to the input protocol analysis parameters to obtain analyzed data.
In one possible implementation of the embodiment of the present application, the data output configuration parameters include: a second protocol identifier corresponding to the target output protocol; the parsing module 503 is specifically configured to extract, according to the second protocol identifier, an output protocol plug-in corresponding to the second protocol identifier from a preset output protocol plug-in set.
In one possible implementation manner of the embodiment of the present application, the output module 504 is specifically configured to instantiate an output protocol plug-in as a data output object, and configure output protocol parameters for the parsed data through the data output object to obtain encapsulated data corresponding to a target output protocol; and sending the encapsulated data through the data output object according to the rule of the target output protocol through the output interface.
In one possible implementation of the embodiments of the present application, the target input protocol is multiple. And referring to fig. 6, the apparatus 500 further includes a configuration module 505. The configuration module 505 is configured to obtain attribute information of the collected device corresponding to each of the plurality of target input protocols, where the attribute information at least includes one of the following: the method comprises the steps of collecting the number of measuring points, data transmission mode, data collection frequency and data length; and configuring special memory resources for data acquisition for each target input protocol in the plurality of target input protocols according to the attribute information.
In one possible implementation of the embodiment of the present application, the parsing module 503 is further configured to store parsed data into a data cache queue, so as to implement persistence of the parsed data; the output module 504 is specifically configured to periodically encapsulate the parsed data obtained from the data cache queue.
It should be understood that, for simplicity of description, the descriptions in the first embodiment are omitted in this embodiment.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
Further, the units described as separate units may or may not be physically separate, and units displayed as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Furthermore, functional modules in various embodiments of the present application may be integrated together to form a single portion, or each module may exist alone, or multiple modules may be integrated to form a single portion.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
Herein, a plurality refers to two or more.
The foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application, and various modifications and variations may be suggested to one skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims (12)

1. A data processing method, applied to a gateway, the method comprising:
receiving gateway configuration parameters, wherein the gateway configuration parameters comprise data input configuration parameters and data output configuration parameters;
enabling an input interface corresponding to a target input protocol according to the data input configuration parameters, and enabling an output interface corresponding to a target output protocol according to the data output configuration parameters;
Acquiring data to be processed which is transmitted from the input interface, calling an input protocol plug-in corresponding to the target input protocol according to the data input configuration parameters, and analyzing the data to be processed to obtain analyzed data;
and calling an output protocol plug-in corresponding to the target output protocol according to the data output configuration parameters, packaging the parsed data, and sending the parsed data through the output interface.
2. The data processing method of claim 1, wherein the data input configuration parameters comprise: a first protocol identification corresponding to the target input protocol;
the calling the input protocol plugin corresponding to the target input protocol according to the data input configuration parameter comprises the following steps:
and calling the input protocol plugin corresponding to the first protocol identifier from a preset input protocol plugin set according to the first protocol identifier.
3. The data processing method according to claim 1, wherein the calling the input protocol plug-in corresponding to the target input protocol according to the data input configuration parameter parses the data to be processed to obtain parsed data, includes:
Instantiating the input protocol plugin as a data parsing object;
and acquiring input protocol analysis parameters of the data to be processed through the data analysis object, and analyzing the data to be processed according to the input protocol analysis parameters to obtain the analyzed data.
4. The data processing method of claim 1, wherein the data output configuration parameters include: a second protocol identifier corresponding to the target output protocol;
the calling the output protocol plug-in corresponding to the target output protocol according to the data output configuration parameter comprises the following steps:
and extracting the output protocol plug-in corresponding to the second protocol identifier from a preset output protocol plug-in set according to the second protocol identifier.
5. The data processing method of claim 1, wherein encapsulating the parsed data comprises:
instantiates the output protocol plug-in as a data output object,
configuring output protocol parameters for the parsed data through the data output object to obtain packaging data corresponding to the target output protocol;
the transmitting through the output interface includes:
And sending the encapsulated data through the data output object according to the rule of the target output protocol through the output interface.
6. The data processing method of claim 1, wherein the target input protocol is a plurality, the method further comprising:
acquiring attribute information of the acquired equipment corresponding to each target input protocol in the plurality of target input protocols, wherein the attribute information at least comprises one of the following: the method comprises the steps of collecting the number of measuring points, data transmission mode, data collection frequency and data length;
and configuring special memory resources for data acquisition for each target input protocol in the plurality of target input protocols according to the attribute information.
7. A data processing method according to any one of claims 1 to 6, wherein the method further comprises:
storing the parsed data into a data cache queue to implement persistence of the parsed data;
the encapsulating of the parsed data includes:
and periodically acquiring the parsed data from the data cache queue for encapsulation.
8. A data processing apparatus for use with a gateway, the apparatus comprising:
The receiving module is used for receiving gateway configuration parameters, wherein the gateway configuration parameters comprise data input configuration parameters and data output configuration parameters;
the starting module is used for starting an input interface corresponding to a target input protocol according to the data input configuration parameter and starting an output interface corresponding to a target output protocol according to the data output configuration parameter;
the analysis module is used for acquiring the data to be processed, which is transmitted from the input interface, calling an input protocol plug-in corresponding to the target input protocol according to the data input configuration parameters, and analyzing the data to be processed to obtain analyzed data;
and the output module is used for calling an output protocol plug-in corresponding to the target output protocol according to the data output configuration parameters, packaging the analyzed data and sending the data through the output interface.
9. A gateway, comprising: a plurality of input interfaces, a plurality of output interfaces, a processor, a memory, and a communication bus;
the communication bus is used for realizing connection communication among the input interface, the output interface, the processor and the memory;
the processor is configured to execute one or more programs stored in the memory to implement the data processing method according to any one of claims 1-7.
10. The gateway of claim 9, further comprising a LoRa wireless module; the LoRa wireless module is in communication connection with the processor;
the LoRa wireless module is used for receiving data to be processed, and sending the data to the processor for analysis and repackaging; the LoRa wireless module is also used for receiving the data sent by the processor and sending the data to a destination address of the data.
11. The gateway of claim 9, wherein a database is provided within the gateway; the database is connected with the processor and used for storing the data obtained by repackaging the processor.
12. A readable storage medium storing one or more programs executable by one or more processors to implement the data processing method of any of claims 1-7.
CN202010058251.0A 2020-01-17 2020-01-17 Data processing method, device, gateway and readable storage medium Active CN111294235B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010058251.0A CN111294235B (en) 2020-01-17 2020-01-17 Data processing method, device, gateway and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010058251.0A CN111294235B (en) 2020-01-17 2020-01-17 Data processing method, device, gateway and readable storage medium

Publications (2)

Publication Number Publication Date
CN111294235A CN111294235A (en) 2020-06-16
CN111294235B true CN111294235B (en) 2023-05-02

Family

ID=71024249

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010058251.0A Active CN111294235B (en) 2020-01-17 2020-01-17 Data processing method, device, gateway and readable storage medium

Country Status (1)

Country Link
CN (1) CN111294235B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112637589A (en) * 2020-07-31 2021-04-09 西安诺瓦星云科技股份有限公司 Data processing method and device and video processing equipment
CN112087454B (en) * 2020-09-10 2021-08-31 上海顺舟智能科技股份有限公司 Communication method, device, equipment and storage medium of Internet of things gateway equipment
CN112073420B (en) * 2020-09-11 2023-07-04 杭州安恒信息技术股份有限公司 A network protocol analysis method, device and related equipment
CN114974525B (en) * 2021-02-22 2025-10-03 深圳中科智耘科技有限公司 Medical health data management method and front-end equipment
CN113783893A (en) * 2021-09-29 2021-12-10 远景智能国际私人投资有限公司 Data transmission method, device and system
CN116566969B (en) * 2022-11-30 2025-08-15 杭州和利时自动化有限公司 Protocol downloading method, device, equipment and storage medium
CN116346949B (en) * 2023-05-29 2023-10-03 瞳见科技有限公司 Method, system and device for constructing protocol conversion rule chain

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7266726B1 (en) * 2003-11-24 2007-09-04 Time Warner Cable Inc. Methods and apparatus for event logging in an information network
CN101588548A (en) * 2008-05-22 2009-11-25 华为技术有限公司 Method and system for accessing communication data and access gateway
CN104144156B (en) * 2013-05-10 2018-09-21 华为技术有限公司 Message processing method and device
CN107888488A (en) * 2016-09-30 2018-04-06 西门子(中国)有限公司 Intelligent gateway and its method
CN106557447A (en) * 2016-11-29 2017-04-05 中国电子科技集团公司第二十九研究所 A kind of general purpose interface bus conversion and pretreatment unit
CN108092884A (en) * 2017-11-23 2018-05-29 南京邮电大学 A kind of wireless access gateway system and application process

Also Published As

Publication number Publication date
CN111294235A (en) 2020-06-16

Similar Documents

Publication Publication Date Title
CN111294235B (en) Data processing method, device, gateway and readable storage medium
CN110022289B (en) Data transmission method, device and system
CN111427335A (en) Vehicle remote diagnosis method, equipment connector and vehicle connector
EP2429150A1 (en) Apparatus, web service component and method based on web service
CN109861998B (en) Plug-in type dynamic analysis system and method based on Beidou short message protocol
CN111464419A (en) A data transmission control method based on bus network communication
CN113867732A (en) Message information processing method, system and storage medium
CN111552268A (en) Vehicle remote diagnosis method, equipment connector and vehicle connector
CN117041370A (en) Communication method and system
CN116545932A (en) Network card message transmission method, device, computer equipment and storage medium
CN107368334B (en) Business plug-in interaction system and method
CN102143070B (en) Remote traffic acquisition method, device and system
CN110932393B (en) Substation information protection master station system and data initialization method thereof
CN103220188B (en) A kind of HTTP data acquisition equipment
CN115277450A (en) OPNET-based virtual reality combined heterogeneous communication network fusion system and application
CN115460258A (en) Industrial equipment data acquisition control system and method
CN119276896A (en) Medical Internet of Things data processing system and method based on edge container
CN102404202A (en) Power grid data processing method and device
CN105245579A (en) A method and system for processing massive data communication in distribution network system
CN102075529B (en) Open building automatic control network protocol conversion device and method
CN112565041B (en) Hardware information configuration method, device and medium of FF field bus system
CN115633102A (en) Multi-type protocol message processing system, method and readable storage medium
CN118250746A (en) Data message unpacking and packaging method and device
CN114827188B (en) Platform equipment management method, system, terminal and storage medium
CN112383924B (en) Base station equipment management method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载