Data message processing method and device, electronic equipment and storage medium

The data packet shard group and shard group information are determined through hash value, and the packet shard information is stored and updated, which solves the problem of low efficiency of data packet reorganization in the prior art, and achieves fast and efficient Message reorganization.

CN118945130APending Publication Date: 2024-11-12XEL TECH INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411078054.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In the prior art, data packet reorganization efficiency is low. When each packet shard is received, it is necessary to determine whether it belongs to the same original packet as all packets received, resulting in low processing efficiency.

Method used

By using hash value to determine the message shard group and shard group information to which the pending message belongs, store the pending message, and update the address information based on the pending message and the received message, and judge the report Whether all message fragments in the text shard group have been received, and thus reorganize it.

Benefits of technology

The packet reorganization efficiency and the processing ability of electronic devices to data packets are significantly improved, and the packet shard group is quickly positioned through hash value to judge the reorganization of the pending packets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118945130A_ABST
    Figure CN118945130A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of computers, and discloses a data message processing method and device, electronic equipment and a storage medium, and the method comprises the steps: determining a message fragment group to which a to-be-processed message belongs and fragment group information according to a hash value of the to-be-processed message when the received to-be-processed message needs to be recombined; storing the to-be-processed message, and determining whether all message fragments in the message fragment group are received or not according to the fragment information of the to-be-processed message and the received message; if the message fragments are not completely received, updating fragment information and address information of the received message according to the to-be-processed message and the storage address of the to-be-processed message; and if all the message fragments are received, obtaining each message in the received message according to the address information of the received message, and recombining the to-be-processed message and each message into a target data message. By applying the technical scheme of the invention, the recombination efficiency of the data message can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and specifically to a method, device, electronic device and storage medium for processing a data message. Background Art

[0002] During the transmission of a data message, a data message may have to pass through multiple different network links, and the maximum transmission unit (MTU) that can be transmitted by each network link is different. When the size of the data message exceeds the maximum transmission unit of a certain network link, the data message needs to be split into multiple message fragments to ensure that it can be transmitted in the network link. When the transmission is completed or needs to be reassembled, all the message fragments are reassembled into the original data message.

[0003] At present, in order to reassemble message fragments, when each message fragment is received, it is necessary to determine whether the message fragment and all the message fragments that have been received belong to the same original message, and if they do, the message fragment is reassembled with the existing message fragments. However, this method requires that when a message fragment is received, the message fragment is determined to be compared with all the message fragments that have been received, resulting in low efficiency of message reassembly. Summary of the invention

[0004] In view of the above problems, the embodiments of the present invention provide a method, device, electronic device and storage medium for processing data messages, which are used to solve the problem of low message reassembly efficiency in the prior art.

[0005] According to one aspect of an embodiment of the present invention, a method for processing data messages is provided, the method comprising: when a received message to be processed needs to be reassembled, determining the message fragment group to which the message to be processed belongs and the fragment group information of the message fragment group according to the hash value of the message to be processed, the fragment group information including the fragment information and address information of the received message in the message fragment group; storing the message to be processed, and determining the message fragment group according to the fragment information of the message to be processed and the received message Whether all the message fragments in the fragment group have been received; if not all the message fragments in the message fragment group have been received, then according to the storage address of the message to be processed and the message to be processed, the fragment information and address information of the received message are updated; if all the message fragments in the message fragment group have been received, then according to the address information of the received message, each message in the received message is obtained, and the message to be processed and each message in the received message are reorganized into a target data message.

[0006] In some embodiments, the method also includes: extracting message information of the message to be processed, the message information including any one or more of the source address, destination address, identifier, and port information of the message to be processed; and converting the message information using a hash algorithm to obtain a hash value of the message to be processed.

[0007] In some embodiments, determining the message fragment group to which the message to be processed belongs and the fragment group information of the message fragment group according to the hash value of the message to be processed includes: searching for at least one storage space corresponding to the hash value in a hash table according to the hash value of the message to be processed; and in the at least one storage space, determining the storage information in the storage space having the same message information as the message to be processed as the fragment group information of the message fragment group.

[0008] In some embodiments, the method also includes: if at least one storage space corresponding to the hash value is not found according to the hash value of the message to be processed, a new storage space is allocated to the message fragment group to which the message to be processed belongs, and the hash table is updated according to the correspondence between the hash value of the message to be processed and the new storage space.

