CN108924200B - Message processing method and device - Google Patents

Message processing method and device Download PDF

Info

Publication number
CN108924200B
CN108924200B CN201810647318.7A CN201810647318A CN108924200B CN 108924200 B CN108924200 B CN 108924200B CN 201810647318 A CN201810647318 A CN 201810647318A CN 108924200 B CN108924200 B CN 108924200B
Authority
CN
China
Prior art keywords
message
processing
tcp
state
state machine
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
CN201810647318.7A
Other languages
Chinese (zh)
Other versions
CN108924200A (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.)
State Grid Corp of China SGCC
Electric Power Research Institute of State Grid Shandong Electric Power Co Ltd
State Grid Shandong Electric Power Co Ltd
Beijing Kedong Electric Power Control System Co Ltd
Original Assignee
State Grid Corp of China SGCC
Electric Power Research Institute of State Grid Shandong Electric Power Co Ltd
State Grid Shandong Electric Power Co Ltd
Beijing Kedong Electric Power Control System 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 State Grid Corp of China SGCC, Electric Power Research Institute of State Grid Shandong Electric Power Co Ltd, State Grid Shandong Electric Power Co Ltd, Beijing Kedong Electric Power Control System Co Ltd filed Critical State Grid Corp of China SGCC
Priority to CN201810647318.7A priority Critical patent/CN108924200B/en
Publication of CN108924200A publication Critical patent/CN108924200A/en
Application granted granted Critical
Publication of CN108924200B publication Critical patent/CN108924200B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/142Managing session states for stateless protocols; Signalling session states; State transitions; Keeping-state mechanisms
    • 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

Abstract

The invention provides a message processing and device, which relates to the technical field of power distribution communication of a power system and comprises the steps of receiving a TCP message to be processed; determining a message processing mode and the next state of the state machine according to the message header of the TCP message and the initial state of the state machine; and processing the TCP message according to the message processing mode, and updating the initial state of the state machine to the next state. The problems that whether a message is received or not is difficult to judge by an existing TCP state machine, processing of the message is easy to omit due to the fact that the message is sent by the existing TCP state machine, codes are complex, and maintenance is not easy are solved, the problem that the message processing is easy to omit due to the fact that the current state of the message cannot be distinguished is solved, the complexity of the codes is reduced, and the code robustness and maintainability are enhanced.

Description

