CN111294235A - 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
CN111294235A
CN111294235A CN202010058251.0A CN202010058251A CN111294235A CN 111294235 A CN111294235 A CN 111294235A CN 202010058251 A CN202010058251 A CN 202010058251A CN 111294235 A CN111294235 A CN 111294235A
Authority
CN
China
Prior art keywords
data
protocol
output
input
configuration parameters
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.)
Granted
Application number
CN202010058251.0A
Other languages
Chinese (zh)
Other versions
CN111294235B (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

Abstract

The application provides a data processing method, a device, a gateway and a readable storage medium, which start an input interface corresponding to a target input protocol according to a data input configuration parameter by receiving a gateway configuration parameter, and start an output interface corresponding to a target output protocol according to a data output configuration parameter. And then acquiring data to be processed transmitted from the input interface, calling an input protocol plug-in corresponding to a 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 a target output protocol according to the data output configuration parameters, packaging the analyzed data, and transmitting the packaged data through the output interface. Therefore, a user can start the corresponding input interface and the corresponding output interface to perform corresponding data processing according to actual needs, such as different industrial scenes, so that the gateway has universality and meets more and more complex and changeable industrial requirements to a certain extent.

Description

Data processing method, device, gateway and readable storage medium
Technical Field
The application relates to the technical field of internet of things, in particular to a data processing method, a data processing 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 provided. The gateway acts as a "translator" in the network, which plays an important role in ensuring efficient interaction of data between different devices. At present, more and more industrial equipment is used, and when the gateway is used, the requirements to be met are more and more changeable, and the existing gateway cannot meet the changeable requirements.
Disclosure of Invention
An object of the embodiments of the present application is to provide a data processing method, an apparatus, a gateway, and a readable storage medium, so as to solve the problem that an existing gateway cannot meet 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 to-be-processed data 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 to-be-processed data 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 analyzed data, and sending the data through the output interface.
In practical applications, the gateway may be integrated with a plurality of input interfaces and a plurality of output interfaces. In the embodiment of the application, the gateway configuration parameter may be received, the input interface corresponding to the target input protocol is enabled according to the data input configuration parameter, and the output interface corresponding to the target output protocol is enabled according to the data output configuration parameter. And then acquiring data to be processed transmitted from the input interface, calling an input protocol plug-in corresponding to a 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 a target output protocol according to the data output configuration parameters, packaging the analyzed data, and transmitting the packaged data through the output interface. Therefore, the user can start the corresponding input interface and the output interface 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 gateway equipment to a certain extent, and meets more and more complex and changeable industrial requirements to a certain extent.
Further, the data input configuration parameters include: a first protocol identification corresponding to the target input protocol; the invoking of the input protocol plug-in corresponding to the target input protocol according to the data input configuration parameter includes: and calling the input protocol plug-ins corresponding to the protocol identifications from a preset input protocol plug-in set according to the first protocol identifications.
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 invoking an input protocol plug-in 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 plug-in as a data parsing object; and acquiring an input protocol analysis parameter of the data to be processed through the data analysis object, and analyzing the data to be processed according to the input protocol analysis parameter to obtain the analyzed data.
In the implementation process, the input protocol plug-in is instantiated into the data analysis object, the input protocol analysis parameters of the data to be processed are collected through the data analysis object, the data to be processed are analyzed according to the input protocol analysis parameters, analyzed data are obtained, analysis of the data to be processed is effectively achieved, and reliability of the scheme provided by the embodiment of the application is improved.
Further, the data output configuration parameters include: a second protocol identification corresponding to the target output protocol; the calling of the output protocol plug-in corresponding to the target output protocol according to the data output configuration parameters comprises: and according to the second protocol identifier, extracting the output protocol plug-ins corresponding to the protocol identifier from the preset output protocol plug-in set.
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 analyzed data through the data output object to obtain encapsulated data corresponding to the target output protocol; the sending through the output interface includes: and sending the encapsulated data through the data output object through the output interface according to the rule of the target output protocol.
In the implementation process, the output protocol plug-in is instantiated to be a data output object, then the data output object configures output protocol parameters for the analyzed data to obtain encapsulated data, and then the encapsulated data is sent through the output interface according to the rule of the target output protocol, so that the encapsulation 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 multiple, and the method further includes: acquiring attribute information of 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 items: acquiring the number of measuring points, a data transmission mode, data acquisition frequency and data length; and configuring a special memory resource 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 acquired device corresponding to each target input protocol is acquired, and then the dedicated memory resource for data acquisition is configured for each target input protocol, so that each target input protocol has the dedicated memory resource to perform data acquisition, and the reliability of the scheme provided by the embodiment of the application is improved.
Further, the method further comprises: storing the analyzed data into a data cache queue to realize persistence of the analyzed data; the encapsulating the parsed data comprises: and periodically acquiring the analyzed data from the data cache queue for packaging.
In the implementation process, the analyzed data is stored in the data cache queue to achieve persistence of the analyzed data, and the analyzed data is obtained from the data cache queue periodically and is packaged, so that the analyzed data can be packaged and sent to corresponding target equipment, and reliability of the scheme provided by the embodiment of the application is improved.
An embodiment of the present application further provides a data processing apparatus, where the apparatus includes:
the gateway configuration system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving gateway configuration parameters, and 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 parameters and starting an output interface corresponding to a target output protocol according to the data output configuration parameters;
the analysis module is used for acquiring data to be processed 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, the user can start the corresponding input interface and output interface according to actual needs, such as different industrial scenes, and then perform corresponding data processing, so that the gateway has universality and can be applied to different industrial scenes, the adaptability of the gateway equipment is improved to a certain extent, and more complicated and changeable industrial requirements are met to a certain extent.
An embodiment of the present application further provides a gateway, including: 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 the connection and 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 a corresponding input interface and an output interface according to actual needs, such as different industrial scenes, so as to perform corresponding data processing, so that the gateway has the universality, can be applied to different industrial scenes, improves the adaptability of gateway equipment to a certain extent, and meets more and more complex and changeable industrial requirements to a certain extent.
Further, the gateway further comprises an 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 the destination address of the data.
In the implementation process, the LoRa wireless module is arranged in the gateway, so that wireless acquisition of data is realized through the LoRa wireless module, and the complexity and cost of industrial field wiring are reduced.
Furthermore, a database is arranged in the gateway; the database is connected with the processor and used for storing the data repackaged by the processor.
In the implementation process, the gateway can realize the persistent storage of the data, thereby enhancing the recoverability of the data to a certain extent and reducing the risk of being difficult to retrieve after the data is lost.
Also provided in an embodiment of the present application is a readable storage medium storing one or more programs, which are executable by one or more processors to implement any of the data processing methods described above.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used 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 therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic structural diagram of a gateway according to an embodiment of the present application;
fig. 2 is a schematic flowchart 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 structural diagram of a data processing apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a more specific 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.
The first embodiment is as follows:
in order to meet the needs of industrial development and meet the current increasingly varied requirements of gateway usage, the embodiments of the present application provide a gateway and a corresponding method adapted to the gateway. As shown in fig. 1, fig. 1 is a schematic structural diagram of a gateway provided in this 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. Examples of the Interface include a USB (Universal Serial Bus) Interface, an RS232 Interface, an RS485 Interface, an Audio Interface, a network Interface, an HDMI (High-Definition Multimedia Interface) Interface, a VGA (Video Graphics Array) Interface, and the like. It should be understood that for most interfaces it can be used as both an input and an output, such as a USB interface, a web portal, etc. The input interface 101 described in the embodiment of the present application refers to an interface for data input 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 the gateway has a plurality of interfaces through which data can be input and a plurality of interfaces through which data can be 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 the corresponding method adapted by the gateway, which is proposed in the embodiment of the present application, by executing the corresponding program stored in the memory 104.
The corresponding method adapted by the gateway provided in the embodiment of the present application includes a data processing method 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 data input configuration parameters and data output configuration parameters. Wherein:
the data input configuration parameters are parameters required by the input interface which needs to be enabled and is input by the user according to the current requirement. The data input configuration parameters may include the model of the device to which the input interface needs to be accessed, the name or interface identifier of the input interface, the protocol used, the IP address of the device to be accessed, and the like.
The data output configuration parameters are parameters required by the input interface which needs to be enabled and the enabled output interface which is input by the user according to the current requirement. The data output configuration parameters may include the model of the device to which the output interface needs to be connected, the name or interface identifier of the output interface, the protocol used, the IP address of the device to be connected, and the like.
In the embodiment of the application, a user can select an input interface and an output interface which need to be started according to the current requirement, and then input corresponding data input configuration parameters and data output configuration parameters.
S202: and 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 for the input interface and the output interface may be viewed as a configuration of channels. When configuring the parameters, the user may implement the configuration through an external device (e.g., a computer). For example, a user may connect a computer with a network management system via a network cable, open a browser to input an IP (Internet Protocol) address of a gateway, and enter a configuration interface to perform parameter configuration. The configured parameters include: the input interface or the output interface is corresponding to the model of the device to be connected, the name or the interface identification of the configured input interface or the output interface, the protocol adopted by the input interface or the output interface, the IP address of the device to be connected by the input interface or the output interface, and the like. After configuration, communication connection is established between the configured input interface or output interface and the equipment to be connected, and the gateway can perform data interaction with the connected equipment.
S203: acquiring data to be processed transmitted from an input interface, calling an input protocol plug-in corresponding to a target input protocol according to 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, plug-ins (i.e., input protocol plug-ins) corresponding to each protocol involved in each input interface in a gateway, and different input protocol plug-ins may analyze encapsulated data using different protocols. For example, a ModBus input protocol plug-in may parse data encapsulated in ModBus protocol, while an OPC-UA (Object Linking and Embedding for Process Control UnifiedArchitecture) input protocol plug-in may parse data encapsulated in OPC-UA protocol.
It should be noted that, in the embodiment of the present application, a corresponding relationship 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 the input protocol plug-ins corresponding to the first protocol identifier may be collectively called from a preset input protocol plug-in according to the first protocol identifier.
In the embodiment of the application, in order to realize the 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 the analyzed data. For example: the ModBus RTU (remote measurement and control terminal) plug-in can obtain input protocol analysis parameters such as serial port number, baud rate, data digit, check mode, stop digit, function code, equipment ID, equipment initial address, data length and the like through an object, and then analyze the 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. And the data output configuration parameters comprise a second protocol identifier corresponding to the target input protocol, so that the input protocol plug-ins corresponding to the second protocol identifier can be called from the preset output protocol plug-ins in a centralized manner according to the second protocol identifier.
Correspondingly, in the embodiment of the present application, to implement encapsulation of the parsed data, the output protocol plug-in may be instantiated as a data output object, the output protocol parameter is 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 the rule of the target output protocol through the data output object.
It is noted that in practical applications, it may be necessary for the gateway to access multiple input devices simultaneously, or for multiple output devices to be accessed simultaneously. In this case, the user needs to configure multiple input interfaces or multiple output interfaces.
If a plurality of input devices are accessed simultaneously, the data input configuration parameters corresponding to the input interface for receiving the data to be processed can be used for analyzing the data to be processed by selecting the input protocol plug-in corresponding to the data input configuration parameters from the preset input protocol plug-in set.
Similarly, if a plurality of output devices are accessed simultaneously, a required output interface may be determined according to a destination address of the to-be-processed data (i.e., the IP address of the device to be connected configured in the above example), and then an output protocol plugin corresponding to the data output configuration parameter is selected from preset output protocol plugins according to the data output configuration parameter corresponding to the determined output interface to encapsulate the parsed data, and the re-encapsulated to-be-processed data is sent through the determined output interface.
For example, in a possible implementation manner in which the configuration parameters include a protocol identifier, matching may be performed in data output configuration parameters of each currently enabled output interface according to a destination address in the data to be processed, so as to determine a required output interface, further determine the protocol identifier in the data output configuration parameters of the output interface, and select an output protocol plugin corresponding to the protocol identifier from preset output protocol plugins to implement encapsulation of the analyzed data to be processed.
It should be understood that, when multiple input devices are simultaneously accessed (that is, multiple input interfaces are currently enabled), in a feasible implementation manner of the embodiment of the present application, an input interface that receives data to be processed may not be determined first, but a polling manner is adopted, for each currently enabled input interface, an input protocol plug-in corresponding to a data input configuration parameter of each input interface is called one by one to analyze the data to be processed, and if a certain input protocol plug-in is successfully analyzed, the input protocol plug-in is determined to be an input protocol plug-in the current use process.
For example, in a possible implementation manner in which the configuration parameters include protocol identifiers, A, B, C are set as currently enabled input interfaces, a protocol identifier in the first configuration information of the a interface is a1, a protocol identifier in the first configuration information of the B interface is B1, a protocol identifier in the first configuration information of the C interface is B1, and a C interface is set to the data to be processed (since the data to be processed is received by the C interface, the protocol used by the data to be processed is a B1 protocol), when polling is performed, the input protocol plugin corresponding to the a1 is found by using the first configuration information of the a interface to analyze the data to be processed, when the analysis fails, the input protocol plugin corresponding to the B1 is found by calling the first configuration information of the B interface to analyze the data to be processed, when the analysis succeeds, the input protocol plugin is marked as the input protocol plugin in the current use process of the C interface, and the data received by the subsequent interface C is limited to be analyzed by adopting the input protocol plug-in.
Similarly, when a plurality of output devices are simultaneously accessed (i.e. a plurality of output interfaces are currently enabled), in a possible implementation manner of the embodiment of the present application, a polling manner may be adopted instead of determining a required output interface, and for each currently enabled output interface, an output protocol plug-in corresponding to the data output configuration parameter of each output interface is called one by one to repackage the parsed data, and the data is attempted to be sent to the destination address of the data to be processed. If the sending fails, calling an output protocol plug-in corresponding to the data output configuration parameters of the next output interface to repackage the analyzed data, and trying to send the data to the destination address of the data to be processed until the sending is successful.
It should be noted that, in the embodiment of the present application, when the user performs interface configuration, the input data may not be required to set the protocol identifier in the input configuration parameters and/or the data output configuration parameters. The adaptable protocol corresponding to each interface can be defined in the gateway in advance. Thus, when receiving the data to be processed, the input interface for receiving the data to be processed can be obtained according to the source address information in the data to be processed (i.e. the IP address of the device to be connected configured in the above example), and then the corresponding input protocol plug-in can be found according to the protocol of the interface defined in advance.
It should be understood that for some interfaces, it may be allowed to perform data interaction through multiple protocols, and then there are multiple protocols corresponding to the interface defined in advance in the gateway at this time, but in actual application, there is only one protocol used. In order to determine which protocol is specifically used, in this embodiment of the present application, after determining the input interface that receives the data to be processed, a polling method may be adopted to obtain the input protocol plug-ins corresponding to the input interface one by one to analyze the data to be processed, and if a certain input protocol plug-in is successfully analyzed, it is determined that the input protocol plug-in is the input protocol plug-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 may be obtained one by one to encapsulate the analyzed data in a polling manner, and the encapsulated data is sent to the target device (i.e., the device having the destination address). And if the feedback of the target equipment cannot be identified, the analyzed data is encapsulated again by adopting the next output protocol plug-in corresponding to the output interface and is sent to the target equipment until the target equipment can be identified. And taking the output protocol plug-in which the target equipment can identify after re-encapsulation as the output protocol plug-in the use process.
It should be further noted that, in this embodiment of the application, when a plurality of output interfaces are currently enabled, a plurality of target input protocols are provided, 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 obtained, and then 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 an embodiment of the present application, the attribute information of the collected device includes at least one of: the number of the collected measuring points, the data transmission mode, the data collection frequency, the data length and the like. Illustratively, 500 (more) collection measuring points of a large-scale device are provided, the data transmission mode is ethernet (fast), the collection frequency is once every 1 second (high frequency), and the data length is 50 bytes (large data), so that a large memory and a buffer memory need to be allocated to the large-scale device to meet the collection requirement of high-speed and large data volume. In the embodiment of the present application, a corresponding evaluation criterion may be set, for example, a comprehensive score of the collected device may be calculated according to a preset formula according to the number of the collected measuring points, the data transmission mode, the data collection frequency, and the data length, and then the memory and the cache corresponding to the comprehensive score are allocated to the collected device according to the comprehensive score.
It should be further noted that the acquisition point in the embodiment of the present application is a data storage unit on the acquired device. The user can configure the attributes of each acquisition measuring point in the gateway, and the attributes of each acquisition measuring point comprise a measuring point name, a data storage address, a data storage type, data acquisition frequency and the like, so that the gateway can acquire correct data according to the attributes of each acquisition measuring point.
In this embodiment, the data analysis object instantiated by the input protocol plug-in may be an object with a three-layer structure formed by a collection channel, a collection group and collection measurement points, where the collection channel is a collected device, and the collection measurement points with the same or similar characteristics form a collection group, so as to obtain the data analysis object of the collection channel, the collection group and the collection measurement points. And acquiring to obtain an input protocol analysis parameter according to the attribute information of the acquired equipment and the attribute information of each acquisition measuring point in the data analysis object.
In addition, in the embodiment of the application, a data center may be disposed in the gateway, and after the data to be processed is collected and analyzed, the analyzed data may be stored in a data cache queue. And the data center can regularly acquire the analyzed data from the data buffer queue for packaging according to the configured output mode.
It should be understood that there are many ways for the data output of the gateway, for example, outputting to a file, a database, a public cloud platform or a private cloud platform, etc., each way has different output rules, and the required output interface may also be different. The output mode can be synchronously configured when configuring the gateway configuration parameters.
For example, if the configured output mode is database storage, outputting to the file may be periodically acquiring parsed data from the data cache queue for encapsulation, establishing a database and a data table according to a data structure of the encapsulated data, and then storing the encapsulated data in the database mode; if the output mode is a public cloud platform, the protocol is an MQTT (Message queue Telemetry Transport) protocol, and the MQTT is a protocol based on Message publishing/subscribing, the output rule may be to periodically obtain parsed data from a data cache queue for encapsulation, and publish the encapsulated data in a Message format to the network, so that a subscriber 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, the collected data temporarily placed in the data cache queue may be directly deleted, so as to save data cache resources.
It should be understood that in an actual application environment, there may be many circuits, which are inconvenient to arrange. In order to solve the problem, in the embodiment of the present application, an LoRa wireless module may be built in the gateway, so that wireless acquisition of data is achieved through the LoRa wireless module, and complexity and cost of industrial field routing are reduced.
In addition, in order to improve data recoverability and meet increasingly complex practical requirements, a database can be arranged in the gateway, and data obtained by repackaging of the processor is stored in the database, so that the data can be retransmitted quickly when loss occurs in the data transmission process. Of course, in order to meet the increasingly complex actual requirements, other corresponding services may be configured in the gateway in the embodiment of the present application.
It will be appreciated that the foregoing gateway architecture 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 (Secure Digital Memory Card), an MMC (Multimedia Card), etc., in which one or more programs implementing the steps of fig. 2 are stored, and the one or more programs can be executed by one or more processors to implement the steps. And will not be described in detail herein.
To sum up, according to the scheme provided by the embodiment of the present application, a user can input relevant gateway configuration parameters according to actual needs, and start a required input interface and an output interface, so that the gateway can obtain data to be processed, which is transmitted from the input interface, and call an input protocol plug-in corresponding to a target input protocol according to the data input configuration parameters, analyze the data to be processed, obtain analyzed data, call an output protocol plug-in corresponding to the target output protocol according to the data output configuration parameters, encapsulate the analyzed data, and transmit the data through the output interface. Therefore, the user can start the corresponding input interface and the output interface 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 gateway equipment to a certain extent, and meets more and more complex and changeable industrial requirements to a certain extent.
Example two:
on the basis of the first embodiment, the present embodiment takes a specific data acquisition gateway as an example to further illustrate the present application.
Referring to the gateway structure shown in fig. 3, the gateway provides a power-on button 31, a USB interface 32, an RS232 interface 33, an Audio interface 34, a network interface 35, an HDMI interface 36, a VGA interface 37, a power interface 38, and also has a wireless LoRa module and an antenna 39.
The gateway internal structure may be as described with reference to fig. 4, with the processor implementing an operating system and a gateway application service hosted on the operating system. The processor is connected to a storage (a memory and a hard disk), the memory can store a corresponding program (for example, a program implementing the scheme of fig. 2 in the first embodiment) for the processor to execute, and the hard disk can 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 built-in wireless acquisition module of loRa, therefore can realize through loRa wireless technology with the data interaction between the field device, subtracted industrial field wiring cost and complexity.
In the embodiment of the present application, the gateway may collect data of various devices, such as a device using a ModBus protocol, a device using an OPC protocol, a PLC (Programmable Logic Controller), a CNC (Computerized Numerical Control), and the like, through a USB interface, an RS232 interface, and a network interface. And analyzing and repackaging the acquired data, and then sending the data to corresponding target equipment or service. For example, the application may be sent to a file service (for example, saved in a file local to the gateway), sent to a database (for example, stored in a database local to the gateway), and sent to an octoot Cloud (a Cloud platform), Kafka (a stream processing platform), MQTT (Message queue telemetry Transport) application and other applications on the network.
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 output protocol plug-in through the configuration parameters configured by the user. Specifically, the user can connect the computer with the network manager through a network cable, open a browser to input an IP (Internet Protocol, Internet interconnection Protocol) address of a gateway, and enter a configuration interface to perform parameter configuration. The configured parameters include: after the configuration, the communication connection is established with the equipment to be connected through the configured input interface or output interface, and the gateway can realize data interaction with the equipment through the configured input interface or output interface.
It should also be noted that, in this embodiment of the present application, attribute information of the acquired device connected to each enabled input interface, including the number of acquisition measurement points, a data transmission manner, a data acquisition frequency, a data length, and the like, is also obtained, so as to allocate a dedicated memory resource for data acquisition to the acquired device.
In addition, the attribute information of each acquisition measuring point in the acquired equipment is acquired, wherein the attribute information comprises measuring point names, data storage addresses, data storage types, data acquisition frequency and the like. And the gateway can acquire the data to be processed from each acquisition measuring point according to the attribute information of each acquisition measuring point.
In addition, an output mode is configured in the embodiment of the application, for example, the output mode is output to a file, a database, a public cloud platform or a private cloud platform, and the like.
In the embodiment of the application, after the data to be processed is acquired through a certain input interface, a data analysis object with a three-layer structure consisting of an acquisition channel, an acquisition group and acquisition measuring points can be constructed, so that 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 to obtain analyzed data.
In the embodiment of the application, the analyzed data can be stored in the data cache queue after being obtained, and the analyzed data is periodically obtained from the data cache queue for packaging according to the configured output mode. During packaging, the input protocol plug-in can be determined according to the second protocol identifier set in the output configuration parameter, the output protocol plug-in is instantiated into a data output object, the output protocol parameter is configured for the analyzed data through the data output object to obtain packaging data corresponding to the target output protocol, and then the packaging data is sent through the output interface according to the rule of the target output protocol through the data output object.
Through the scheme, in terms of hardware, the interface of the gateway basically covers the acquisition requirements of all equipment, and the gateway has better universality. In terms of software, when the gateway is used, only the input interface and the output interface need to be subjected to parameter configuration, and the gateway can automatically call the corresponding input protocol plug-in and output protocol plug-in to correctly perform data input and output processing. The gateway can meet the requirements of customers with different levels, and the reliability of the system is improved; for light weight requirements, system cost may be reduced.
Example three:
based on the same inventive concept, the embodiment of the present application further provides a data processing apparatus 500. Referring to fig. 5, fig. 5 shows a data processing apparatus corresponding to the method shown in fig. 2. It should be understood that the specific functions of the apparatus 500 can be referred to the above description, and the detailed description is omitted here as appropriate to avoid redundancy. The apparatus 500 includes at least one software functional module that can be stored in a memory in the form of software or firmware or solidified in an operating system of the apparatus 500. Specifically, the method comprises the following steps:
referring to fig. 5, the apparatus 500 includes:
a receiving module 501, configured to receive gateway configuration parameters, where the gateway configuration parameters include data input configuration parameters and data output configuration parameters;
the enabling module 502 is configured to enable an input interface corresponding to a target input protocol according to the data input configuration parameter, and enable an output interface corresponding to a target output protocol according to the data output configuration parameter;
the analysis 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 analyze the data to be processed to obtain analyzed data;
and the output module 504 is configured to call 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 encapsulated data through the output interface.
In a possible implementation manner of the embodiment 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 centrally call, according to the first protocol identifier, the input protocol plug-in corresponding to the first protocol identifier from the preset input protocol plug-in set.
In a possible implementation manner of the embodiment of the present application, the parsing module 503 is specifically configured to instantiate an input protocol plug-in as a data parsing object; and acquiring an input protocol analysis parameter of the data to be processed through the data analysis object, and analyzing the data to be processed according to the input protocol analysis parameter to obtain analyzed data.
In a possible implementation manner of the embodiment of the present application, the data output configuration parameters include: a second protocol identification 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 a possible implementation manner of the embodiment of the present application, the output module 504 is specifically configured to instantiate the 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 the target output protocol; and transmitting the encapsulated data through the data output object through the output interface according to the rule of the target output protocol.
In one possible implementation of the embodiment of the present application, the target input protocol is multiple. Referring to fig. 6, the apparatus 500 further comprises a configuration module 505. The configuration module 505 is configured to obtain attribute information of the acquired device corresponding to each target input protocol in the multiple target input protocols, where the attribute information includes at least one of: acquiring the number of measuring points, a data transmission mode, data acquisition frequency and data length; and configuring a special memory resource for data acquisition for each target input protocol in the plurality of target input protocols according to the attribute information.
In a possible implementation manner of the embodiment of the present application, the parsing module 503 is further configured to store the parsed data in a data cache queue, so as to implement persistence of the parsed data; the output module 504 is specifically configured to periodically obtain the parsed data from the data buffer queue for encapsulation.
It should be understood that, for the sake of brevity, the contents described in some embodiments are not repeated 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 ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or a plurality of modules may be integrated to form an independent part.
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.
In this context, a plurality means two or more.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (12)

1. A method of data processing, 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 to-be-processed data 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 to-be-processed data 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 analyzed data, and sending the 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 invoking of the input protocol plug-in corresponding to the target input protocol according to the data input configuration parameter includes:
and calling the input protocol plug-ins corresponding to the first protocol identifier from a preset input protocol plug-in set according to the first protocol identifier.
3. The data processing method of claim 1, wherein the invoking an input protocol plug-in corresponding to the target input protocol according to the data input configuration parameter, parsing the data to be processed to obtain parsed data, comprises:
instantiating the input protocol plug-in as a data parsing object;
and acquiring an input protocol analysis parameter of the data to be processed through the data analysis object, and analyzing the data to be processed according to the input protocol analysis parameter to obtain the analyzed data.
4. The data processing method of claim 1, wherein the data output configuration parameters comprise: a second protocol identification corresponding to the target output protocol;
the calling of the output protocol plug-in corresponding to the target output protocol according to the data output configuration parameters comprises:
and extracting the output protocol plug-ins corresponding to the second protocol identifier from the preset output protocol plug-in set according to the second protocol identifier.
5. The data processing method of claim 1, wherein the encapsulating the parsed data to be processed comprises:
instantiating the output protocol plug-in as a data output object,
configuring output protocol parameters for the analyzed data through the data output object to obtain encapsulated data corresponding to the target output protocol;
the sending through the output interface includes:
and sending the encapsulated data through the data output object through the output interface according to the rule of the target output protocol.
6. The data processing method of claim 1, wherein the target input protocol is plural, the method further comprising:
acquiring attribute information of 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 items: acquiring the number of measuring points, a data transmission mode, data acquisition frequency and data length;
and configuring a special memory resource for data acquisition for each target input protocol in the plurality of target input protocols according to the attribute information.
7. The data processing method of any of claims 1-6, wherein the method further comprises:
storing the analyzed data into a data cache queue to realize persistence of the analyzed data;
the encapsulating the parsed data comprises:
and periodically acquiring the analyzed data from the data cache queue for packaging.
8. A data processing apparatus, characterized in that the apparatus comprises:
the gateway configuration system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving gateway configuration parameters, and 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 parameters and starting an output interface corresponding to a target output protocol according to the data output configuration parameters;
the analysis module is used for acquiring data to be processed 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 the connection and 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 of 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 the 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 repackaged by the processor.
12. A readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the data processing method of any one 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 true CN111294235A (en) 2020-06-16
CN111294235B 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)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112073420A (en) * 2020-09-11 2020-12-11 杭州安恒信息技术股份有限公司 Network protocol analysis method, device and related equipment
CN112087454A (en) * 2020-09-10 2020-12-15 上海顺舟智能科技股份有限公司 Communication method, device, equipment and storage medium of Internet of things gateway equipment
CN112637589A (en) * 2020-07-31 2021-04-09 西安诺瓦星云科技股份有限公司 Data processing method and device and video processing equipment
CN113783893A (en) * 2021-09-29 2021-12-10 远景智能国际私人投资有限公司 Data transmission method, device and system
CN116346949A (en) * 2023-05-29 2023-06-27 瞳见科技有限公司 Method, system and device for constructing protocol conversion rule chain

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090006909A1 (en) * 2003-11-24 2009-01-01 Patrick Ladd 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
WO2014180297A1 (en) * 2013-05-10 2014-11-13 华为技术有限公司 Method and apparatus for processing messages
CN106557447A (en) * 2016-11-29 2017-04-05 中国电子科技集团公司第二十九研究所 A kind of general purpose interface bus conversion and pretreatment unit
CN107888488A (en) * 2016-09-30 2018-04-06 西门子(中国)有限公司 Intelligent gateway and its method
CN108092884A (en) * 2017-11-23 2018-05-29 南京邮电大学 A kind of wireless access gateway system and application process

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090006909A1 (en) * 2003-11-24 2009-01-01 Patrick Ladd 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
WO2014180297A1 (en) * 2013-05-10 2014-11-13 华为技术有限公司 Method and apparatus for processing messages
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