[0009] In some embodiments, the method further includes: determining whether a message reassembly function is enabled based on reassembly configuration information; when the message reassembly function is enabled, determining whether the message to be processed is a message fragment based on information carried by the message to be processed; if it is determined that the message to be processed is a message fragment, determining that the message to be processed needs to be reassembled.

[0010] In some embodiments, the fragmentation information includes the fragmentation offset, message length and fragmentation status identifier of each message in the received message, and the fragmentation status identifier is used to indicate whether the message is the last message fragment; the determining whether all message fragments in the message fragment group have been completely received according to the fragmentation information of the message to be processed and the received message includes: determining the fragmentation offset, message length and fragmentation status identifier of the message to be processed; if it is determined that the message to be processed is the last message fragment in the message fragment group according to the fragmentation status identifier of the message to be processed, then determining the reorganization position and reorganization order of each message in the message to be processed and the received message according to the fragmentation offset and message length of the message to be processed, and the fragmentation offset and message length of each message in the received message; determining whether all message fragments have been completely received according to the reorganization position and reorganization order of each message in the message to be processed and the received message.

[0011] In some embodiments, the reorganizing the messages to be processed and each of the received messages into a target data message includes: reorganizing the messages to be processed and each of the received messages according to the reorganization position and reorganization order of the messages to be processed and each of the received messages to obtain the target data message.

[0012] According to another aspect of an embodiment of the present invention, a data message processing device is provided, the device comprising: a determination module, for determining, when a received message to be processed needs to be reassembled, the message fragment group to which the message to be processed belongs and the fragment group information of the message fragment group according to the hash value of the message to be processed, the fragment group information including the fragment information and address information of the received message in the message fragment group; a storage module, for storing the message to be processed, and determining the message fragment group according to the fragment information of the message to be processed and the received message Whether all message fragments in the fragment group have been received completely; an update module, which is used to update the fragment information and address information of the received message according to the storage address of the message to be processed and the message to be processed if all the message fragments in the message fragment group have not been received completely; a reorganization module, which is used to obtain each message in the received message according to the address information of the received message if all the message fragments in the message fragment group have been received completely, and reorganize the message to be processed and each message in the received message into a target data message.

[0013] According to another aspect of an embodiment of the present invention, there is provided an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the operations of the data message processing method as described above by executing the executable instructions.

[0014] According to another aspect of an embodiment of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the data message processing method as described above when executed by a processor.

[0015] In summary, according to the data message processing method, device, electronic device and storage medium of the embodiment of the present invention, when the received message to be processed needs to be reassembled, the message fragment group to which the message to be processed belongs and the fragment group information of the message fragment group can be determined according to the hash value of the message to be processed, the message to be processed is stored, and the fragment information and address information of the received message are updated according to the message to be processed and the storage address of the message to be processed, and the updated fragment information and the updated address information are obtained, and then according to the updated fragment information, it is determined whether all the message fragments in the message fragment group have been received, so that when all the message fragments in the message fragment group have been received, each message fragment is obtained according to the updated address information, and each message fragment is reassembled into a target data message. By using the hash value to quickly locate the message fragment group to which the message to be processed belongs, so as to judge whether the message to be processed can be reassembled, the message reassembly efficiency and the processing ability of the electronic device for data messages can be significantly improved.

[0016] The above description is only an overview of the technical solution of the embodiment of the present invention. In order to more clearly understand the technical means of the embodiment of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings:

[0018] Figure 1 A flow chart of a method for processing a data message provided by an embodiment of the present invention is shown;

[0019] Figure 2 A sub-flow chart of a method for processing a data message provided by an embodiment of the present invention is shown;

[0020] Figure 3 A sub-flow chart of another method for processing a data message provided by an embodiment of the present invention is shown;

[0021] Figure 4 A sub-flow chart of another method for processing a data message provided by an embodiment of the present invention is shown;

[0022] Figure 5 A flowchart of another method for processing a data message provided by an embodiment of the present invention is shown;

[0023] Figure 6 A structural diagram of a data message processing device provided by an embodiment of the present invention is shown;