Message processing method and device
Technical Field
The invention relates to the technical field of power distribution communication of a power system, in particular to a message processing method and a message processing device.
Background
According to the requirements of the national grid company, the power distribution automation system is serially connected to a power distribution safety interactive gateway between a power distribution main station and a power distribution terminal. Because the power distribution safety interactive gateway needs to forward and process the message between the power distribution main station and the power distribution terminal, the communication mode of the connection between the power distribution main station and the power distribution terminal is changed into the connection between the power distribution main station, the power distribution safety interactive gateway and the power distribution terminal.
At present, the existing power distribution security interaction gateway only performs corresponding processing according to the message information of the received message, for example: when the SYN message sent by the master station is received, action a is executed under the condition that no message is received, and when the last message received is the SYN message sent by the terminal, action B is executed under the condition that the last message received is the SYN message sent by the master station, the following pseudo codes are needed:
if (direction & type & IS _ SYN & no received message from master station)
{
Action(A);
}
if (direction & type & IS _ SYNACK & SYN of last message for terminal transmission)
{
Action(B);
}
In practical application, two situations, namely 'no message is received' and 'the last message received is SYN sent by a terminal', are difficult to judge, so that the processing of the messages is easy to miss, the codes are complex and the maintenance is difficult.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a method and an apparatus for processing a message, so as to solve the problems in the prior art that the message processing is easy to miss, the code is complex, and the maintenance is not easy.
In a first aspect, an embodiment of the present invention provides a packet processing method, which is applied to a power distribution security interaction gateway, where a TCP state machine is built in the power distribution security interaction gateway, and the power distribution security interaction gateway is connected to a power distribution master station and a power distribution terminal in a power distribution network, respectively, where the method includes:
receiving a TCP message to be processed;
determining a message processing mode and the next state of the state machine according to the message header of the TCP message and the initial state of the state machine;
and processing the TCP message according to the message processing mode, and updating the initial state of the state machine to the next state.
With reference to the first aspect, an embodiment of the present invention provides a first possible implementation manner of the first aspect, where the determining, according to a packet header of the TCP packet and an initial state of the state machine, a packet processing method and a next state of the state machine includes:
determining the message characteristics of the TCP message according to the message header of the TCP message;
and inputting the message characteristics into the state machine so that the state machine determines the processing mode and the next state of the TCP message according to a preset state transition table and the current initial state.
With reference to the first aspect, an embodiment of the present invention provides a second possible implementation manner of the first aspect, where before receiving a TCP packet to be processed, the method further includes:
setting a TCP state machine and a preset state transition table in the TCP state machine according to the message characteristics and the message processing mode configured by a user, wherein the state transition table comprises a plurality of groups of corresponding relations among the initial state, the message characteristics, the next state and the processing mode.
With reference to the first aspect, an embodiment of the present invention provides a third possible implementation manner of the first aspect, where the processing the TCP packet according to the packet processing manner includes:
and carrying out transparent transmission processing or discarding processing on the TCP message.
In a second aspect, an embodiment of the present invention further provides a packet processing apparatus, including:
the receiving module is used for receiving the TCP message to be processed;
a determining module, configured to determine a packet processing mode and a next state of the state machine according to a packet header of the TCP packet and an initial state of the state machine;
and the processing module is used for processing the TCP message according to the message processing mode and updating the initial state of the state machine to the next state.
With reference to the second aspect, an embodiment of the present invention provides a first possible implementation manner of the second aspect, where the determining module includes:
a first determining unit, configured to determine a packet feature of the TCP packet according to a packet header of the TCP packet;
and the second determining unit is used for inputting the message characteristics to the state machine so that the state machine determines the processing mode and the next state of the TCP message according to a preset state transition table and the current initial state.
With reference to the second aspect, an embodiment of the present invention provides a second possible implementation manner of the second aspect, where the receiving module further includes:
the setting module is used for setting a TCP state machine and a state transition table preset in the TCP state machine according to the message characteristics and the message processing mode configured by a user, wherein the state transition table comprises a plurality of groups of corresponding relations among the initial state, the message characteristics, the next state and the processing mode.
With reference to the second aspect, an embodiment of the present invention provides a third possible implementation manner of the second aspect, where the processing module includes:
and the processing unit is used for carrying out transparent transmission processing or discarding processing on the TCP message.
In a third aspect, the present invention also provides an electronic device, including a memory and a processor, where the memory stores a computer program that is executable on the processor, and when the processor executes the computer program, the method of the first aspect is implemented.
In a fourth aspect, the present invention further provides a computer-readable medium having non-volatile program code executable by a processor, where the program code causes the processor to execute the method of the first aspect.
The embodiment of the invention has the following beneficial effects: the embodiment of the invention receives a TCP message to be processed; then determining a message processing mode and the next state of the state machine according to the message header of the TCP message and the initial state of the state machine; and finally, processing the TCP message according to the message processing mode, and updating the initial state of the state machine to the next state.
The embodiment of the invention can determine the message processing mode based on the initial state of the state machine when the TCP message is received, and can realize different processing on the TCP message on the gateway according to the determined message processing mode at different transmission stages of the message between the power distribution main station and the power distribution terminal. Moreover, after the TCP message is processed, the initial state of the state machine is updated, the TCP message is convenient to use when the next TCP message is received, the problem that the message processing is omitted due to the fact that the current transmission stage of the message cannot be distinguished is solved, the code complexity is reduced, and the code robustness and maintainability are enhanced.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of message processing according to an embodiment of the present invention;
FIG. 2 is a flowchart of step S102 in FIG. 1;
FIG. 3 is a flow diagram of a TCP state machine;
fig. 4 is a structural diagram of a message processing apparatus according to an embodiment of the present invention.
Icon: 11-a receiving module; 12-a determination module; 13-processing module.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
At present, an existing power distribution safety interactive gateway executes action a when receiving a SYN message sent by a master station under the condition that no message is received, and executes action B when receiving a SYN ack message sent by the master station under the condition that a last received message is SYN sent by a terminal. The message processing method and the message processing device provided by the embodiment of the invention can determine the message processing mode based on the initial state of the state machine when the TCP message is received, and can realize different processing on the TCP message on the gateway according to the determined message processing mode at different transmission stages of the message between the power distribution main station and the power distribution terminal. Moreover, after the TCP message is processed, the initial state of the state machine is updated, the TCP message is convenient to use when the next TCP message is received, the problem that the message processing is omitted due to the fact that the current transmission stage of the message cannot be distinguished is solved, the code complexity is reduced, and the code robustness and maintainability are enhanced.
To facilitate understanding of the embodiment, first, a detailed description is given to a message processing method disclosed in the embodiment of the present invention, and as shown in fig. 1, the message processing method may be applied to a power distribution security interaction gateway, where a TCP state machine is built in the power distribution security interaction gateway, and the power distribution security interaction gateway is respectively connected to a power distribution master station and a power distribution terminal in a power distribution network, and includes the following steps:
step S101, receiving a TCP message to be processed;
in the embodiment of the present invention, as shown in the first column in the state transition tables in table 1 and table 2 below, for example, the TCP packet may be an F _ SYN packet, an R _ SYN packet, an F _ SYN/ACK packet, an R _ SYN/ACK packet, an F _ ACK packet, an R _ ACK packet, an F _ FIN packet, an R _ FIN packet, an F _ FIN/ACK packet, an R _ FIN/ACK packet, an RST packet, an F _ PUSH packet, an R _ PUSH packet, an F _ PUSH/ACK packet, and an R _ PUSH/ACK packet.
TABLE 1
Figure BDA0001703301380000061
Figure BDA0001703301380000071
TABLE 2
Figure BDA0001703301380000072
Figure BDA0001703301380000081
In the embodiment of the present invention, the TCP message to be processed may be sent by the power distribution master station or sent by the power distribution terminal.
Step S102, determining a message processing mode and the next state of the state machine according to the message header of the TCP message and the initial state of the state machine;
in the embodiment of the invention, the message header of the TCP message contains message characteristics;
the state machines have 13 states in common, and as shown in the first row of tables 1 and 2, there are exemplary CLOSED, SYN _ S _ send, SYN _ T _ send, SYN _ S _ RCVD, SYN _ T _ RCVD, ESTABLISHED, S _ FIN _ WAIT1, T _ FIN _ WAIT1, S _ FIN _ WAIT2, T _ FIN _ WAIT2, ST _ FIN _ WAIT, S _ close, T _ close, and the like. The starting state of the state machine refers to the current state of the state machine. The next state of the state machine is the next state to which the state machine ends the current state switching.
In practical application, there are two message processing manners, which are transparent transmission processing and discarding processing, specifically, the transparent transmission processing may include: normal transparent transmission, retransmission transparent transmission, uncommon transparent transmission and the like, wherein the normal transparent transmission refers to a state machine transparent transmission message according to a Request For Comments (RFC For short); the retransmission transparent transmission refers to that the transparent transmission message of the state machine returns to the current state and then is transmitted again; the unusual transparent transmission refers to the unusual normal transparent transmission in practical application. The discard processing refers to illegal discard in table 1 and table 2.
Step S103, processing the TCP message according to the message processing mode, and updating the initial state of the state machine to the next state.
The embodiment of the invention can determine the message processing mode based on the initial state of the state machine when the TCP message is received, and can realize different processing on the message on the gateway according to the determined message processing mode at different transmission stages of the message between the power distribution main station and the power distribution terminal. Moreover, after the TCP message is processed, the initial state of the state machine is updated, the TCP message is convenient to use when the next TCP message is received, the problem that the message processing is omitted due to the fact that the current transmission stage of the message cannot be distinguished is solved, the code complexity is reduced, and the code robustness and maintainability are enhanced.
In another embodiment of the present invention, as shown in fig. 2, the step S102 may include the steps of:
step S201, determining the message characteristics of the TCP message according to the message header of the TCP message.
In the embodiment of the present invention, the packet characteristics of the TCP packet include a sending direction and a packet type. In practical applications, there are two transmission directions, where the F _ beginning packet represents a packet from the master station to the terminal, and the R _ beginning packet represents a packet from the terminal to the master station. The message types include SYN, ACK, FIN, RST, PUSH, and the like, and the message contents may be specifically designed according to specific situations. SYN indicates establishment of a connection, ACK indicates a response, FIN indicates closing of the connection, RST indicates connection reset, and PUSH indicates DATA transmission. Illustratively, F _ ACK indicates a message sent from the master station to the terminal, and the content is a response, and R _ SYN indicates a message sent from the terminal to the master station, and the content is a connection establishment message.
Step S202, inputting the message characteristics into the state machine, so that the state machine determines the processing mode and the next state of the TCP message according to a preset state transition table and the current initial state.
Illustratively, the current state of the state machine is a CLOSED state, a message characteristic F _ SYN is input to the state machine, according to a preset state transition table, it may be determined that a processing manner of a TCP message is transparent transmission, and the next state is SYN _ S _ send.
In the embodiment of the invention, the message processing mode and the next state of the state machine can be determined according to the message header of the TCP message and the initial state of the state machine, so that a basis is provided for the next message processing.
In another embodiment of the present invention, the step S101 further includes:
setting a TCP state machine and a preset state transition table in the TCP state machine according to the message characteristics and the message processing mode configured by a user, wherein the state transition table comprises a plurality of groups of corresponding relations among the initial state, the message characteristics, the next state and the processing mode.
As shown in fig. 3, an ellipse of the TCP state machine indicates a state of the state machine, an arrow indicates a state transition direction, a character carried on the arrow indicates a message, and the arrow indicates a next state from a current state of the state machine.
As shown in fig. 3, a first row of a preset state transition table in the TCP state machine represents a current state of the state machine, a first column represents a received packet, and information at other positions represents a next state of the state machine and a packet processing mode. Therefore, the state transition table includes a plurality of sets of initial states, message characteristics, next states, and corresponding relationships between processing modes.
The embodiment of the invention can be used for conveniently determining the next state of the state machine and the message processing mode by utilizing the set TCP state machine and the preset state transition table in the TCP state machine.
In another embodiment of the present invention, the step S103 includes:
and carrying out transparent transmission processing or discarding processing on the TCP message.
The transparent transmission processing is a mode of message processing, that is, in the current state, the received message is transparent transmitted, and the state machine is updated to the next state according to a preset state transition table of the state machine. Illustratively, the current state is SYN _ S _ send, and if the received message is R _ SYN/ACK, the state machine updates to the next state SYN _ S _ RCVD according to a preset state transition table of the state machine.
The discard processing is another way of processing the message, that is, in the current state, the state machine will return to the CLOSED initialization state to discard the received message. Illustratively, the current state is SYN _ S _ send, and if the received message is F _ SYN/ACK, the state machine returns to the CLOSED initialization state according to a preset state transition table of the state machine.
By the embodiment of the invention, the message can be processed in a transparent transmission or discarding mode.
In yet another embodiment of the present invention, as shown in fig. 4, the apparatus may include the following modules:
a receiving module 11, configured to receive a TCP packet to be processed;
a determining module 12, configured to determine a packet processing mode and a next state of the state machine according to a packet header of the TCP packet and an initial state of the state machine;
and the processing module 13 is configured to process the TCP packet according to the packet processing mode, and update the initial state of the state machine to the next state.
The device provided by the embodiment of the present invention has the same implementation principle and technical effect as the method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the method embodiments without reference to the device embodiments.
In another embodiment of the present invention, the determining module includes:
a first determining unit, configured to determine a packet feature of the TCP packet according to a packet header of the TCP packet;
and the second determining unit is used for inputting the message characteristics to the state machine so that the state machine determines the processing mode and the next state of the TCP message according to a preset state transition table and the current initial state.
In another embodiment of the present invention, the receiving module further comprises:
the setting module is used for setting a TCP state machine and a state transition table preset in the TCP state machine according to the message characteristics and the message processing mode configured by a user, wherein the state transition table comprises a plurality of groups of corresponding relations among the initial state, the message characteristics, the next state and the processing mode.
In another embodiment of the present invention, the processing module includes:
and the processing unit is used for carrying out transparent transmission processing or discarding processing on the TCP message.
In yet another embodiment of the invention, a computer-readable medium having non-volatile program code executable by a processor, the program code causing the processor to perform the method of the method embodiment is also provided.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. 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.
The computer program product of the message processing method provided in the embodiment of the present invention includes a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiment, and specific implementation may refer to the method embodiment, which is not described herein again.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In addition, in the description of the embodiments of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
The functions, if implemented in the form of software functional units 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 invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (6)

1. A message processing method is characterized in that the message processing method is applied to a power distribution safety interaction gateway, a TCP state machine is arranged in the power distribution safety interaction gateway, and the power distribution safety interaction gateway is respectively connected with a power distribution main station and a power distribution terminal in a power distribution network, and the method comprises the following steps:
receiving a TCP message to be processed;
determining a message processing mode and the next state of the state machine according to the message header of the TCP message and the initial state of the state machine; the message processing mode comprises the following steps: pass through processing and abandon the processing, pass through the processing and include: normal transparent transmission, retransmission transparent transmission and uncommon transparent transmission; the next state includes at least one of: CLOSED, SYN _ S _ send, SYN _ T _ send, SYN _ S _ RCVD, SYN _ T _ RCVD, ESTABLISHED, S _ FIN _ WAIT1, T _ FIN _ WAIT1, S _ FIN _ WAIT2, T _ FIN _ WAIT2, ST _ FIN _ WAIT, S _ CLOSING, and T _ CLOSING;
processing the TCP message according to the message processing mode, and updating the initial state of the state machine to the next state;
the determining a message processing mode and a next state of the state machine according to the message header of the TCP message and the initial state of the state machine includes:
determining the message characteristics of the TCP message according to the message header of the TCP message; the message characteristics of the TCP message include a sending direction and a message type, and the message type includes at least one of the following: SYN, ACK, FIN, RST and PUSH;
inputting the message characteristics into the state machine so that the state machine determines the processing mode and the next state of the TCP message according to a preset state transition table and the current initial state;
before receiving the TCP message to be processed, the method further includes:
setting a TCP state machine and a preset state transition table in the TCP state machine according to the message characteristics and the message processing mode configured by a user, wherein the state transition table comprises a plurality of groups of corresponding relations among the initial state, the message characteristics, the next state and the processing mode.
2. The message processing method according to claim 1, wherein the processing the TCP message according to the message processing manner includes:
and carrying out transparent transmission processing or discarding processing on the TCP message.
3. A message processing apparatus, comprising:
the receiving module is used for receiving the TCP message to be processed;
the determining module is used for determining a message processing mode and the next state of the state machine according to the message header of the TCP message and the initial state of the state machine; the message processing mode comprises the following steps: pass through processing and abandon the processing, pass through the processing and include: normal transparent transmission, retransmission transparent transmission and uncommon transparent transmission; the next state includes at least one of: CLOSED, SYN _ S _ send, SYN _ T _ send, SYN _ S _ RCVD, SYN _ T _ RCVD, ESTABLISHED, S _ FIN _ WAIT1, T _ FIN _ WAIT1, S _ FIN _ WAIT2, T _ FIN _ WAIT2, ST _ FIN _ WAIT, S _ CLOSING, and T _ CLOSING;
the processing module is used for processing the TCP message according to the message processing mode and updating the initial state of the state machine to the next state;
the determining module includes:
a first determining unit, configured to determine a packet feature of the TCP packet according to a packet header of the TCP packet; the message characteristics of the TCP message include a sending direction and a message type, and the message type includes at least one of the following: SYN, ACK, FIN, RST and PUSH;
a second determining unit, configured to input the packet feature to the state machine, so that the state machine determines a processing manner of the TCP packet and the next state according to a preset state transition table and the current initial state;
the receiving module further comprises:
the setting module is used for setting a TCP state machine and a state transition table preset in the TCP state machine according to the message characteristics and the message processing mode configured by a user, wherein the state transition table comprises a plurality of groups of corresponding relations among the initial state, the message characteristics, the next state and the processing mode.
4. The message processing device according to claim 3, wherein the processing module comprises:
and the processing unit is used for carrying out transparent transmission processing or discarding processing on the TCP message.
5. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program operable on the processor, wherein the processor implements the steps of the method of any of the preceding claims 1 to 2 when executing the computer program.
6. A computer-readable medium having non-volatile program code executable by a processor, wherein the program code causes the processor to perform the method of any of claims 1-2.
CN201810647318.7A 2018-06-21 2018-06-21 Message processing method and device Active CN108924200B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810647318.7A CN108924200B (en) 2018-06-21 2018-06-21 Message processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810647318.7A CN108924200B (en) 2018-06-21 2018-06-21 Message processing method and device