Cited By (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
CN112087454A (en) * 2020-09-10 2020-12-15 上海顺舟智能科技股份有限公司 Communication method, device, equipment and storage medium of Internet of things gateway equipment
CN112087454B (en) * 2020-09-10 2021-08-31 上海顺舟智能科技股份有限公司 Communication method, device, equipment and storage medium of Internet of things gateway equipment
CN112073420A (en) * 2020-09-11 2020-12-11 杭州安恒信息技术股份有限公司 Network protocol analysis method, device and related equipment
CN113783893A (en) * 2021-09-29 2021-12-10 远景智能国际私人投资有限公司 Data transmission method, device and system
CN116346949A (en) * 2023-05-29 2023-06-27 瞳见科技有限公司 Method, system and device for constructing protocol conversion rule chain
CN116346949B (en) * 2023-05-29 2023-10-03 瞳见科技有限公司 Method, system and device for constructing protocol conversion rule chain

Also Published As

Publication number Publication date
CN111294235B (en) 2023-05-02

Similar Documents

Publication Publication Date Title
CN111294235B (en) Data processing method, device, gateway and readable storage medium
CN109391500B (en) Configuration management method, device and equipment
CN111818136B (en) Data processing method, device, electronic equipment and computer readable medium
CN102790776B (en) Heartbeat connection normalizing processing method, terminal, server and communication system
CN107222324B (en) Service configuration method and device of network service
CN110381093B (en) Method and device for converting data protocol, system for transmitting data and electronic equipment
CN112039796B (en) Data packet transmission method and device, storage medium and electronic equipment
CN112671697B (en) Data processing method, device and system of comprehensive monitoring system
CN106549989B (en) Data transmission method and system, user terminal and application server
CN107332857B (en) Network data transmission method, device, system and storage medium
CN111552838A (en) Data processing method and device, computer equipment and storage medium
CN114285781B (en) SRV6 service flow statistics method, device, electronic equipment and medium
CN112788060A (en) Data packet transmission method and device, storage medium and electronic equipment
CN105190530A (en) Transmitting hardware-rendered graphical data
CN107368334B (en) Business plug-in interaction system and method
CN113867732A (en) Message information processing method, system and storage medium
CN110071839B (en) CORBA communication device supporting digital signal processor
CN109861998B (en) Plug-in type dynamic analysis system and method based on Beidou short message protocol
CN113163028B (en) Service data transmission method, device and system
CN109358820B (en) Data access method and device, electronic equipment and computer readable storage medium
CN110275701A (en) Data processing method, device, medium and calculating equipment
CN114125024B (en) Audio transmission method, electronic device and readable storage medium
CN115277450A (en) OPNET-based virtual-real combined heterogeneous communication network fusion system and application
CN112383924B (en) Base station equipment management method, device and system
CN112764945A (en) Message center service middleware 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