[0024] Figure 7 A schematic structural diagram of an electronic device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0025] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0026] An embodiment of the present invention provides a method for processing data messages, which can be executed by an electronic device so that when a received message to be processed needs to be reassembled, the message fragment group to which the message to be processed belongs and the fragment group information of the message fragment group can be determined according to the hash value of the message to be processed, the message to be processed is stored, and according to the fragment information of the message to be processed and the received message, it is determined whether all message fragments in the message fragment group have been completely received; if all message fragments in the message fragment group have not been completely received, the fragment information and address information of the received message are updated according to the storage address of the message to be processed and the message to be processed; if all message fragments in the message fragment group have been completely received, each message in the received message is obtained according to the address information of the received message, and each message in the message to be processed and the received message are reassembled into a target data message.

[0027] Figure 1 A flow chart of a method for processing a data message provided by an embodiment of the present invention is shown, Figure 1 As shown, the method may include the following steps 110 to 140:

[0028] Step 110: When the received message to be processed needs to be reassembled, the message fragment group to which the message to be processed belongs and the fragment group information of the message fragment group are determined according to the hash value of the message to be processed.

[0029] The fragment group information includes the fragment information and address information of the received message in the message fragment group. The fragment information refers to the information of the fragments of each message in the received message in the original message, and may include the identifier, flag, fragment offset, message length and other information of each message in the received message. The identifier of the message can be used to identify all message fragments of an original message, for example, messages with the same identifier belong to the same original message; the flag of the message can include a "more fragments" flag, which can indicate whether there are more fragments in the future; the fragment offset can indicate the relative position of the message in the original message; the message length can indicate the total length of the message, which may include the header and data part. The address information of the received message refers to the information of the storage address of each message in the received message.

[0030] A message fragment group refers to a message group composed of message fragments corresponding to the same original message, that is, in a message fragment group, all messages in the received message belong to the same original message.

[0031] During the transmission of data messages, the electronic device can receive data messages in sequence. When the received message to be processed needs to be reassembled, it means that the message to be processed is a message fragment after fragmentation processing. In order to determine the original message corresponding to the message to be processed, the message fragment group to which the message to be processed belongs and the fragment group information of the message fragment group can be determined according to the hash value of the message to be processed.

[0032] Exemplarily, the hash value of the message to be processed can be used as an index to search for the message fragment group that matches the hash value in the storage hash table, and obtain the fragment group information of the message fragment group. In this way, when the message to be processed needs to be reassembled, the message fragment group to which the message to be processed belongs can be quickly located, and the fragment group information of the message fragment group can be obtained, so as to provide support for subsequent reassembly processing.

[0033] In some embodiments, reference Figure 2 As shown, the electronic device can also determine whether the message to be processed needs to be reassembled by the following method:

[0034] Step 210: Determine whether the message reassembly function is enabled according to the reassembly configuration information.

[0035] The reassembly configuration information is information related to the functions and parameters of message reassembly set by the operator, for setting, controlling and adjusting the message reassembly. Exemplarily, the reassembly configuration information may include message reassembly function settings, such as whether the message reassembly function is enabled.

[0036] Step 220: When the message reassembly function is enabled, determine whether the message to be processed is a message fragment according to the information carried by the message to be processed.

[0037] The information carried by the message to be processed may include information related to message reassembly in the message to be processed, such as any one or more of an identifier, a fragment offset, and a message length in the message to be processed.

[0038] When the message reassembly function is enabled, in order to reassemble the message to be processed and other message fragments belonging to the same original message, it is possible to determine whether the message to be processed is a message fragment based on the information carried by the message to be processed. For example, an identifier in the message to be processed can be read to determine whether the message to be processed is a message fragment based on the identifier.

[0039] Step 230: If it is determined that the message to be processed is a message fragment, it is determined that the message to be processed needs to be reassembled.

[0040] In some embodiments, the reassembly configuration information may further include a message reassembly mode, such as setting which messages need to be reassembled, etc. During the setting, messages of specific sources and destinations may be reassembled according to the source address and destination address of the message.

[0041] Through the above method, the reassembly of data messages can be flexibly controlled. When only data messages need to be transmitted, the message reassembly function can be disabled. When data messages need to be reassembled, the message reassembly function can be enabled.

[0042] In some embodiments, message information of the message to be processed may be extracted, and the message information may be converted using a hash algorithm to obtain a hash value of the message to be processed.

[0043] The message information may include any one or more of the source address, destination address, identifier, and port information of the message to be processed. The hash algorithm may be an MD5 algorithm (Message Digest Algorithm 5), a SHA algorithm (Secure Hash Algorithm), a cyclic redundancy check algorithm, such as CRC-16, CRC-32, etc., which is not specifically limited in this embodiment.

[0044] By performing hash processing on the message information of the message to be processed, a message identifier of the message to be processed can be generated. Moreover, since the message information of all message fragments corresponding to the same original message is consistent, the message identifier of the message to be processed can be used to quickly locate the message fragment group that belongs to the same original message as the message to be processed.

[0045] Since the hash algorithm maps data of any length to a hash value of fixed length, the same hash value may correspond to different message fragment groups. Therefore, in order to accurately determine the message fragment group to which the message to be processed belongs, in some embodiments, reference Figure 3 As shown, step 110 may include the following methods:

[0046] Step 310: According to the hash value of the message to be processed, search the hash table for at least one storage space corresponding to the hash value.

[0047] The hash table is a data table of hash values ​​generated using the message information of the received message. Exemplarily, the hash table can store storage space information corresponding to each hash value. For example, each hash value can correspond to one or more storage spaces, and each storage space can be used to store fragment group information of a message fragment group.

[0048] Using the hash value of the message to be processed, all storage spaces corresponding to the hash value can be found in the hash table. For example, assuming that the hash value of the message to be processed is 12345, the storage spaces corresponding to the hash value, such as storage spaces A, B, C and D, can be determined according to the hash table.

[0049] Step 320: In the at least one storage space, the storage information in the storage space having the same message information as the message to be processed is determined as the fragment group information of the message fragment group.

[0050] When determining the storage space corresponding to the hash value of the message to be processed, the message information in each storage space can be further obtained. For example, the message information can be extracted from the storage information in each storage space. If the message information of the message to be processed is the same as the message information corresponding to any storage space, the storage information of any storage space can be determined as the fragment group information of the message fragment group.

[0051] In some embodiments, when determining the fragment group information, the validity of the information stored in each storage space can also be determined, and the storage information in a valid state is determined as the fragment group information of the message fragment group to which the message to be processed belongs. Whether the storage information is valid can be determined based on whether the storage information is a null value, whether the message information in the storage information is consistent with the message information of the message to be processed, etc.

[0052] Exemplarily, the storage information in each storage space may include a data validity flag, and whether the storage information is valid can be determined based on the data validity flag. For example, if the data validity flag is 1, it indicates that the storage information of the storage space is in a valid state, and conversely, if the data validity flag is 0, it indicates that the storage information of the storage space is invalid. When it is determined that the storage information of the storage space is in a valid state, and the message information in the storage information is the same as the message information of the message to be processed, the storage information can be determined as the fragment group information of the message fragment group to which the message to be processed belongs.

[0053] In some embodiments, if the number of storage spaces corresponding to the hash value of the message to be processed is 1, and the message information of the message to be processed is inconsistent with the message information in the storage space, it means that the message to be processed and the received message corresponding to the storage space do not belong to the same original message. At this time, the message to be processed can be discarded, and the relevant information of the message to be processed can be recorded at the same time, so as to increase the number of storage spaces corresponding to the hash value of the message to be processed.

[0054] Through steps 310 to 320, the message fragment group to which the message to be processed belongs can be quickly located according to the hash value of the message to be processed, and the fragment group information of the message fragment group can be obtained.

[0055] In some embodiments, the electronic device may also allocate new storage space for the message fragment group to which the message to be processed belongs when at least one storage space corresponding to the hash value of the message to be processed is not found according to the hash value of the message to be processed, and update the hash table according to the correspondence between the hash value of the message to be processed and the new storage space.

[0056] If at least one storage space corresponding to the hash value is not found according to the hash value of the message to be processed, it means that the hash value is a new hash value, and new storage space can be allocated to the message fragment group to which the message to be processed belongs. At the same time, in order to receive and process the remaining message fragments that belong to the same original message as the message to be processed, the hash table can be updated according to the correspondence between the hash value of the message to be processed and the new storage space.

[0057] Step 120, the message to be processed is stored, and according to the fragment information of the message to be processed and the received message, it is determined whether all the message fragments in the message fragment group have been received.

[0058] In order to reorganize the message to be processed and other message fragments in the message fragment group, the message to be processed can be stored in the message storage area. Then, since the fragment information and address information are information related to the received message, after the storage is completed, it can be determined whether all message fragments in the message fragment group have been received based on the fragment information of the message to be processed and the received message.

[0059] In some embodiments, the fragment information may include the fragment offset, message length, and fragment status flag of each message in the received message, wherein the fragment status flag is used to indicate whether the message is the last message fragment. Figure 4 As shown, step 120 can be implemented by the following method:

[0060] Step 410, determining the fragment offset, message length and fragment status identifier of the message to be processed.

[0061] Exemplarily, the message to be processed may be read to obtain information of corresponding bytes, thereby obtaining the fragment offset, message length and fragment status identifier of the message to be processed.

[0062] Step 420, if it is determined according to the fragmentation status identifier of the message to be processed that the message to be processed is the last message fragment in the message fragment group, then the reassembly position and reassembly order of the message to be processed and each message in the received message are determined according to the fragmentation offset and message length of the message to be processed, and the fragmentation offset and message length of each message in the received message.

[0063] If it is determined according to the fragment status identifier of the message to be processed that the message to be processed is the last message fragment in the message fragment group, it means that the last message fragment in the message fragment group has been received. In order to determine whether the reassembly can be successful, the reassembly position and reassembly order of each message in the message to be processed and the received message can be determined according to the fragment offset and message length of the message to be processed, as well as the fragment offset and message length of each message in the received message.

[0064] For example, the messages to be processed and the received messages may be sorted according to the fragment offset and message length of the message to be processed and the fragment offset and message length of each message in the received message to determine whether all the messages are continuous, thereby determining the reassembly position and reassembly order of each message in the message to be processed and the received message.

[0065] Step 430, determining whether all message fragments have been received based on the reassembly position and reassembly order of each message in the message to be processed and the received message.

[0066] For example, when it is determined that the sorted messages are continuous and have no gaps based on the reassembly positions and reassembly orders of the messages to be processed and the received messages, it can be determined that all message fragments have been received.

[0067] Through the above method, it is possible to determine whether all message fragments in the message fragment group have been received based on the fragment information of the message to be processed and the fragment information of the received message, and judge whether the message fragment group meets the reassembly conditions.

[0068] Step 130: If all message fragments in the message fragment group have not been completely received, the fragment information and address information of the received message are updated according to the message to be processed and the storage address of the message to be processed.

[0069] When all message fragments in the message fragment group have not been received completely, the reassembly cannot be successfully completed. In order to continue receiving the next message fragment, the fragment information and address information of the received message can be updated according to the message to be processed and the storage address of the message to be processed.

[0070] In some embodiments, the storage address of the message to be processed can be written into the address information, and the fragmentation information of the message to be processed, such as the identifier, fragmentation offset, message length, etc., can be written into the fragmentation information to obtain updated fragmentation information and updated address information. The updated fragmentation information can record the total number of message fragments received in the message fragmentation group, and the specific information of each message fragment, such as the fragmentation offset, that is, the position in the original message, and the message length, etc. The updated address information can record the storage addresses of all received message fragments in the message fragmentation group.

[0071] Step 140: If all message fragments in the message fragment group are received, then obtain each message in the received message according to the address information of the received message, and reassemble the message to be processed and each message in the received message into a target data message.

[0072] When all message fragments in the message fragment group are received, each message in the received message can be read from the message storage area according to the address information of the received message, and the message to be processed and each message in the received message can be reassembled to obtain the target data message, thereby realizing the process of reassembling the message fragments into the original message.

[0073] In some embodiments, the message to be processed and each message in the received message may be reassembled according to the reassembly position and reassembly order of each message in the message to be processed and the received message to obtain the target data message.

[0074] For example, redundant information of each message in the to-be-processed message and the received message, such as fragment identifier, etc., can be removed, and then the processed messages are reassembled according to the reassembly position and reassembly order of each message in the to-be-processed message and the received message to obtain the target data message.

[0075] Figure 5 A flow chart of another method for processing data packets provided by this embodiment is shown, such as Figure 5 As shown, the following steps may be included:

[0076] Step 501: Receive a message to be processed.

[0077] Step 502: Determine whether the message to be processed needs to be reassembled according to the reassembly configuration information. If necessary, execute step 503; if not, execute step 509.

