CN113973111B - Data forwarding method, device, gateway equipment and computer readable storage medium - Google Patents

Data forwarding method, device, gateway equipment and computer readable storage medium Download PDF

Info

Publication number
CN113973111B
CN113973111B CN202111272290.1A CN202111272290A CN113973111B CN 113973111 B CN113973111 B CN 113973111B CN 202111272290 A CN202111272290 A CN 202111272290A CN 113973111 B CN113973111 B CN 113973111B
Authority
CN
China
Prior art keywords
message
processed
forwarding
processing
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
CN202111272290.1A
Other languages
Chinese (zh)
Other versions
CN113973111A (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.)
Zhuhai Tianrongxin Network Security Technology Co ltd
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Original Assignee
Zhuhai Tianrongxin Network Security Technology Co ltd
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software 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 Zhuhai Tianrongxin Network Security Technology Co ltd, Beijing Topsec Technology Co Ltd, Beijing Topsec Network Security Technology Co Ltd, Beijing Topsec Software Co Ltd filed Critical Zhuhai Tianrongxin Network Security Technology Co ltd
Priority to CN202111272290.1A priority Critical patent/CN113973111B/en
Publication of CN113973111A publication Critical patent/CN113973111A/en
Application granted granted Critical
Publication of CN113973111B publication Critical patent/CN113973111B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • 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
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

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

Abstract

The application provides a data forwarding method, a device, gateway equipment and a computer readable storage medium, wherein the method is applied to the gateway equipment, the gateway equipment comprises an acquisition end and a forwarding end, and the method comprises the following steps: acquiring a message to be processed through the acquisition end and the forwarding end; analyzing the message to be processed through the acquisition end, determining parameters of the message to be processed, and feeding back an analysis result to the client so that the client can update the current processing data record information; and processing the message to be processed through the forwarding end to obtain a target message, and forwarding the target message to the server.

Description