Publications (2)

Publication Number Publication Date
CN108924200A CN108924200A (en) 2018-11-30
CN108924200B true CN108924200B (en) 2021-11-23

Family

ID=64420941

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810647318.7A Active CN108924200B (en) 2018-06-21 2018-06-21 Message processing method and device

Country Status (1)

Country Link
CN (1) CN108924200B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101252444A (en) * 2008-04-03 2008-08-27 华为技术有限公司 Method and apparatus for checking message characteristic
CN102710524A (en) * 2012-06-15 2012-10-03 大连梯耐德网络技术有限公司 Implementing method for multi-protocol network message transmission order preserving system
CN104202206A (en) * 2014-07-25 2014-12-10 汉柏科技有限公司 Message processing device and method
CN104836749A (en) * 2015-03-27 2015-08-12 清华大学 Software-defined networking (SDN) data plane strip state forwarding processor
CN106385409A (en) * 2016-09-08 2017-02-08 杭州迪普科技有限公司 TCP message processing method and device
CN106713348A (en) * 2017-01-17 2017-05-24 深圳市西迪特科技有限公司 OLT multicast uplink protocol message forwarding method and system
CN107404505A (en) * 2016-05-19 2017-11-28 北京金山云网络技术有限公司 A kind of processing method of message, gateway device and connection storage device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101547210A (en) * 2009-05-14 2009-09-30 福建星网锐捷网络有限公司 Method and device for processing TCP connection
CN101771585B (en) * 2010-03-02 2012-07-04 北京网康科技有限公司 Network delay measuring equipment and method thereof
CN102457980B (en) * 2010-10-14 2014-07-02 中国移动通信集团公司 Data transmission method and system in sensor network
CN102546363A (en) * 2010-12-21 2012-07-04 深圳市恒扬科技有限公司 Message processing method, device and equipment
CN102215231A (en) * 2011-06-03 2011-10-12 华为软件技术有限公司 Data forwarding method and gateway
US20140187275A1 (en) * 2012-12-28 2014-07-03 Gabriel Thendean Facility for message-based conversations
US20140280850A1 (en) * 2013-03-15 2014-09-18 Lantronix, Inc. Collaborative State Machine Management
CN104836753B (en) * 2015-03-27 2018-10-02 清华大学 SDN data plane carrier states switching equipment, system and method for processing forwarding

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101252444A (en) * 2008-04-03 2008-08-27 华为技术有限公司 Method and apparatus for checking message characteristic
CN102710524A (en) * 2012-06-15 2012-10-03 大连梯耐德网络技术有限公司 Implementing method for multi-protocol network message transmission order preserving system
CN104202206A (en) * 2014-07-25 2014-12-10 汉柏科技有限公司 Message processing device and method
CN104836749A (en) * 2015-03-27 2015-08-12 清华大学 Software-defined networking (SDN) data plane strip state forwarding processor
CN107404505A (en) * 2016-05-19 2017-11-28 北京金山云网络技术有限公司 A kind of processing method of message, gateway device and connection storage device
CN106385409A (en) * 2016-09-08 2017-02-08 杭州迪普科技有限公司 TCP message processing method and device
CN106713348A (en) * 2017-01-17 2017-05-24 深圳市西迪特科技有限公司 OLT multicast uplink protocol message forwarding method and system

Also Published As

Publication number Publication date
CN108924200A (en) 2018-11-30

Similar Documents

Publication Publication Date Title
CN105516080B (en) The processing method of TCP connection, apparatus and system
US7856477B2 (en) Method and system for image verification to prevent messaging abuse
US5958053A (en) Communications protocol with improved security
CN109639712B (en) Method and system for preventing DDOS attack
CN111314358B (en) Attack protection method, device, system, computer storage medium and electronic equipment
EP2739002B1 (en) Systems and methods for transparently monitoring network traffic for denial of service attacks
US20150003449A1 (en) Path maximum transmission unit learning
US20170126828A1 (en) Sending Method and Apparatus and Computer Storage Medium of Notification Message
CN104980257B (en) Internet of things communication method and device
CN102664958A (en) Transparent computing system
CN114629856B (en) Congestion control method and device, electronic equipment and readable storage medium
CN111147524B (en) Message sending end identification method and device and computer readable storage medium
CN109600364B (en) Method, device and computer readable storage medium for realizing message verification
CN108924200B (en) Message processing method and device
CN108460044B (en) Data processing method and device
CN107786607B (en) Message retransmission method, message retransmission server and user equipment
CN111355764B (en) Keep-alive message sending method and device, electronic equipment and readable storage medium
CN109714135B (en) Data packet transmission method and device
CN114553559B (en) Method and device for modifying protocol data in router and readable storage medium
CN107592361B (en) Data transmission method, device and equipment based on dual IB network
CN105227482A (en) The method for limiting speed connected based on TCP and device
EP3293924B1 (en) Message processing method and device
CN109413037B (en) Modbus service processing method and device
CN111200505B (en) Message processing method and device
WO2017143733A1 (en) Router and system thereof, and database synchronization method and device

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