[0078] Exemplarily, it is possible to determine whether the message reassembly function is enabled and which messages need to be reassembled according to the reassembly configuration information, so as to determine whether the message to be processed needs to be reassembled. For example, when it is determined that the message reassembly function is enabled, the source address and the destination address of the message to be processed can be further compared with the source address and the destination address of the message to be reassembled in the reassembly configuration information to determine whether the message to be processed needs to be reassembled.

[0079] Step 503: Determine the hash value of the message to be processed according to the message information of the message to be processed.

[0080] Use any hash algorithm to convert the message information of the message to be processed to obtain the hash value of the message to be processed. The hash value is used as a representative identifier of the message to be processed, and the message fragment group to which the message to be processed belongs can be quickly located.

[0081] Step 504, determine whether there is information of storage space matching the hash value in the hash table. If yes, execute step 505, if not, execute step 510.

[0082] When there is information about storage space matching the hash value in the hash table, it means that the message to be processed is not the first message of the message fragment group to which it belongs, and step 505 can be executed at this time to store the message to be processed in the message storage area. When there is no information about storage space matching the hash value in the hash table, it means that the message to be processed is the first message of the message fragment group to which it belongs, and step 510 can be executed at this time to determine whether there is free storage space in the hash table.

[0083] Step 505: Store the message to be processed in the message storage area.

[0084] Step 506, based on the fragment information of the message to be processed and the received message, determine whether all the message fragments of the message fragment group have been received. If all have been received, execute step 507; if not all have been received, execute step 508.

[0085] Exemplarily, the fragment offset, message length and fragment status mark of the message to be processed can be determined, and whether the message to be processed is the last message fragment in the message fragment group can be determined according to the fragment status mark of the message to be processed. If so, the reassembly position and reassembly order of each message in the message to be processed and the received message can be determined according to the fragment offset and message length of the message to be processed, as well as the fragment offset and message length of each message in the received message, so as to judge whether these messages are continuous and there is no missing message. If continuous, it is determined that all message fragments of the message fragment group have been received, and step 507 is executed to perform reassembly. If not continuous, it is determined that not all message fragments have been received, and step 508 is executed to update the fragment information and address information of the received message.

[0086] Step 507: read each message in the received message, and reassemble the message to be processed and each message in the received message into a target data message.

[0087] Exemplarily, each message in the received message can be read according to the address information of the received message, and the message to be processed and each message in the received message can be reassembled according to the reassembly position and reassembly order of each message in the message to be processed and the received message to obtain the target data message.

[0088] Step 508: Update the fragmentation information and storage address of the message to be processed to the fragmentation information and address information of the received message.

[0089] For example, the storage address of the message to be processed can be written into the address information, and the fragmentation information of the message to be processed, such as the identifier, fragmentation offset, message length, etc., can be written into the fragmentation information to obtain updated fragmentation information and updated address information.

[0090] By updating the fragmentation information and address information of the received message, the next message can be processed when it is received.

[0091] Step 509: forward the message to be processed to the next node according to the routing information of the message to be processed.

[0092] For example, the corresponding next node may be searched in the routing table acquired by the electronic device according to the source address and the destination address of the message to be processed, so as to forward the message to be processed to the next node.

[0093] Step 510, determine whether there is free storage space in the hash table. If so, execute step 511, if not, execute step 512.

[0094] Step 511, storing the message to be processed in the message storage area, and storing the fragmentation information and storage address of the message to be processed in the free storage space.

[0095] When there is free storage space in the hash table, the message to be processed can be stored and reorganized. At this time, the message to be processed can be stored in the message storage area, and the fragmentation information and storage address of the message to be processed can be stored in the free storage space, so that when the next message of the message fragment group to which the message to be processed belongs is received, the next message can be stored and processed.

[0096] Step 512: discard the message to be processed and record the information of the message to be processed.

[0097] When there is no free storage space in the hash table, the message to be processed may be discarded, and information of the message to be processed may be recorded so that the storage space corresponding to the hash table can be expanded later.

[0098] Through the above steps 110 to 140, the hash value of the message to be processed can be used to quickly locate the message fragment group to which the message to be processed belongs, and based on the fragment information of the received messages in the message fragment group and the message to be processed, it can be determined whether all message fragments in the message fragment group to which the message to be processed belongs have been received. When all have been received, the message to be processed and each message in the received messages in the message fragment group are reassembled to obtain the target data message, which can improve the efficiency of message reassembly and enhance the electronic device's ability to process data messages.

[0099] This embodiment also provides a data message processing device, such as Figure 6As shown, the data message processing device 600 may include: a determination module 610, which is used to determine the message fragment group to which the message to be processed belongs and the fragment group information of the message fragment group according to the hash value of the message to be processed when the received message to be processed needs to be reassembled, and the fragment group information includes the fragment information and address information of the received message in the message fragment group.

[0100] The storage module 620 includes a storage unit 621 and a judgment module 622, wherein the storage unit 621 can be used to store the message to be processed, and the judgment unit 622 can be used to determine whether all message fragments in the message fragment group have been received based on the fragment information of the message to be processed and the received message.

[0101] The updating module 630 is used to update the fragment information and address information of the received message according to the message to be processed and the storage address of the message to be processed if all the message fragments in the message fragment group have not been received completely.

[0102] The reassembly module 640 is used to obtain each message in the received message according to the address information of the received message if all message fragments in the message fragment group are received, and reassemble the message to be processed and each message in the received message into a target data message.

[0103] In some embodiments, the determination module 610 can also be used to extract message information of the message to be processed, the message information including any one or more of the source address, destination address, identifier, and port information of the message to be processed; and use a hash algorithm to convert the message information to obtain a hash value of the message to be processed.

[0104] In some embodiments, the determination module 610 can be used to search for at least one storage space corresponding to the hash value in the hash table based on the hash value of the message to be processed; in at least one storage space, the storage information in the storage space with the same message information as the message to be processed is determined as the fragment group information of the message fragment group.

[0105] In some embodiments, the determination module 610 can also be used to allocate new storage space to the message fragment group to which the message to be processed belongs if at least one storage space corresponding to the hash value is not found according to the hash value of the message to be processed, and update the hash table according to the correspondence between the hash value of the message to be processed and the new storage space.

[0106] In some embodiments, the determination module 610 can also be used to determine whether the message reassembly function is turned on according to the reassembly configuration information; when the message reassembly function is turned on, determine whether the message to be processed is a message fragment according to the information carried by the message to be processed; if it is determined that the message to be processed is a message fragment, it is determined that the message to be processed needs to be reassembled.

[0107] In some embodiments, the fragmentation information includes the fragmentation offset, message length and fragmentation status identifier of each message in the received message, and the fragmentation status identifier is used to indicate whether the message is the last message fragment; the storage module 620 can be used to determine the fragmentation offset, message length and fragmentation status identifier of the message to be processed; if it is determined according to the fragmentation status identifier of the message to be processed that the message to be processed is the last message fragment in the message fragmentation group, then according to the fragmentation offset and message length of the message to be processed, and the fragmentation offset and message length of each message in the received message, determine the reorganization position and reorganization order of each message in the message to be processed and the received message; according to the reorganization position and reorganization order of each message in the message to be processed and the received message, determine whether all message fragments have been received.

[0108] In some embodiments, the reassembly module 640 may be configured to reassemble the messages to be processed and the received messages according to the reassembly positions and reassembly orders of the messages to be processed and the received messages to obtain target data messages.

[0109] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.

[0110] like Figure 7 As shown, the electronic device may be a gateway device, a switch, etc. Specifically, the electronic device may include: a processor (processor) 702 , a communication interface (Communications Interface) 704 , a memory (memory) 706 , and a communication bus 708 .

[0111] The processor 702, the communication interface 704, and the memory 706 communicate with each other via the communication bus 708. The communication interface 704 is used to communicate with other devices such as a client or other server network elements. The processor 702 is used to execute the program 710, which can specifically execute the relevant steps in the above-mentioned method for processing data packets.

[0112] Specifically, the program 710 may include program code including computer executable instructions.

[0113] The processor 702 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the electronic device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0114] The memory 706 is used to store the program 710. The memory 706 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0115] The program 710 can be specifically called by the processor 702 to enable the electronic device to execute the steps in the above-mentioned data message processing method.

[0116] An embodiment of the present invention further provides a computer-readable storage medium storing at least one executable instruction. When the executable instruction is executed on an electronic device, the electronic device executes the data message processing method in any of the above method embodiments.

[0117] The executable instructions can be specifically used to enable the electronic device to execute the steps in the above-mentioned data message processing method.

[0118] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system or other device. In addition, the embodiments of the present invention are not directed to any particular programming language.

[0119] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. Similarly, in order to simplify the present invention and help understand one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. Wherein, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself is a separate embodiment of the present invention.

[0120] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and further may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive.

[0121] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.

Claims

1. A method for processing a data message, characterized in that: The method comprises: When the received message to be processed needs to be reassembled, determine the message fragment group to which the message to be processed belongs and the fragment group information of the message fragment group according to the hash value of the message to be processed, wherein the fragment group information includes the fragment information and address information of the received message in the message fragment group; The to-be-processed message is stored, and according to the to-be-processed message and the fragment information of the received message, it is determined whether all the message fragments in the message fragment group have been received; If all the message fragments in the message fragment group have not been received completely, updating the fragment information and address information of the received message according to the message to be processed and the storage address of the message to be processed; If all the message fragments in the message fragment group are received, then each message in the received message is obtained according to the address information of the received message, and the to-be-processed message and each message in the received message are reassembled into a target data message.

2. The method according to claim 1, characterized in that The method further comprises: Extracting message information of the message to be processed, wherein the message information includes any one or more of the source address, destination address, identifier, and port information of the message to be processed; The message information is converted using a hash algorithm to obtain a hash value of the message to be processed.

3. The method according to claim 1, characterized in that: The determining, according to the hash value of the message to be processed, the message fragment group to which the message to be processed belongs and the fragment group information of the message fragment group includes: According to the hash value of the message to be processed, searching in the hash table for at least one storage space corresponding to the hash value; In the at least one storage space, the storage information in the storage space having the same message information as the message to be processed is determined as the fragment group information of the message fragment group.

4. The method according to claim 3, characterized in that The method further comprises: If at least one storage space corresponding to the hash value is not found according to the hash value of the message to be processed, new storage space is allocated to the message fragment group to which the message to be processed belongs, and the hash table is updated according to the correspondence between the hash value of the message to be processed and the new storage space.

5. The method according to claim 1, characterized in that The method further comprises: According to the reassembly configuration information, determine whether the message reassembly function is enabled; When the message reassembly function is enabled, determining whether the message to be processed is a message fragment according to information carried by the message to be processed; If it is determined that the message to be processed is a message fragment, it is determined that the message to be processed needs to be reassembled.

6. The method according to claim 1, characterized in that The fragmentation information includes a fragmentation offset, a message length, and a fragmentation status identifier of each message in the received message, wherein the fragmentation status identifier is used to indicate whether the message is the last message fragment; The determining, according to the fragment information of the to-be-processed message and the received message, whether all message fragments in the message fragment group have been received includes: Determine the fragment offset, message length and fragment status identifier of the message to be processed; If it is determined according to the fragmentation status identifier of the message to be processed that the message to be processed is the last message fragment in the message fragmentation group, then according to the fragmentation offset and message length of the message to be processed, and the fragmentation offset and message length of each of the messages in the received messages, determine the reassembly position and reassembly order of the message to be processed and each of the messages in the received messages; According to the reassembly position and reassembly order of each of the messages in the to-be-processed message and the received message, it is determined whether all of the message fragments have been received.

7. The method according to claim 6, characterized in that The reorganizing the to-be-processed message and each of the received messages into a target data message comprises: According to the reassembly position and reassembly order of each of the messages in the message to be processed and the received message, the message to be processed and each of the messages in the received message are reassembled to obtain the target data message.

8. A data message processing device, characterized in that: The device comprises: A determination module, used for determining, when a received message to be processed needs to be reassembled, the message fragment group to which the message to be processed belongs and the fragment group information of the message fragment group according to the hash value of the message to be processed, wherein the fragment group information includes the fragment information and address information of the received message in the message fragment group; A storage module, used for storing the message to be processed, and determining whether all message fragments in the message fragment group have been received according to the fragment information of the message to be processed and the received message; An updating module, configured to update the fragment information and address information of the received message according to the message to be processed and the storage address of the message to be processed if all the message fragments in the message fragment group have not been received completely; A reassembly module is used to obtain each message in the received message according to the address information of the received message if all the message fragments in the message fragment group are received, and to reassemble the to-be-processed message and each message in the received message into a target data message.

9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the operation of the data message processing method according to any one of claims 1 to 7 by executing the executable instructions.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for processing a data message according to any one of claims 1 to 7 are implemented.