CN112738119A - Message processing method and device, electronic equipment and readable storage medium - Google Patents
Message processing method and device, electronic equipment and readable storage medium Download PDFInfo
- Publication number
- CN112738119A CN112738119A CN202011643785.6A CN202011643785A CN112738119A CN 112738119 A CN112738119 A CN 112738119A CN 202011643785 A CN202011643785 A CN 202011643785A CN 112738119 A CN112738119 A CN 112738119A
- Authority
- CN
- China
- Prior art keywords
- message
- upper layer
- processing function
- processing
- queue
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application provides a message processing method, a message processing device, an electronic device and a readable storage medium, wherein the method comprises the following steps: judging whether the sequence number of the received current message meets the processing requirement of an upper layer processing function or not; judging whether a message exists in a reorganization queue, wherein the reorganization queue is used for storing messages which do not meet the processing requirements of the upper layer processing function; and when the sequence number of the current message meets the processing requirement of an upper layer processing function and no message exists in the reassembly queue, sending the current message to the upper layer processing function for processing. The efficiency of message processing can be improved.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a packet, an electronic device, and a readable storage medium.
Background
Most network security products perform traffic restoration on network data, including reassembly packets. When a plurality of messages of a TCP (Transmission Control Protocol) session are transmitted in a network, each message may be routed separately, some messages pass through more routers, and some messages pass through fewer routers; or some messages are lost in the middle of the process, and the source host is required to retransmit the messages. Since there may be various situations in the transmission of the message, it may cause the message to arrive at the destination host in different order from the transmission. Then, after the message is received, the message is generally reassembled. The reassembly process generally includes rearranging and caching disordered messages according to sequence numbers, performing reassembly and cleaning after data is continuous and reaches a certain length, and performing subsequent processing on the reassembled fictitious messages. However, the current reassembly mode can copy the message content many times, which affects the performance of the engine.
Disclosure of Invention
The application aims to provide a message processing method, a message processing device, an electronic device and a readable storage medium, which can improve the message processing efficiency.
In a first aspect, an embodiment of the present application provides a message processing method, including:
judging whether the sequence number of the received current message meets the processing requirement of an upper layer processing function or not;
judging whether a message exists in a reorganization queue, wherein the reorganization queue is used for storing messages which do not meet the processing requirements of the upper layer processing function;
and when the serial number of the current message meets the processing requirement of an upper layer processing function and no message exists in the reassembly queue, sending the current message to the upper layer processing function for processing.
In an optional embodiment, the method further comprises:
and when the serial number of the current message does not meet the processing requirement of an upper layer processing function or the message exists in the reassembly queue, storing the current message into the reassembly queue.
In an optional embodiment, the method further comprises:
recombining the messages in the recombination queue to obtain a recombined fictitious message;
and sending the reconstructed fictitious message to the upper layer processing function for processing.
In an optional embodiment, the reconstructing the packet in the reassembly queue to obtain a reconstructed fictitious packet includes:
judging whether the reassembly queue contains the message required by the upper layer processing function;
and if the messages in the reorganization queue contain the messages required by the upper layer processing function, the messages in the reorganization queue are reorganized to obtain the reorganized fictitious messages.
In the above embodiment, the packet may be reassembled into the queue under the condition that the requirement of the upper-layer processing function is not met, so that the packet can be conveniently reassembled by being placed into the reassembly queue, and the accuracy of packet processing can be maintained while the efficiency of packet processing is improved.
In an optional embodiment, the sending the current packet to the upper layer processing function for processing includes:
adding a recombination mark to the current message;
carrying out protocol decoding on the current message with the recombination mark to obtain a decoded message;
clearing the reassembly flag in the decoded message.
In the above embodiment, if the current packet meets the processing requirement of the upper layer processing function, the reassembly flag may be added, so that the operation of reassembly processing may be omitted, and the processing efficiency of the packet may be improved.
In an optional embodiment, the sending the current packet to the upper layer processing function for processing includes:
judging whether the current message is complete;
and if the data of the current message is complete, sending the current message to the upper layer processing function for processing.
In an optional implementation manner, the determining whether the current packet is complete includes:
judging whether the length of the current message is greater than or equal to a specified length;
and if the length of the current message is greater than or equal to the specified length, indicating that the current message is a complete message.
In the above embodiment, the integrity of the current packet is determined by identifying the length of the current packet, so that the accuracy of the packet submitted to the upper layer processing function can be improved, and the accuracy of packet processing can also be improved.
In a second aspect, an embodiment of the present application further provides a packet processing apparatus, including:
the first judging module is used for judging whether the sequence number of the received current message meets the processing requirement of an upper layer processing function or not;
the second judgment module is used for judging whether a message exists in a reorganization queue, and the reorganization queue is used for storing messages which do not meet the processing requirements of the upper layer processing function;
and the first processing module is used for sending the current message to the upper layer processing function for processing when the sequence number of the current message meets the processing requirement of the upper layer processing function and no message exists in the reassembly queue.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor, a memory storing machine-readable instructions executable by the processor, the machine-readable instructions being executable by the processor to perform the steps of the method described above when the electronic device is run.
In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the above-mentioned method.
The beneficial effects of the embodiment of the application are that: by identifying the sequence number of the current message, when the sequence number of the current message can meet the processing requirement of an upper layer processing function, the message recombination processing can be reduced, and the message processing efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a block diagram of an electronic device according to an embodiment of the present disclosure.
Fig. 2 is a flowchart of a message processing method according to an embodiment of the present application.
Fig. 3 is another flowchart of a message processing method according to an embodiment of the present application.
Fig. 4 is a detailed flowchart of step 205 of the message processing method according to the embodiment of the present application.
Fig. 5 is a schematic diagram of a functional module of a message processing apparatus according to an embodiment of the present application.
Detailed Description
The technical solution 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 numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
The inventors have found that the following two types of conventional recombination methods are generally available.
The first way is that after the message reaches the stream recombination module, firstly, the message content is cached in the recombination queue, and the message is sorted according to the message serial number; and then cleaning according to a cleaning strategy, copying and splicing the message content from the recombination queue into a fictitious message in the cleaning process if data meeting the conditions are found, and finally sending the fictitious message to an upper layer module for processing.
Through the first mode, the stream reassembly module can copy the message content to be reassembled for multiple times in the process of message sequencing, reassembly and cleaning, and the performance of the engine is affected.
The second way is that after the message reaches the stream reassembly module, the message content is firstly cached in the reassembly queue and sorted according to the sequence number; then, in the cleaning process, if data meeting the conditions are found, assigning the address and the length of each message segment of the reassembly queue to a data structure, and finally sending the data structure to an upper layer module for processing.
Through the second mode, the stream reassembly module can copy the message content in the process of message sequencing, reassembly and cleaning, and the performance of the engine is affected.
Based on the above research, the embodiment of the present application provides a message processing method, which can reduce the reassembly of messages and improve the engine performance. The scheme provided by the embodiment of the application is described by several embodiments.
Example one
To facilitate understanding of the present embodiment, first, an electronic device that executes the message processing method disclosed in the embodiment of the present application is described in detail.
As shown in fig. 1, is a block schematic diagram of an electronic device. The electronic device 100 may include a memory 111, a processor 113. It will be understood by those of ordinary skill in the art that the structure shown in fig. 1 is merely exemplary and is not intended to limit the structure of the electronic device 100. For example, electronic device 100 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The above-mentioned components of the memory 111 and the processor 113 are directly or indirectly electrically connected 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 the executable modules stored in the memory.
The Memory 111 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 111 is configured to store a program, and the processor 113 executes the program after receiving an execution instruction, and the method executed by the electronic 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.
Optionally, a software module for processing the message may be stored in the memory 111. Illustratively, the software modules stream a reassembly module, a decoding module, and the like. The stream restructuring module is used for restructuring the received message. The decoding module decodes the reconstructed fictitious message protocol.
The processor 113 may be an integrated circuit chip having signal processing capability. The Processor 113 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The various methods, steps, and logic blocks disclosed 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.
Optionally, the processor 113 may execute a stream reassembly module and a decoding module, so as to perform reassembly for the packet and decoding the reassembled fictitious packet protocol.
The electronic device 100 in this embodiment may be configured to perform each step in each method provided in this embodiment. The following describes the implementation process of the message processing method in detail through several embodiments.
Example two
Please refer to fig. 2, which is a flowchart illustrating a message processing method according to an embodiment of the present application. The specific process shown in fig. 2 will be described in detail below.
In an embodiment, a member variable may be set first, and is used to store a sequence number of a packet required by an upper layer processing function. Optionally, the value recorded by the member variable may be a sequence number of a message currently processed by the upper layer processing function, and the member variable may be updated by the sequence number of the received message each time the upper layer processing function receives a message that can be processed.
Based on the above embodiment, it can be determined whether the sequence number of the current packet meets the processing requirement of the upper layer processing function according to the value of the member variable. For example, it may be identified whether the sequence number of the current packet is the next sequence number value of the sequence numbers recorded by the member variable.
Optionally, the value recorded by the member variable may be a sequence number of a packet that needs to be processed by the upper layer processing function, and the sequence number of the packet that needs to be processed may be a next sequence number of a packet sequence number currently processed by the upper layer processing function. When the upper layer processing function receives a message capable of being processed each time, the member variable can be updated according to the sequence number of the message to be processed.
Based on the above embodiment, it can be determined whether the sequence number of the current packet meets the processing requirement of the upper layer processing function according to the value of the member variable. For example, it may be identified whether the sequence number of the current packet is the next sequence number value of the sequence numbers recorded by the member variable.
The recombination queue is used for storing messages which do not meet the processing requirements of the upper layer processing function.
Optionally, in order to improve the accuracy and efficiency of message parsing, the message with the longest number of messages that can be processed by the upper layer processing function may be determined before the current message is sent to the upper layer processing function.
For example, the length of the reassembly queue may be determined, and when the length of the reassembly queue is zero, it may indicate that the current packet is the longest packet that is currently received and can be processed, and send the current packet to the upper layer processing function for processing.
And when the sequence number of the current packet meets the processing requirement of the upper layer processing function and no packet exists in the reassembly queue, executing step 205.
For the safety and accuracy of message processing, the integrity of the current message may be judged before the upper layer processing function performs processing.
Alternatively, as shown in fig. 3, step 205 may include the following steps.
Optionally, whether the current packet is complete may be determined by determining the length of the current packet.
Exemplarily, the length of the current message is judged to be equal to a specified length; and if the length of the current message is equal to the specified length, indicating that the current message is a complete message.
Exemplarily, the length of the current message is judged to be greater than a specified length; and if the length of the current message is greater than the specified length, indicating that the current message is a complete message.
In an alternative embodiment, the integrity of the message may be determined based on a state machine of the protocol. For example, a state machine of a corresponding protocol may be created in the flow reassembly module, the sequentially incoming packets may be injected into the state machine, and whether protocol data of the packets is complete or not may be determined according to the state of the state machine, so as to determine that the packets are complete enough.
And step 2052, if the data of the current message is complete, sending the current message to the upper layer processing function for processing.
Optionally, the upper layer processing function may be used to decode the packet.
In one embodiment, as shown in FIG. 4, step 205 may include steps 2053-2055.
And step 2053, adding a recombination mark to the current message.
Optionally, before sending the current packet to the upper layer processing function, a reassembly flag may be added to the current packet.
For example, if the current packet is a packet required by the upper layer processing function, the stream reassembly module may directly add a reassembly flag to the current packet.
And step 2054, performing protocol decoding on the current message with the reassembly identifier to obtain a decoded message.
Illustratively, the protocol field and the recovery file of the current message are extracted by decoding the current message.
For example, after the message is processed, the reassembly flag in the message may be cleared, and then subsequent processing may be performed.
Through the steps, the message which does not need to be recombined can be processed more quickly, but when the received message does not directly process the upper layer processing function, the message can be recombined by using the existing processing mode.
When the sequence number of the current packet does not meet the processing requirement of the upper layer processing function, or there is a packet in the reassembly queue, step 207 may be executed.
Optionally, the message processing method may further include: step 207, storing the current message into the reassembly queue.
Optionally, the packet in the reassembly queue may be reassembled as needed. In an embodiment, when there are multiple packets in the reassembly queue, reassembly processing may be performed. The reorganization requirement is implemented by step 208 and step 209 below.
And 208, carrying out recombination processing on the messages in the recombination queue to obtain a recombined fictitious message.
Optionally, the packet to be reassembled may be reassembled by the stream reassembly module.
In one embodiment, the stream reassembly module may obtain the packets in the reassembly queue and sort the packets according to the packet sequence numbers; and then, cleaning by using a cleaning strategy, splicing the cleaned messages into a fictitious message, and finally sending the restructured fictitious message to an upper layer processing function for processing.
Illustratively, in the process of cleaning the message, if a new qualified message is received, the message contents with continuous serial numbers can be copied and spliced into a fictitious message from the reassembly queue, and finally the restructured fictitious message is sent to an upper layer processing function for processing.
In another embodiment, the stream reassembly module may obtain the packets in the reassembly queue and sort according to the packet sequence number; in the process of cleaning the message, if a new message meeting the conditions is received, assigning the address and the length of each message segment of the reassembly queue to a data structure, and finally sending the data structure to an upper layer processing function for processing.
In an embodiment, after receiving all the messages of the network data once, the messages in the reassembly queue may be reassembled.
For example, it may be determined whether the reassembly queue includes the packet required by the upper layer processing function; and if the messages in the reorganization queue contain the messages required by the upper layer processing function, the messages in the reorganization queue are reorganized to obtain the reorganized fictitious messages.
Optionally, it may be determined whether all the messages required by the upper layer processing function are received according to the sequence number of the message required by the upper layer processing function.
Illustratively, the sequence numbers of the messages required to be processed by the upper layer processing function determine the sequence numbers of the remaining messages required by the upper layer processing function. And comparing the sequence numbers of the needed residual messages with the message sequence numbers in the reassembly queue to determine whether the messages needed by the upper layer processing function are all received.
Optionally, it may be determined whether the messages required by the upper layer processing function are all received according to the lengths of all the messages of the reassembly queue and the sequence numbers of the messages required by the upper layer processing function.
Illustratively, the sequence numbers of the messages required to be processed by the upper layer processing function determine the sequence numbers of the remaining messages required by the upper layer processing function. And then determining the length of the message required by the upper layer processing function according to the sequence number of the required residual message, and comparing the length of the message required by the upper layer processing function with the message sequence number in the reassembly queue to determine whether the messages required by the upper layer processing function are all received.
Step 209, sending the reconstructed fictive message to the upper layer processing function for processing.
The processing manner of the upper layer processing function to the reassembled fictitious message in step 209 may be similar to the processing manner in step 205, but the difference is that the reassembled message is a fictitious message, so the fictitious message does not appear on the network, the fictitious message is not sent to the network after being processed, and the reassembled message does not need to clear the reassembly identifier. Therefore, other operations related to step 209 may refer to the description in step 205, and are not described herein again.
According to the message processing method, the serial number of the current message is identified, and when the serial number of the current message can meet the processing requirement of an upper-layer processing function, message recombination processing can be reduced, and message processing efficiency is improved.
Furthermore, when the messages are processed, the messages which may have disorder can be processed differently by combining with the reassembly queue, so that the processing of the messages can be more accurate.
Furthermore, a member variable can be stored according to the sequence number of the message which needs to be processed currently by the upper layer processing function, so that the judgment of the current money message can be more conveniently realized.
EXAMPLE III
Based on the same application concept, a message processing apparatus corresponding to the message processing method is also provided in the embodiments of the present application, and since the principle of the apparatus in the embodiments of the present application for solving the problem is similar to that in the embodiments of the message processing method described above, the apparatus in the embodiments of the present application may be implemented by referring to the description in the embodiments of the method described above, and repeated details are not described again.
Please refer to fig. 5, which is a schematic diagram of a functional module of a message processing apparatus according to an embodiment of the present application. Each module in the message processing apparatus in this embodiment is configured to execute each step in the foregoing method embodiment. The message processing device comprises: a first determining module 301, a second determining module 302, and a first processing module 303, each of which is described below.
The first determining module 301 is configured to determine whether the sequence number of the received current packet meets a processing requirement of an upper layer processing function.
A second determining module 302, configured to determine whether there is a packet in a reassembly queue, where the reassembly queue is used to store a packet that does not meet the processing requirement of the upper layer processing function.
The first processing module 303 is configured to send the current packet to an upper layer processing function for processing when the sequence number of the current packet meets a processing requirement of the upper layer processing function and no packet exists in the reassembly queue.
In a possible implementation manner, the message processing apparatus provided in this embodiment may further include:
and the storage module is used for storing the current message into the reassembly queue when the serial number of the current message does not meet the processing requirement of an upper layer processing function or the message exists in the reassembly queue.
In a possible implementation manner, the message processing apparatus provided in this embodiment may further include:
the first restructuring module is used for restructuring the messages in the restructuring queue to obtain restructured fictitious messages;
and the second processing module is used for sending the reconstructed fictitious message to the upper layer processing function for processing.
In one possible embodiment, the first reorganizing module is configured to:
judging whether the reassembly queue contains the message required by the upper layer processing function;
and if the messages in the reorganization queue contain the messages required by the upper layer processing function, the messages in the reorganization queue are reorganized to obtain the reorganized fictitious messages.
In a possible implementation, the first processing module 303 is configured to:
adding a recombination mark to the current message;
carrying out protocol decoding on the current message with the recombination mark to obtain a decoded message;
clearing the reassembly flag in the decoded message.
In a possible implementation, the first processing module 303 includes: a complete judging unit and a message processing unit.
A integrity judgment unit, configured to judge whether the current packet is intact;
and the message processing unit is used for sending the current message to the upper layer processing function for processing if the current message data is complete.
In a possible embodiment, the integrity determination unit is configured to:
judging whether the length of the current message is greater than or equal to a specified length;
and if the length of the current message is greater than or equal to the specified length, indicating that the current message is a complete message.
In addition, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the steps of the message processing method in the foregoing method embodiment.
The computer program product of the message processing method provided in the embodiment of the present application includes a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the steps of the message processing method in the foregoing method embodiment, which may be referred to specifically in the foregoing method embodiment, and details are not described here again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart 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, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent 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 or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including 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 application. 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. It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the 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 conceive of the changes or substitutions within the technical scope of the present application, and shall 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 message processing method is characterized by comprising the following steps:
judging whether the sequence number of the received current message meets the processing requirement of an upper layer processing function or not;
judging whether a message exists in a reorganization queue, wherein the reorganization queue is used for storing messages which do not meet the processing requirements of the upper layer processing function;
and when the serial number of the current message meets the processing requirement of an upper layer processing function and no message exists in the reassembly queue, sending the current message to the upper layer processing function for processing.
2. The method of claim 1, further comprising:
and when the serial number of the current message does not meet the processing requirement of an upper layer processing function or the message exists in the reassembly queue, storing the current message into the reassembly queue.
3. The method of claim 2, further comprising:
recombining the messages in the recombination queue to obtain a recombined fictitious message;
and sending the reconstructed fictitious message to the upper layer processing function for processing.
4. The method according to claim 3, wherein the reconstructing the packet in the reassembly queue to obtain the reconstructed fictitious packet comprises:
judging whether the reassembly queue contains the message required by the upper layer processing function;
and if the messages in the reorganization queue contain the messages required by the upper layer processing function, the messages in the reorganization queue are reorganized to obtain the reorganized fictitious messages.
5. The method according to any one of claims 1 to 4, wherein the sending the current packet to the upper layer processing function for processing comprises:
adding a recombination mark to the current message;
carrying out protocol decoding on the current message with the recombination mark to obtain a decoded message;
clearing the reassembly flag in the decoded message.
6. The method according to any one of claims 1 to 4, wherein the sending the current packet to the upper layer processing function for processing comprises:
judging whether the current message is complete;
and if the data of the current message is complete, sending the current message to the upper layer processing function for processing.
7. The method of claim 6, wherein the determining whether the current packet is complete comprises:
judging whether the length of the current message is greater than or equal to a specified length;
and if the length of the current message is greater than or equal to the specified length, indicating that the current message is a complete message.
8. A message processing apparatus, comprising:
the first judging module is used for judging whether the sequence number of the received current message meets the processing requirement of an upper layer processing function or not;
the second judgment module is used for judging whether a message exists in a reorganization queue, and the reorganization queue is used for storing messages which do not meet the processing requirements of the upper layer processing function;
and the first processing module is used for sending the current message to the upper layer processing function for processing when the sequence number of the current message meets the processing requirement of the upper layer processing function and no message exists in the reassembly queue.
9. An electronic device, comprising: a processor, a memory storing machine-readable instructions executable by the processor, the machine-readable instructions when executed by the processor performing the steps of the method of any of claims 1 to 7 when the electronic device is run.
10. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, is adapted to carry out the steps of the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011643785.6A CN112738119B (en) | 2020-12-30 | 2020-12-30 | Message processing method and device, electronic equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011643785.6A CN112738119B (en) | 2020-12-30 | 2020-12-30 | Message processing method and device, electronic equipment and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112738119A true CN112738119A (en) | 2021-04-30 |
CN112738119B CN112738119B (en) | 2022-12-09 |
Family
ID=75609262
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011643785.6A Active CN112738119B (en) | 2020-12-30 | 2020-12-30 | Message processing method and device, electronic equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112738119B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114143267A (en) * | 2021-11-26 | 2022-03-04 | 北京天融信网络安全技术有限公司 | Flow adjusting method and device, electronic equipment and computer readable storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101695067A (en) * | 2009-10-13 | 2010-04-14 | 深圳市同洲电子股份有限公司 | Data processing method and device based on TCP and digital TV receiver terminal and system |
CN106230744A (en) * | 2016-07-26 | 2016-12-14 | 京信通信系统(中国)有限公司 | A kind of method of out of order restructuring of data stream and forwarding unit |
WO2017167098A1 (en) * | 2016-03-31 | 2017-10-05 | 阿里巴巴集团控股有限公司 | Method and apparatus for tcp stream reassembly |
-
2020
- 2020-12-30 CN CN202011643785.6A patent/CN112738119B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101695067A (en) * | 2009-10-13 | 2010-04-14 | 深圳市同洲电子股份有限公司 | Data processing method and device based on TCP and digital TV receiver terminal and system |
WO2017167098A1 (en) * | 2016-03-31 | 2017-10-05 | 阿里巴巴集团控股有限公司 | Method and apparatus for tcp stream reassembly |
CN106230744A (en) * | 2016-07-26 | 2016-12-14 | 京信通信系统(中国)有限公司 | A kind of method of out of order restructuring of data stream and forwarding unit |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114143267A (en) * | 2021-11-26 | 2022-03-04 | 北京天融信网络安全技术有限公司 | Flow adjusting method and device, electronic equipment and computer readable storage medium |
CN114143267B (en) * | 2021-11-26 | 2023-08-29 | 北京天融信网络安全技术有限公司 | Flow adjustment method, device, electronic equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112738119B (en) | 2022-12-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP1125207B1 (en) | Bi-directional process-to-process byte stream protocol | |
US6910134B1 (en) | Method and device for innoculating email infected with a virus | |
Partridge et al. | Performance of checksums and CRCs over real data | |
CN100448224C (en) | Method and apparatus for discovering path maximum transmission unit (PMTU) | |
US7702917B2 (en) | Data transfer using hyper-text transfer protocol (HTTP) query strings | |
US9578141B2 (en) | Packet flow modification | |
CN106534059B (en) | Network named segmentation in content-centric networks | |
US20060095966A1 (en) | Method of detecting, comparing, blocking, and eliminating spam emails | |
EP1912364A1 (en) | Integrity of low bandwidth communications | |
CN111262876B (en) | Data processing method, device and equipment based on block chain and storage medium | |
JP2020522922A (en) | Method and system for selectively using network coding to propagate transactions in a blockchain network | |
CN112738119B (en) | Message processing method and device, electronic equipment and readable storage medium | |
CN113242109B (en) | Method, device and equipment for checking message data | |
US20020159481A1 (en) | Telegraphic message transmitter and telegraphic message receiver | |
CN104917681A (en) | System and method for packet forwarding using a conjunctive normal from strategy in a content-centric network | |
CN116530066A (en) | Method and device for protecting stateful business function path | |
CN112381649A (en) | Transaction consensus method, device and equipment based on block chain | |
CN111586041A (en) | Industrial unidirectional isolation network gate system and data transmission method | |
CN111082896A (en) | Data transmission method and transmitting and receiving device | |
RU2358395C2 (en) | Method of reducing transmission time of run file through test point | |
US20040216122A1 (en) | Method for routing data through multiple applications | |
US7522590B2 (en) | Managing message arrival to ensure proper matching of unordered messages | |
CN108632318B (en) | Data verification method, data sending method, related device and system | |
CN109558744B (en) | Data processing method and system | |
US20100299354A1 (en) | Determining device and determining method for determining processing to be performed based on acquired data |
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 |