Data forwarding method, device, gateway equipment and computer readable storage medium
Technical Field
The present invention relates to the technical field of gateway devices, and in particular, to a data forwarding method, a device, a gateway device, and a computer readable storage medium.
Background
At present, a traditional gateway in the market is divided into a processing module connected with a client (client) and another processing module connected with a server (server), and after data is acquired by gateway equipment, the gateway equipment needs to perform initial processing through the processing module connected with the client (client), so that the data displayed for a user is updated first, and then the data displayed for the user is forwarded through the another processing module connected with the server (server) after being updated. This is performed in sequence by the two processing modules, which results in relatively low efficiency in forwarding data by the gateway.
Disclosure of Invention
The invention aims to provide a data forwarding method, a data forwarding device, gateway equipment and a computer readable storage medium, which can alleviate the problem of low data processing efficiency of the gateway equipment.
In a first aspect, an embodiment of the present application provides a data forwarding method, which is applied to a gateway device, where the gateway device includes an acquisition end and a forwarding end, and the method includes:
acquiring a message to be processed through the acquisition end and the forwarding end;
analyzing the message to be processed through the acquisition end, determining parameters of the message to be processed, and feeding back an analysis result to display equipment connected with the gateway equipment so as to update the current processing data record information by the display equipment;
and processing the message to be processed through the forwarding end to obtain a target message, and forwarding the target message to a server.
In an optional implementation manner, the processing, by the forwarding end, the message to be processed to obtain a target message includes:
judging whether the message to be processed is a complete message or not;
and if the message to be processed is an incomplete message, after all the messages corresponding to the message to be processed are acquired, processing all the messages corresponding to the message to be processed to obtain a target message.
In the embodiment, the integrity of the message can be judged, if the message is incomplete, the message can be processed after the complete message is received, so that the forwarded message is complete, and the validity of the forwarded message is improved.
In an optional embodiment, after the obtaining all the messages corresponding to the to-be-processed message, processing all the messages corresponding to the to-be-processed message to obtain a target message, including:
storing the message to be processed into a designated memory;
after the gateway equipment receives all messages corresponding to the messages to be processed, acquiring all messages corresponding to the messages to be processed from the appointed memory;
and processing all the messages corresponding to the message to be processed to obtain a target message.
In an optional implementation manner, the storing the message to be processed in the designated memory includes:
marking the message to be processed, and storing the marked message to be processed into a designated memory.
In the embodiment, the incomplete message is marked, so that repeated acquisition of the message which does not need to be processed can be avoided, the effectiveness of message processing is improved, and further, after the complete message is obtained, all the required messages can be obtained from the specified memory more accurately based on the marking content.
In an optional implementation manner, the determining whether the message to be processed is a complete message includes:
and judging whether the message to be processed is a complete message or not according to the appointed mark in the message to be processed.
In an optional implementation manner, the determining whether the message to be processed is a complete message includes:
and determining whether the message to be processed is a complete message according to parameters obtained by analyzing the message to be processed.
In the embodiment, the judgment can be performed based on the appointed identifiers carried by the messages of different protocols, so that the judgment of the message integrity can be realized more quickly.
In an optional embodiment, after the obtaining all the messages corresponding to the to-be-processed message, processing all the messages corresponding to the to-be-processed message to obtain a target message, including:
and processing the current message to be processed to determine the local parameters corresponding to the message to be processed.
Updating the current parameter by using the local parameter, wherein when the current message to be processed is a fragmented message of the first fragment, the current parameter is empty, and the steps are repeatedly executed until the current parameter is a complete parameter;
and if the current parameter is the complete parameter, processing the current parameter to obtain the target message.
In the embodiment, when the message to be processed is received, the parameters carried by the message are analyzed, and the message is not required to be processed after the complete message is received, so that the message processing efficiency can be improved.
In an optional implementation manner, the processing, by the forwarding end, the message to be processed to obtain a target message includes:
analyzing the message to be processed to obtain parameters in the message to be processed;
and converting the parameters in the message to be processed to obtain a target message in a target format required by the server.
In an optional implementation manner, the gateway device includes a shared memory, where the shared memory is used to store the messages that need to be processed by the collecting end and the forwarding end; the method further comprises the steps of:
receiving a message to be processed, and storing the message to be processed in the shared memory;
the step of obtaining the message to be processed through the collecting end and the forwarding end comprises the following steps: and acquiring a message to be processed from the shared memory through the acquisition end and the forwarding end.
In the above embodiment, a shared memory may be further provided for the collecting end and the forwarding end, so that the collecting end and the forwarding end can access together.
In a second aspect, an embodiment of the present application further provides a data forwarding apparatus, which is applied to a gateway device, where the gateway device includes an acquisition end and a forwarding end, and the apparatus includes:
the acquisition module is used for acquiring the message to be processed through the acquisition end and the forwarding end;
the first processing module is used for analyzing the message to be processed through the acquisition end, determining parameters of the message to be processed, and feeding back an analysis result to display equipment connected with the gateway equipment so as to update the current processing data record information by the display equipment;
the second processing module is used for processing the message to be processed through the forwarding end to obtain a target message;
and the forwarding module is used for forwarding the target message to a server through the forwarding end.
In a third aspect, an embodiment of the present application further provides a gateway device, including: a processor, a memory storing machine-readable instructions executable by the processor, which when executed by the processor perform the steps of the method described above when the electronic device is run.
In a fourth aspect, embodiments of the present application also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method described above.
The beneficial effects of the embodiment of the application are that: the message to be processed can be obtained jointly through the acquisition end and the forwarding end, and the forwarding end can start processing without taking the processing result of the acquisition end as a basis, so that the forwarding efficiency is not affected by the processing of the acquisition end, and the efficiency of forwarding data by the gateway can be improved.
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 will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered limiting the scope, and that 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 diagram of an operation environment of a data forwarding method according to an embodiment of the present application;
fig. 2 is a block schematic diagram of a gateway device according to an embodiment of the present application;
fig. 3 is a flowchart of a data forwarding method provided in an embodiment of the present application;
fig. 4 is a schematic functional block diagram of a data forwarding device 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.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
The inventors have appreciated that the general logic of gateway forwarding data is: the acquisition end establishes connection in modes of data tcp/ip (Transmission Control Protocol/Internet Protocol ), udp (User Datagram Protocol, user datagram protocol), serial port and the like, after connection establishment is completed, the acquisition end can receive an industrial control message sent by the client end, the acquisition end receives the industrial control message first, the acquisition end analyzes the industrial control message through a designated protocol after receiving the industrial control message, and after analysis is completed, the changed content is updated to a display end associated with gateway equipment; after the processing of the acquisition end is finished, the original industrial control message is sent to the forwarding end, the forwarding end analyzes the message through a set protocol, the industrial control message is assembled into a message with a specified format of the protocol, and the message with the specified format is sent to the server.
According to the processing procedure, when the gateway equipment is used for forwarding data, the acquisition end is required to wait for the processing of the acquisition end before forwarding, and then the forwarding end performs some processing work, so that a lot of time is wasted in the processing procedure, and the capability of the gateway equipment for processing the data is greatly reduced.
Based on the above-mentioned study, the present application provides a data forwarding method, where the data forwarding method in the embodiment of the present application improves a data processing manner of a gateway device, modifies existing processing data packet logic, and the modified processing flow of the gateway device may be: after the protocol message is sent to the gateway equipment, the acquisition end and the forwarding end synchronously acquire the protocol message, synchronously process the protocol message, display the change data by a user after the acquisition end processes the protocol message, and the forwarding end forwards the message after the protocol message is sent to the server. The schemes provided in this application are described below by way of some examples.
Example 1
For the sake of understanding the present embodiment, an operation environment for executing the data forwarding method disclosed in the embodiment of the present application will be described first.
Fig. 1 is a schematic diagram of an operation environment of a data forwarding method according to an embodiment of the present application. The gateway device 100 is communicatively coupled to one or more client terminals 210 for data communication or interaction via a network. Gateway device 100 may also be communicatively coupled to one or more servers 220 via a network for data communication or interaction. The gateway device 100 may also be communicatively coupled to one or more display terminals 230 via a network for data communication or interaction.
The server 220 may be a data server, a web server, etc., capable of providing web services. The client terminal 210 may be a personal computer (personal computer, PC), a tablet computer, a smart phone, a personal digital assistant (personal digital assistant, PDA), an industrial personal computer, etc., and the display terminal 230 may be a personal computer (personal computer, PC), a tablet computer, a smart phone, a personal digital assistant (personal digital assistant, PDA), an industrial personal computer, etc.
In this embodiment, the client terminal 210 may operate with a client, and the server 220 operates with a server that cooperates with the client. The client may send some requests to a server for the corresponding requests sent by the client. In this embodiment, the request sent by the client is forwarded to the server by the gateway device 100.
Further, the display terminal 230 may also be operated with a function for displaying the processed data in the current client.
In this embodiment, the gateway device 100 may include an acquisition end 110, a forwarding end 120, and a shared memory 130.
For example, the gateway device 100 establishes connection with the client by tcp/ip, udp, serial port, etc., and after the connection is established, the client may send a specified industrial control protocol packet, where the industrial control protocol may be: the gateway device 100 does not need to wait for whether the message is a complete data packet after receiving the message according to industrial control protocols such as modbus, dnp3, opcda, and iec104, and only if the data packet is transmitted to the gateway device 100, the gateway device 100 receives the message and then sends the message to the collecting end 110 and the forwarding end 120 at the same time, and the collecting end 110 and the forwarding end 120 process the message synchronously.
As shown in fig. 2, a block schematic diagram of gateway device 100 is shown. Gateway device 100 may include memory 111, processor 113. It will be appreciated by those of ordinary skill in the art that the structure shown in fig. 2 is merely illustrative and is not limiting of the structure of gateway device 100. For example, gateway device 100 may also include more or fewer components than shown in fig. 2, or have a different configuration than shown in fig. 2.
The above-mentioned memory 111 and the processor 113 are electrically connected directly or indirectly to each other to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The processor 113 is used to execute executable modules stored in the memory.
The Memory 111 may be, but is not limited to, a random access Memory (Random Access Memory, RAM), a Read Only Memory (ROM), a programmable Read Only Memory (Programmable Read-Only Memory, PROM), an erasable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), an electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc. The memory 111 is configured to store a program, and the processor 113 executes the program after receiving an execution instruction, and a method executed by the gateway device 100 defined by the process disclosed in any embodiment of the present application may be applied to the processor 113 or implemented by the processor 113.
In this embodiment, the shared memory 130 of the gateway device 100 may be a part of the memory 111 of the gateway device 100.
The processor 113 may be an integrated circuit chip having signal processing capabilities. The processor 113 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (digital signal processor, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field Programmable Gate Arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The gateway apparatus 100 in the present embodiment may be used to perform each step in each method provided in the embodiments of the present application. The implementation of the data forwarding method is described in detail below by means of several embodiments.
Example two
Fig. 3 is a flowchart of a data forwarding method according to an embodiment of the present application. The specific flow shown in fig. 3 will be described in detail.
And 310, acquiring a message to be processed through the acquisition end and the forwarding end.
The data forwarding method in the embodiment can be applied to gateway equipment, and the gateway equipment comprises an acquisition end and a forwarding end.
In this embodiment, after receiving the message to be processed, the gateway device may store the message to be processed in the shared memory of the gateway device, so that the acquisition end and the forwarding end of the gateway device may read the photo in the shared memory.
Before step 310, a message to be processed may be received and stored in the shared memory.
Step 310 may include: the acquisition end acquires the message to be processed from the shared memory; step 310 may include: the forwarding end obtains the message to be processed from the shared memory.
And 320, analyzing the message to be processed, determining parameters of the message to be processed, and feeding back an analysis result to display equipment connected with the gateway equipment so that the display equipment can update the current processing data record information.
For example, the message to be processed may include parameters such as a function code, an address, a value, and a data type.
The acquisition end can analyze each field in the message to be processed to determine parameters such as function codes, addresses, values, data types and the like carried in the message to be processed.
The message to be processed can be analyzed according to the industrial protocol corresponding to the message to be processed, so as to determine parameters such as function codes, addresses, values, data types and the like carried in the message to be processed.
The industrial protocol may be a unique industrial protocol stored in the gateway device in advance, and when the acquisition end and the forwarding end of the gateway device need to parse the message, the message may be parsed based on the unique industrial protocol.
Alternatively, the gateway device may also store multiple industrial protocols, and different messages may correspond to different industrial protocols. When the message to be processed needs to be analyzed, the required message protocol can be determined according to the message type.
The method in the embodiment is also applied to the field of industrial control, and the display device can be used for displaying parameters such as working progress and the like involved in the industrial control process. For example, the display device may have pre-established industrial control data stored thereon. The industrial control data are used for recording the production progress of corresponding industrial control.
Alternatively, the industrial control data may be presented in the form of a table or in the form of a graph.
The collecting end can update the analysis result of the message to be processed in the collecting end. And the display equipment updates the industrial control data according to the analysis result stored in the acquisition end.
The analysis result may include one or more parameters of function code, address, value, data type, etc. in the message to be processed.
And 330, processing the message to be processed through the forwarding end to obtain a target message, and forwarding the target message to a server.
In this embodiment, the forwarding end may analyze and process the to-be-processed message to obtain parameters such as a function code, a data type, an address, and a value carried in the to-be-processed message.
For example, there may be some formats of messages sent by the client that are different from the formats required by the server, and before the forwarding end forwards the data, the forwarding end may also convert the format of the message to be processed based on the formats required by the client, so as to obtain the target message in the target format that meets the requirements of the server.
Based on this, step 330 may be implemented as: analyzing the message to be processed to obtain parameters in the message to be processed; and converting the parameters in the message to be processed to obtain a target message in a target format required by the server.
In one example, the message obtained by the forwarding end is a modbus message, and the protocol set by the forwarding end is a dnp protocol message. The information carried in the acquired message to be processed can be spliced into a dnp protocol message set by the server.
In some cases, in the message transmission process, a complete message may not be directly transmitted, and the message may be fragmented during transmission, and then the fragmented message is transmitted step by step.
Step 330 may include step 331 and step 332.
Step 331, determining whether the message to be processed is a complete message.
Optionally, whether the message to be processed is a complete message may be determined according to the specified identifier in the message to be processed.
For example, the message to be processed may include a field for recording the number of fragments of the complete message corresponding to the current message to be processed and the number of fragments to which the current message to be processed belongs. The data recorded in the field is the specified identification, and whether the message to be processed is a complete message is determined according to the specified identification.
Optionally, the position of the designated identifier can be determined according to an industrial control protocol corresponding to the message to be processed, and whether the message to be processed is a complete message is determined according to the value of the position of the designated identifier.
The value in the location of the specified identifier may be used to characterize whether the message to be processed is a complete message, or may be used to characterize the number of fragments in the complete message to which the message to be processed belongs.
Optionally, it may also be determined whether the message to be processed is a complete message by analyzing parameters obtained from the message to be processed. The industrial control protocol corresponding to the message to be processed needs to include n parameters in the complete message, but the parameters obtained by analyzing the message to be processed only include m parameters, so that the message to be processed can be characterized as not being the complete message. Wherein n is a positive integer, and m is a positive integer smaller than n.
If the message to be processed is an incomplete message, step 332 is performed.
Step 332, after obtaining all the messages corresponding to the to-be-processed message, processing all the messages corresponding to the to-be-processed message to obtain the target message.
For example, the message that is not complete may be temporarily stored first, and after the gateway device receives the complete message, the forwarding end processes the complete message.
In an alternative embodiment, step 332 may include: storing the message to be processed into a designated memory; after the gateway equipment receives all messages corresponding to the messages to be processed, acquiring all messages corresponding to the messages to be processed from the appointed memory; and processing all the messages corresponding to the message to be processed to obtain a target message.
Alternatively, the specified memory may be a shared memory that can be accessed by both the acquisition side and the forwarding side.
In order to make the acquired data be the fragmented message under the same complete message, the fragmented message needing to wait for other fragmented messages can be marked, and the message is stored in the appointed memory after marking.
The storing the message to be processed into the specified memory may include: marking the message to be processed, and storing the marked message to be processed into a designated memory.
Optionally, the tag content may include a keyword and a fragment bit to which the message to be processed belongs. The key may be, for example, an identification of a complete message to which the message to be processed belongs. The slicing bit may indicate which slicing message the message to be processed belongs to.
In this embodiment, for some parameters that can be determined without a complete message, when the forwarding end receives a message to be processed, the message to be processed may be parsed to determine preliminary information.
For example, the parameter that can be determined without a complete message may be a data type or the like.
In an alternative embodiment, for some parameters that can be determined by the complete message, after the gateway device receives the complete message, the forwarding end analyzes the complete message to determine the determinable information.
For example, the parameters that can be determined by the complete message may be addresses, function codes, values, etc.
In another optional implementation manner, for some parameters that can be determined by the complete message, after obtaining all the messages corresponding to the message to be processed, processing all the messages corresponding to the message to be processed, where obtaining the target message may include step a and step b.
And a step a, processing the message to be processed to determine the local parameters corresponding to the message to be processed.
The local parameter may be, for example, a partial address carried in the current message to be processed. The current message to be processed is a fragmented message of one fragment.
Illustratively, the industrial control corresponding to the data forwarding method in this embodiment needs to update N1 processing nodes each time, where each processing node includes an address and a value. The local parameter is one or less than N1 addresses and values.
And b, updating the current parameter by using the local parameter, wherein the current parameter is empty before the local parameter of the first fragmented message is obtained.
And c, repeatedly executing the step a and the step b to realize the processing of other fragmented messages corresponding to the message to be processed until the current parameter is a complete parameter.
For example, if the local parameter is a local address, the complete parameter is a complete address.
For example, whether the current parameter is a complete parameter may be determined by an industrial control protocol to which the message to be processed belongs.
Taking the above example as an example, it may be determined whether the current parameter is a complete parameter according to whether the current parameter includes N1 addresses and N1 values.
And c, processing the determined current parameters to obtain a target message.
Of course, parameters that need to be determined based on the complete message may also be different according to the industrial control protocol, and thus, the embodiment of the present application is not limited to the above example.
According to the data processing method provided by the embodiment of the application, the time required for processing the data forwarding can be greatly shortened, so that the data processing capacity can be greatly improved. Further, in this embodiment of the present application, a shared memory may be further provided, after connection is established, after the industrial control packet enters the gateway device, the data packet is changed through the identifier, and the collecting end and the forwarding end acquire the data stream simultaneously, and each process its own logic, without waiting for the processing of the collecting end to complete, and the forwarding end processes the data stream.
Further, due to the fact that the collecting end and the forwarding end can synchronously receive the message to be processed, the collecting end and the forwarding end can synchronously and respectively process the message to be processed, and compared with the fact that the collecting end and the forwarding end process the message successively, time is shortened by nearly one time in time.
Further, the collecting end and the forwarding end can synchronously and respectively process the message to be processed, and after processing, the collecting end and the forwarding end can transmit corresponding processing information back to the display equipment and the server. Therefore, the data synchronization of the acquisition end and the forwarding end can be realized, and the real-time data change frequency is the same.
For some fragmented messages, as long as gateway equipment receives the messages, the messages can be analyzed, and parameters which can be determined only by the complete messages in the analysis process can be stored first until the complete messages are acquired and then processed, so that the relative processing time can be reduced, and the processing capacity of the data packet can be increased.
Example III
Based on the same application conception, the embodiment of the present application further provides a data forwarding device corresponding to the data forwarding method, and since the principle of the device in the embodiment of the present application for solving the problem is similar to that of the foregoing embodiment of the data forwarding method, the implementation of the device in the embodiment of the present application may refer to the description in the embodiment of the foregoing method, and the repetition is omitted.
Fig. 4 is a schematic functional block diagram of a data forwarding device according to an embodiment of the present application. The modules in the data forwarding device in this embodiment are configured to perform the steps in the foregoing method embodiment. The data forwarding device includes: the device comprises an acquisition module 410, a first processing module 420, a second processing module 430 and a forwarding module 440; wherein,
an obtaining module 410, configured to obtain a message to be processed through the collecting end and the forwarding end;
the first processing module 420 is configured to analyze the to-be-processed packet through the collecting end, determine parameters of the to-be-processed packet, and feed back an analysis result to a display device connected to the gateway device, so that the display device updates current processing data record information;
the second processing module 430 is configured to process the message to be processed through the forwarding end to obtain a target message;
and the forwarding module 440 is configured to forward the target packet to a server through the forwarding end.
In a possible implementation, the second processing module 430 includes: a judging unit and a processing unit.
The judging unit is used for judging whether the message to be processed is a complete message or not;
and the processing unit is used for processing all the messages corresponding to the message to be processed after acquiring all the messages corresponding to the message to be processed if the message to be processed is an incomplete message, so as to obtain a target message.
In a possible implementation manner, the second processing module 430 is configured to:
storing the message to be processed into a designated memory;
after the gateway equipment receives all messages corresponding to the messages to be processed, acquiring all messages corresponding to the messages to be processed from the appointed memory;
and processing all the messages corresponding to the message to be processed to obtain a target message.
In a possible implementation manner, the second processing module 430 is further configured to:
marking the message to be processed, and storing the marked message to be processed into a designated memory.
In a possible implementation manner, the judging unit is configured to: and judging whether the message to be processed is a complete message or not according to the appointed mark in the message to be processed.
In a possible embodiment, the processing unit is configured to:
and processing the current message to be processed to determine the local parameters corresponding to the message to be processed.
Updating the current parameter by using the local parameter, wherein when the current message to be processed is a fragmented message of the first fragment, the current parameter is empty, and the steps are repeatedly executed until the current parameter is a complete parameter;
and if the current parameter is the complete parameter, processing the current parameter to obtain the target message.
In a possible implementation manner, the second processing module 430 is configured to:
analyzing the message to be processed to obtain parameters in the message to be processed;
and converting the parameters in the message to be processed to obtain a target message in a target format required by the server.
In a possible implementation manner, the gateway device includes a shared memory, where the shared memory is used to store the messages that need to be processed by the collecting end and the forwarding end; the data forwarding device in this embodiment may further include:
the storage module is used for receiving a message to be processed and storing the message to be processed in the shared memory;
the obtaining module 410 is further configured to: and acquiring a message to be processed from the shared memory through the acquisition end and the forwarding end.
Furthermore, the embodiments of the present application also provide a computer readable storage medium, on which a computer program is stored, which when executed by a processor performs the steps of the data forwarding method described in the above-mentioned method embodiments.
The computer program product of the data forwarding method provided in the embodiments of the present application includes a computer readable storage medium storing program codes, where the instructions included in the program codes may be used to execute the steps of the data forwarding method described in the method embodiments, and specifically, reference may be made to the method embodiments, which are not described herein.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners as well. The apparatus embodiments described above are merely illustrative, for example, flow diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes. It is noted that relational terms such as first and second, and the like are 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. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the same, but rather, various modifications and variations may be made by those 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. It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A data forwarding method, which is applied to a gateway device, wherein the gateway device includes an acquisition end and a forwarding end, the method includes:
acquiring a message to be processed through the acquisition end and the forwarding end;
analyzing the message to be processed through the acquisition end, determining parameters of the message to be processed, and feeding back an analysis result to display equipment connected with the gateway equipment so as to update the current processing data record information by the display equipment;
processing the message to be processed through the forwarding end to obtain a target message, and forwarding the target message to a server;
the processing of the message to be processed through the forwarding end to obtain a target message comprises the following steps:
judging whether the message to be processed is a complete message or not;
and if the message to be processed is an incomplete message, after all the messages corresponding to the message to be processed are acquired, processing all the messages corresponding to the message to be processed to obtain a target message.
2. The method according to claim 1, wherein after the obtaining all the messages corresponding to the to-be-processed message, processing all the messages corresponding to the to-be-processed message to obtain the target message includes:
storing the message to be processed into a designated memory;
after the gateway equipment receives all messages corresponding to the messages to be processed, acquiring all messages corresponding to the messages to be processed from the appointed memory;
and processing all the messages corresponding to the message to be processed to obtain a target message.
3. The method of claim 2, wherein storing the message to be processed in the designated memory comprises:
marking the message to be processed, and storing the marked message to be processed into a designated memory.
4. The method according to claim 1, wherein the determining whether the message to be processed is a complete message comprises:
and judging whether the message to be processed is a complete message or not according to the appointed mark in the message to be processed.
5. The method according to claim 1, wherein after the obtaining all the messages corresponding to the to-be-processed message, processing all the messages corresponding to the to-be-processed message to obtain the target message includes:
processing the current message to be processed to determine the local parameters corresponding to the message to be processed;
updating the current parameter by using the local parameter, wherein when the current message to be processed is a fragmented message of the first fragment, the current parameter is empty, and the steps are repeatedly executed until the current parameter is a complete parameter;
and if the current parameter is the complete parameter, processing the current parameter to obtain the target message.
6. The method according to claim 1, wherein the processing the message to be processed by the forwarding end to obtain a target message includes:
analyzing the message to be processed to obtain parameters in the message to be processed;
and converting the parameters in the message to be processed to obtain a target message in a target format required by the server.
7. The method according to any one of claims 1-6, wherein the gateway device includes a shared memory, where the shared memory is used to store the messages to be processed by the collecting end and the forwarding end; the method further comprises the steps of:
receiving a message to be processed, and storing the message to be processed in the shared memory;
the step of obtaining the message to be processed through the collecting end and the forwarding end comprises the following steps: and acquiring a message to be processed from the shared memory through the acquisition end and the forwarding end.
8. A data forwarding apparatus, applied to a gateway device, where the gateway device includes an acquisition end and a forwarding end, the apparatus includes:
the acquisition module is used for acquiring the message to be processed through the acquisition end and the forwarding end;
the first processing module is used for analyzing the message to be processed through the acquisition end, determining parameters of the message to be processed, and feeding back an analysis result to display equipment connected with the gateway equipment so as to update the current processing data record information by the display equipment;
the second processing module is used for processing the message to be processed through the forwarding end to obtain a target message;
the forwarding module is used for forwarding the target message to a server through the forwarding end; the processing of the message to be processed through the forwarding end to obtain a target message comprises the following steps: judging whether the message to be processed is a complete message or not; and if the message to be processed is an incomplete message, after all the messages corresponding to the message to be processed are acquired, processing all the messages corresponding to the message to be processed to obtain a target message.
9. A gateway device, comprising: a processor, a memory storing machine-readable instructions executable by the processor, which when executed by the processor perform the steps of the method of any of claims 1 to 7 when the electronic device is run.
10. A computer-readable storage medium, characterized in that it has stored thereon a computer program which, when executed by a processor, performs the steps of the method according to any of claims 1 to 7.
CN202111272290.1A 2021-10-29 2021-10-29 Data forwarding method, device, gateway equipment and computer readable storage medium Active CN113973111B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111272290.1A CN113973111B (en) 2021-10-29 2021-10-29 Data forwarding method, device, gateway equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111272290.1A CN113973111B (en) 2021-10-29 2021-10-29 Data forwarding method, device, gateway equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113973111A CN113973111A (en) 2022-01-25
CN113973111B true CN113973111B (en) 2023-12-22

Family

ID=79589095

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111272290.1A Active CN113973111B (en) 2021-10-29 2021-10-29 Data forwarding method, device, gateway equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113973111B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979064B (en) * 2022-08-01 2022-10-21 北京天融信网络安全技术有限公司 OPCDA message processing method, device, electronic equipment and storage medium
CN118488095A (en) * 2024-07-15 2024-08-13 北京融为科技有限公司 Data processing method, forwarding equipment and data transmission system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1534933A (en) * 2003-03-28 2004-10-06 华为技术有限公司 Safety access control method for internet protocol
CN105808587A (en) * 2014-12-31 2016-07-27 中国电信股份有限公司 Method and system for embedding information into webpage and gateway device
WO2017032178A1 (en) * 2015-08-27 2017-03-02 深圳市中兴微电子技术有限公司 Checksum calculation method, network processor and computer storage medium
WO2021057889A1 (en) * 2019-09-26 2021-04-01 北京金山云网络技术有限公司 Data processing method and apparatus, electronic device, and storage medium
CN113518127A (en) * 2021-07-15 2021-10-19 罗慧 Industrial Internet of things information integration platform

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1534933A (en) * 2003-03-28 2004-10-06 华为技术有限公司 Safety access control method for internet protocol
CN105808587A (en) * 2014-12-31 2016-07-27 中国电信股份有限公司 Method and system for embedding information into webpage and gateway device
WO2017032178A1 (en) * 2015-08-27 2017-03-02 深圳市中兴微电子技术有限公司 Checksum calculation method, network processor and computer storage medium
WO2021057889A1 (en) * 2019-09-26 2021-04-01 北京金山云网络技术有限公司 Data processing method and apparatus, electronic device, and storage medium
CN113518127A (en) * 2021-07-15 2021-10-19 罗慧 Industrial Internet of things information integration platform

Also Published As

Publication number Publication date
CN113973111A (en) 2022-01-25

Similar Documents

Publication Publication Date Title
CN113973111B (en) Data forwarding method, device, gateway equipment and computer readable storage medium
CN112235326B (en) Internet of things equipment data analysis method and device and electronic equipment
US10084713B2 (en) Protocol type identification method and apparatus
CN111130883B (en) Method and device for determining topological graph of industrial control equipment and electronic equipment
CN112311774B (en) Data processing method and device, electronic equipment and storage medium
CN108229159B (en) Malicious code detection method and system
EP3364601A1 (en) Testing method, device and system
CN109474614B (en) Multi-protocol analysis method and system
WO2022179353A1 (en) Domain name resolution method and apparatus, and computer device
CN112995133A (en) Analysis method, device and system based on modbus protocol
CN111224878B (en) Route forwarding method and device, electronic equipment and storage medium
CN107124483A (en) Domain name analytic method and server
CN104506450A (en) Media resource feedback method and device
CN115208951A (en) Request processing method and device, electronic equipment and computer readable storage medium
WO2017000572A1 (en) Internet content adaptation protocol-based communication method, client and server
CN114172980A (en) Method, system, device, equipment and medium for identifying type of operating system
CN111064729B (en) Message processing method and device, storage medium and electronic device
CN113055420B (en) HTTPS service identification method and device and computing equipment
CN115134380A (en) Data transmission method and device, electronic equipment and storage medium
CN116962348A (en) Domain name resolution-based video flow processing method, system and electronic equipment
CN114070761B (en) Protocol message detection method and device and electronic equipment
CN113765722B (en) Configurable multi-protocol message processing method and device and electronic equipment
CN107592374B (en) Correction method and system for domain name error resolution
CN115801927A (en) Message parsing method and device
CN109462496B (en) Data processing method and device for video network terminal

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
TA01 Transfer of patent application right

Effective date of registration: 20231130

Address after: Room 103-060, 1st Floor, Building 1, No. 18 Futian Road, Xiangzhou District, Zhuhai City, Guangdong Province, 519000 (centralized office area)

Applicant after: Zhuhai Tianrongxin Network Security Technology Co.,Ltd.

Applicant after: Beijing Topsec Network Security Technology Co.,Ltd.

Applicant after: Topsec Technologies Inc.

Applicant after: BEIJING TOPSEC SOFTWARE Co.,Ltd.

Address before: 100000 4th floor, building 3, yard 1, Shangdi East Road, Haidian District, Beijing

Applicant before: Beijing Topsec Network Security Technology Co.,Ltd.

Applicant before: Topsec Technologies Inc.

Applicant before: BEIJING TOPSEC SOFTWARE Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant