CN116600031B - Message processing method, device, equipment and storage medium - Google Patents

Message processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN116600031B
CN116600031B CN202310876518.0A CN202310876518A CN116600031B CN 116600031 B CN116600031 B CN 116600031B CN 202310876518 A CN202310876518 A CN 202310876518A CN 116600031 B CN116600031 B CN 116600031B
Authority
CN
China
Prior art keywords
message
keyword
determining
comparison
offset information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310876518.0A
Other languages
Chinese (zh)
Other versions
CN116600031A (en
Inventor
请求不公布姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuxi Muchuang Integrated Circuit Design Co ltd
Original Assignee
Wuxi Muchuang Integrated Circuit Design Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuxi Muchuang Integrated Circuit Design Co ltd filed Critical Wuxi Muchuang Integrated Circuit Design Co ltd
Priority to CN202310876518.0A priority Critical patent/CN116600031B/en
Publication of CN116600031A publication Critical patent/CN116600031A/en
Application granted granted Critical
Publication of CN116600031B publication Critical patent/CN116600031B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a message processing method, a device, equipment and a storage medium, which can be applied to the technical field of communication and the technical field of Internet. Determining message keywords related to a received message to be processed; determining target offset information corresponding to the message to be processed according to the message key words and preset comparison information, wherein the target offset information characterizes the offset data length related to the message to be processed; removing a message header of a message to be processed according to the target offset information to obtain a target message; the determining the target offset information corresponding to the message to be processed comprises the following steps: processing the message keywords based on a hash algorithm to obtain keyword hash values corresponding to the message keywords; comparing the keyword hash value with preset comparison information to obtain a comparison result; and determining target offset information according to the comparison result. According to the scheme, the processing efficiency and the accuracy of the message to be processed can be improved, and the overall efficiency of message interaction is further improved.

Description

Message processing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies and the field of internet technologies, and in particular, to a method, an apparatus, a device, a medium, and a program product for processing a message.
Background
With the rapid development of communication technology, information interaction between different terminals can be generally performed in the form of a transmission message. Correspondingly, in order to facilitate the interaction of the message information, the plurality of switches can also work together so as to provide more communication ports for the terminal. The form in which a plurality of switches work together may be referred to as a stacked unit in which a plurality of switches are stacked. The inventor finds that the process of processing the message information through the stacking unit can negatively influence the interaction efficiency of the message information, thereby influencing the communication timeliness between the terminals.
Disclosure of Invention
In view of the foregoing, the present invention provides a message processing method, apparatus, device, medium, and program product.
According to a first aspect of the present invention, there is provided a message processing method, including: determining message keywords related to the received message to be processed; determining target offset information corresponding to the message to be processed according to the message key words and preset comparison information, wherein the target offset information represents the offset data length related to the message to be processed; removing the message header of the message to be processed according to the target offset information to obtain a target message; wherein, according to the message keyword and preset comparison information, determining the target offset information corresponding to the message to be processed includes: processing the message keywords based on a hash algorithm to obtain keyword hash values corresponding to the message keywords; comparing the keyword hash value with the preset comparison information to obtain a comparison result; and determining the target offset information according to the comparison result.
A second aspect of the present invention provides a message processing apparatus, including: the message keyword determining module is used for determining message keywords related to the received message to be processed; the target offset information determining module is used for determining target offset information corresponding to the message to be processed according to the message key words and preset comparison information, and the target offset information represents the offset data length related to the message to be processed; the target message obtaining module is used for removing the message header of the message to be processed according to the target offset information to obtain a target message; wherein, the target offset information determining module includes: the keyword hash value obtaining submodule is used for processing the message keywords based on a hash algorithm to obtain keyword hash values corresponding to the message keywords; the comparison result obtaining submodule is used for comparing the keyword hash value with the preset comparison information to obtain a comparison result; and a target offset information obtaining sub-module, configured to determine the target offset information according to the comparison result. A third aspect of the present invention provides an electronic device comprising: one or more processors; and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the message processing method described above.
A fourth aspect of the present invention also provides a computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the above-described message processing method.
The fifth aspect of the present invention also provides a computer program product comprising a computer program which, when executed by a processor, implements the above-mentioned message processing method.
According to the message processing method, device, equipment, medium and program product provided by the invention, the target offset information is determined according to the message key words determined from the message to be processed and the preset comparison information, so that the target offset information can be determined individually for the message to be processed, the message head identification error is avoided, meanwhile, the terminal which receives the message to be processed by the switch and the like can automatically identify and remove the message head according to the target offset information related to the message to be processed, the processing efficiency and accuracy of the message to be processed are improved, and the overall efficiency of message interaction is further improved.
Drawings
The foregoing and other objects, features and advantages of the invention will be apparent from the following description of embodiments of the invention, which proceeds with reference to the accompanying drawings.
Fig. 1 schematically shows a schematic diagram of message information according to a comparative example of the present invention.
Fig. 2 schematically illustrates an application scenario diagram of a message processing method and apparatus according to an embodiment of the present invention.
Fig. 3 schematically shows a flow chart of a message processing method according to an embodiment of the invention.
Fig. 4A schematically shows a schematic diagram of a data table for a message processing method according to an embodiment of the invention.
Fig. 4B schematically illustrates a data table for a message processing method according to another embodiment of the invention.
Fig. 4C schematically illustrates a flowchart for determining target offset information corresponding to a message to be processed according to a message keyword and preset comparison information according to an embodiment of the present invention.
Fig. 5A schematically illustrates an application scenario diagram of a message processing method according to an embodiment of the present invention.
Fig. 5B schematically illustrates an application scenario diagram of a message processing method according to an embodiment of the present invention.
Fig. 6 schematically shows a block diagram of a message processing apparatus according to an embodiment of the invention.
Fig. 7 schematically shows a block diagram of an electronic device adapted to implement a message processing method according to an embodiment of the invention.
Detailed Description
Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. It should be understood that the description is only illustrative and is not intended to limit the scope of the invention. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the invention. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the present invention.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
In general, in order to facilitate internal communication between a plurality of switches in a stack unit, message information received by the switches in the stack unit is typically configured with a private data header (or header).
Fig. 1 schematically shows a schematic diagram of message information according to a comparative example of the present invention.
As shown in fig. 1, the message information 100 received by the switches in the stack unit may be configured with a private header 110. I.e. a private header 110 containing ethernet two-layer header and custom data may be configured before the destination MAC address of the message information 100. After receiving the message information 100, the network card needs to remove the data field corresponding to the private message header 110 so as to analyze and obtain the data to be processed in the message information 100.
Before removing the private header, the private header in the message information needs to be identified to avoid that the data content in the message information is not deleted by mistake. In the related art, switches produced by different manufacturers, or switches of different models, are provided with different byte numbers of private message headers. Therefore, the switch is difficult to adaptively remove the private message heads of various types, so that the processing efficiency of the message information is low, and the switch with more quantity and variety needs to be configured to realize the message information interaction.
The embodiment of the invention provides a message processing method, a message processing device, a message processing medium and a program product. The method comprises the following steps: determining message keywords related to the received message to be processed; determining target offset information corresponding to the message to be processed according to the message key words and preset comparison information, wherein the target offset information characterizes the offset data length related to the message to be processed; removing the message header of the message to be processed according to the target offset information to obtain a target message information message; wherein, according to the message keyword and preset comparison information, determining the target offset information corresponding to the message to be processed includes: processing the message keywords based on a hash algorithm to obtain keyword hash values corresponding to the message keywords; comparing the keyword hash value with preset comparison information to obtain a comparison result; and determining target offset information according to the comparison result. According to the embodiment of the invention, the target offset information is determined according to the message keywords determined from the message to be processed and the preset comparison information, so that the target offset information can be determined individually for the message to be processed, the message head identification error is avoided, meanwhile, the terminal which is used for receiving the message to be processed by the switch can automatically identify and remove the message head according to the target offset information related to the message to be processed, the processing efficiency and the accuracy of the message to be processed are improved, and the overall efficiency of message interaction is further improved.
Fig. 2 schematically illustrates an application scenario diagram of a message processing method and apparatus according to an embodiment of the present invention.
As shown in fig. 2, the application scenario 200 according to this embodiment may be included in terminal devices 201, 202, 203, a network 204, a stacking unit 205, and a server 206. The network 204 is used as a medium to provide communication links between the terminal devices 201, 202, 203 and the server 206. The network 204 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 206 via the network 204 and the stacking unit 205 using the terminal devices 201, 202, 203 to receive or send messages or the like. Various communication client applications, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 201, 202, 203.
The terminal devices 201, 202, 203 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The stacking unit 205 may include a plurality of switches, for example, switches 2051 and 2052. A communication connection may be made between switches 2051 and 2052.
The server 206 may be a server providing various services, such as a background management server (by way of example only) providing support for websites browsed by users using the terminal devices 201, 202, 203. The background management server may analyze and process the received data such as the user request, and feed back the processing result (e.g., the web page, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that, the message processing method provided in the embodiment of the present invention may be generally executed by any one or more switches in the stacking unit 205. Accordingly, the message processing apparatus provided in the embodiments of the present invention may be generally disposed in any one or more switches in the stacking unit 205.
Alternatively, the method for processing a message provided by the embodiment of the present invention may be generally performed by the server 206. Accordingly, the message processing apparatus provided in the embodiments of the present invention may be generally disposed in the server 206. The message processing method provided by the embodiment of the present invention may also be performed by a server or a server cluster, which is different from the server 206 and is capable of communicating with the terminal devices 201, 202, 203 and/or the server 206. Accordingly, the message processing apparatus provided by the embodiment of the present invention may also be provided in a server or a server cluster different from the server 206 and capable of communicating with the terminal devices 201, 202, 203 and/or the server 206.
Alternatively, the method for processing a message provided by the embodiment of the present invention may also be executed by the terminal devices 201, 202, 203. Correspondingly, the message processing apparatus provided by the embodiment of the present invention may also be provided in the terminal devices 201, 202, 203.
It should be understood that the number of end devices, networks, switches, and servers in fig. 2 are merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The message processing method of the disclosed embodiment will be described in detail with reference to fig. 3 to 5B based on the scenario described in fig. 2.
Fig. 3 schematically shows a flow chart of a message processing method according to an embodiment of the invention.
As shown in FIG. 3, the message processing method of this embodiment includes operations S310 to S330.
In operation S310, a message key associated with the received message to be processed is determined.
According to an embodiment of the present invention, the message key may be data of a preset byte length (also referred to as a preset data bit width) in the message to be processed. The message key may be formed based on any message data in the message to be processed. For example, the message keyword may be obtained based on the message data of the first byte of the message to be processed, but not limited thereto, and the message keyword may be determined based on other manners.
In operation S320, target offset information corresponding to the message to be processed is determined according to the message key and the preset comparison information, where the target offset information characterizes an offset data length related to the message to be processed.
According to the embodiment of the invention, the preset contrast information may be determined based on any message attribute such as the type, the data length and the like of the message to be processed, and the preset contrast information may include one or more pieces. The target offset information may be used to characterize the data offset length of the header (private header) that identifies the message to be processed.
According to the embodiment of the invention, the message keywords can be compared with the preset comparison information, so that a data table associated with the preset comparison information is queried according to the comparison result, and further the target offset information corresponding to the message to be processed is obtained.
According to the embodiment of the invention, the target offset information corresponding to the message to be processed can be determined according to other modes, for example, the information identification of the preset comparison information can be used as the target offset information, so that the query time of the query data table is saved, and the efficiency of obtaining the target offset information is improved.
In operation S330, the header of the message to be processed is removed according to the target offset information, so as to obtain the target message.
According to the embodiment of the invention, the target offset information is determined according to the message keywords determined from the message to be processed and the preset comparison information, so that the target offset information can be determined individually for the message to be processed, the message head identification error is avoided, meanwhile, the terminal which is used for receiving the message to be processed by the switch can automatically identify and remove the message head according to the target offset information related to the message to be processed, the processing efficiency and the accuracy of the message to be processed are improved, and the overall efficiency of message interaction is further improved.
In operation S310, determining a message key related to a received message to be processed may include the following operations according to an embodiment of the present invention.
And extracting message data with a first preset data length from the message to be processed according to the first preset position to obtain a message keyword.
According to an embodiment of the present invention, for example, a message keyword may be extracted from a message to be processed based on a first preset position shown in table 1. Under the condition that the first preset data length is 16 bytes, the first preset position can be obtained by shifting the position of the 0 th byte in the message to be processed according to the shifting data length (for example, 1 byte) shown in table 1, namely, shifting 1 byte from the position of the 0 th byte in the message to be processed. According to the first preset data length of 16 bytes, the message data with the length of 16 bytes can be extracted from the first preset position of the message to be processed, and then the message key word can be obtained.
Fig. 4A schematically shows a schematic diagram of a data table for a message processing method according to an embodiment of the invention.
As shown in fig. 4A, 64 message keywords may be extracted from the message to be processed based on the first preset positions corresponding to the serial numbers of the comparison modules shown in the data table (i.e. table 1) shown in fig. 4A.
In operation S310, determining the message key related to the received message to be processed may further include the following operations according to an embodiment of the present invention.
Determining key message data corresponding to each of the K second preset positions from the message to be processed according to the K second preset positions and the second preset data lengths corresponding to each of the K second preset positions; and obtaining the message keywords according to the K pieces of key message data.
Fig. 4B schematically illustrates a data table for a message processing method according to another embodiment of the invention.
As shown in fig. 4B, the message key may be extracted from the message to be processed based on the second preset location shown in the data table (i.e. table 2) shown in fig. 4B. That is, in the case of k=16, K second preset positions may be determined based on the contents shown in table 2. For example, for a message key with a key number of 1, in the case of k=1, the position of the 0 th byte in the to-be-processed message is shifted according to the shift data length (for example, 1 byte) shown in table 2, that is, the position of the 0 th byte in the to-be-processed message is shifted by 1 byte, so that the 1 st second preset position can be obtained. In the case of k=2, the position of the 1 st byte in the to-be-processed packet is shifted according to the shift data length (for example, 1 byte) shown in table 2, that is, the position of the 1 st byte in the to-be-processed packet is shifted by 1 byte, so that the 2 nd second preset position can be obtained.
For another example, when the second preset data lengths corresponding to the K second preset positions are 1 byte, K pieces of key message data can be extracted from the message to be processed according to the K second preset positions, and the K pieces of key message data are spliced according to a preset rule, so that the message key word can be obtained.
Fig. 4C schematically illustrates a flowchart for determining target offset information corresponding to a message to be processed according to a message keyword and preset comparison information according to an embodiment of the present invention.
As shown in fig. 4C, in operation S320, determining the target offset information corresponding to the message to be processed according to the message keyword and the preset comparison information may include operations S410 to S430.
In operation S410, the message key is processed based on a hash algorithm to obtain a key hash value corresponding to the message key.
In operation S420, the keyword hash value is compared with the preset comparison information, and a comparison result is obtained.
In operation S430, target offset information is determined according to the comparison result.
According to the embodiment of the invention, the preset comparison information and the keyword hash value can be compared based on the comparison circuit module, so that the problem of determining the target offset information from the hardware level is solved.
According to the embodiment of the invention, the preset contrast information can be stored based on the CAM (Content Addressable Memory ) so as to quickly inquire the preset contrast information corresponding to the keyword hash value, thereby improving the determination efficiency of determining the target offset information.
It should be noted that, the number of the keywords of the message is not limited in the embodiment of the present invention, and a person skilled in the art may select the keyword hash value of each keyword of the message according to the actual requirement, so long as the keyword hash value of each keyword of the message is associated with corresponding preset comparison information.
According to the embodiment of the invention, processing the message keyword based on the hash algorithm, and obtaining the keyword hash value corresponding to the message keyword can comprise the following operations.
And processing the N message keywords in parallel based on a hash algorithm to obtain keyword hash values corresponding to the N message keywords.
Fig. 5A schematically illustrates an application scenario diagram of a message processing method according to an embodiment of the present invention.
As shown in fig. 5A, in the case where n=4, the 1 st message key, the 2 nd message key … … to the 4 th message key may be input to the hash algorithm module in parallel, so as to obtain 4 key hash values.
According to the message processing method provided by the embodiment of the invention, N message keywords can be processed in parallel based on a fixed circuit and a register completion hash algorithm. Each register can store 32bits of message keywords, and the registers combined with the message keywords can be multiplexed, so that the message processing system can be directly realized through a hardware circuit very simply, a Hash table is not required to be queried, complex data structures or circuit devices such as a memory hardware unit (e.g. CAM) and the like are not required to be set, the execution rate of message processing is improved, the hardware complexity of message processing is reduced, and the message processing efficiency is improved.
According to an embodiment of the invention, the key hash value comprises N.
In the above operation, comparing the keyword hash value with the preset comparison information, and obtaining the comparison result may include the following operations.
And comparing the N keyword hash values with N preset comparison information associated with the keyword hash values in parallel to obtain N comparison results.
As shown in fig. 5A, in the case where n=4, the 1 st keyword hash value corresponding to the 1 st message keyword, the 2 nd keyword hash value … … corresponding to the 2 nd message keyword, and the 4 th keyword hash value corresponding to the 4 th message keyword are input to the 1 st comparison module and the 2 nd comparison module … … to the 4 th comparison module, respectively, in parallel. Correspondingly, the 1 st hash comparison value (1 st preset comparison information), the 2 nd hash comparison value (2 nd preset comparison information) … … to the 4 th hash comparison value (4 th preset comparison information) can also be respectively input to the 1 st comparison module and the 2 nd comparison module … … to the 4 th comparison module in parallel. Thus, 4 comparison results were obtained. The 4 comparison results can be input into a message header offset selector, so as to obtain target offset information.
According to an embodiment of the invention, the N key hash values are each associated with a key identification.
According to an embodiment of the present invention, in operation S430, determining the target offset information according to the comparison result may include the following operations.
From the N comparison results, M candidate comparison results with matched characterization are determined; determining a target comparison result from the M candidate comparison results according to the keyword identifications associated with the M candidate comparison results; and determining target offset information according to the target keyword identification associated with the target comparison result.
According to embodiments of the invention, M may be any integer greater than 1.
According to the embodiment of the invention, under the condition that a sequence relation exists among M keyword identifications, a target comparison result is determined from the M candidate comparison results according to the keyword identifications respectively associated with the M candidate comparison results, and the keyword identifications at the first order in the M keyword identifications can be determined as target keyword identifications, so that the message keywords matched with the target comparison result can be obtained from N keyword hash values through the target comparison result associated with the target keyword identifications, and the offset information of the message keywords matched with the target comparison result in the message to be processed can be obtained, namely the target offset information can be obtained.
According to an embodiment of the present invention, determining target offset information according to a comparison result includes:
and under the condition that the comparison result characterizations are matched, determining target offset information according to the comparison information identification of the preset comparison information related to the comparison result.
According to the embodiment of the invention, under the condition that the target OFFSET information of the message to be processed is obtained, the message header (i.e. the private header) of the message to be processed can be removed according to the target OFFSET information (e.g. PRIV_HDR_OFFSET_x) to obtain the target message.
According to the embodiment of the invention, under the condition that the hash values of the N keywords are not matched with the corresponding preset comparison information, corresponding marking information, such as 0xFFFF_FFFF, can be returned, so that the message to be processed can be sent to other message processing modules for timely processing.
Fig. 5B schematically illustrates an application scenario diagram of a message processing method according to an embodiment of the present invention.
As shown in fig. 5B, in the case where n=4, the 1 st message key, the 2 nd message key … … to the 4 th message key may be input into different hash algorithm modules in parallel. For example, the 1 st message keyword, the 2 nd message keyword … … to the 4 th message keyword may be input to the 1 st hash algorithm module, the 2 nd hash algorithm module … … to the 4 th hash algorithm module, respectively, so as to obtain 4 keyword hash values. The 1 st hash comparison value, the second hash comparison values … … to 4 th hash comparison value, and the keyword hash values respectively output by the 1 st hash algorithm module, the 2 nd hash algorithm module … … to 4 th hash algorithm module can be respectively input to the 1 st comparison module, the 2 nd comparison module … … to 4 th comparison module. Thus, 4 comparison results were obtained. The 4 comparison results can be input into a message header offset selector, so as to obtain target offset information.
The 1 st hash algorithm module and the 2 nd hash algorithm modules … … to 4 th hash algorithm modules can be constructed based on different hash algorithms, so that the data processing complexity of the message to be processed is improved, and the information security attribute of the message to be processed is improved.
Based on the message processing method, the invention also provides a message processing device. The device will be described in detail below in connection with fig. 6.
Fig. 6 schematically shows a block diagram of a message processing apparatus according to an embodiment of the invention.
As shown in fig. 6, the message processing apparatus 600 of this embodiment includes a message keyword determination module 610, a target offset information determination module 620, and a target message obtaining module 630.
The message keyword determining module 610 is configured to determine a message keyword related to a received message to be processed;
the target offset information determining module 620 is configured to determine target offset information corresponding to the message to be processed according to the message keyword and preset comparison information; and
the target message obtaining module 630 is configured to remove a header of the message to be processed according to the target offset information, so as to obtain a target message.
According to an embodiment of the present invention, the target offset information determining module includes: the device comprises a keyword hash value obtaining sub-module, a comparison result obtaining sub-module and a target offset information obtaining sub-module.
And the keyword hash value obtaining sub-module is used for processing the message keywords based on a hash algorithm to obtain keyword hash values corresponding to the message keywords.
The comparison result obtaining submodule is used for comparing the keyword hash value with preset comparison information to obtain a comparison result.
And the target offset information obtaining sub-module is used for determining target offset information according to the comparison result.
According to an embodiment of the invention, the key hash value comprises N.
According to an embodiment of the present invention, the comparison result obtaining submodule includes a comparison result obtaining unit.
The comparison result obtaining unit is used for parallelly comparing the N key word hash values with N preset comparison information associated with the key word hash values respectively to obtain N comparison results.
According to an embodiment of the invention, the N key hash values are each associated with a key identification.
Wherein the target offset information obtaining submodule includes: the device comprises a candidate comparison result obtaining unit, a target comparison result obtaining unit and a target offset information obtaining unit.
The candidate comparison result obtaining unit is used for determining M candidate comparison results which are matched in representation from the N comparison results.
The target comparison result obtaining unit is used for determining a target comparison result from the M candidate comparison results according to the keyword identifications associated with the M candidate comparison results; and
The first target offset information obtaining unit is used for determining target offset information according to the target keyword identification associated with the target comparison result.
According to an embodiment of the present invention, the key hash value obtaining submodule includes a key hash value obtaining unit.
The keyword hash value obtaining unit is used for processing N message keywords in parallel based on a hash algorithm to obtain keyword hash values corresponding to the N message keywords.
According to an embodiment of the present invention, the target offset information obtaining sub-module includes a second target offset information obtaining unit.
The second target offset information obtaining unit is used for determining target offset information according to the comparison information identification of the preset comparison information related to the comparison result under the condition that the comparison result characterization is matched.
According to the embodiment of the invention, the message keyword determination module comprises a message keyword obtaining sub-module.
The first message keyword obtaining submodule is used for extracting message data with a first preset data length from the message to be processed according to the first preset position to obtain a message keyword.
According to an embodiment of the present invention, the message keyword determining module includes: the system comprises a key message data obtaining sub-module and a second message key word obtaining sub-module.
The key message data obtaining sub-module is used for determining key message data corresponding to each of the K preset positions from the message to be processed according to the K preset positions and the second preset data lengths corresponding to each of the K preset positions.
The second message keyword obtaining submodule is used for obtaining message keywords according to the K pieces of key message data.
Any of the message key determination module 610, the target offset information determination module 620, and the target message obtaining module 630 may be combined in one module or any of the modules may be split into a plurality of modules according to an embodiment of the present invention. Alternatively, at least some of the functionality of one or more of the modules may be combined with at least some of the functionality of other modules and implemented in one module. At least one of the message key determination module 610, the target offset information determination module 620, and the target message acquisition module 630 may be implemented, at least in part, as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system-on-chip, a system-on-substrate, a system-on-package, an Application Specific Integrated Circuit (ASIC), or as hardware or firmware in any other reasonable manner of integrating or packaging the circuitry, or as any one of or a suitable combination of any of the three. Alternatively, at least one of the message key determination module 610, the target offset information determination module 620, and the target message obtaining module 630 may be at least partially implemented as a computer program module that, when executed, performs the corresponding functions.
Fig. 7 schematically shows a block diagram of an electronic device adapted to implement a message processing method according to an embodiment of the invention.
As shown in fig. 7, an electronic device 700 according to an embodiment of the present invention includes a processor 701 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. The processor 701 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. The processor 701 may also include on-board memory for caching purposes. The processor 701 may comprise a single processing unit or a plurality of processing units for performing different actions of the method flow according to an embodiment of the invention.
In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. The processor 701 performs various operations of the method flow according to an embodiment of the present invention by executing programs in the ROM 702 and/or the RAM 703. Note that the program may be stored in one or more memories other than the ROM 702 and the RAM 703. The processor 701 may also perform various operations of the method flow according to embodiments of the present invention by executing programs stored in the one or more memories.
According to an embodiment of the invention, the electronic device 700 may further comprise an input/output (I/O) interface 705, the input/output (I/O) interface 705 also being connected to the bus 704. The electronic device 700 may also include one or more of the following components connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output portion 707 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read therefrom is mounted into the storage section 708 as necessary.
The present invention also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present invention.
According to embodiments of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example, but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to an embodiment of the invention, the computer-readable storage medium may include ROM 702 and/or RAM 703 and/or one or more memories other than ROM 702 and RAM 703 described above.
Embodiments of the present invention also include a computer program product comprising a computer program containing program code for performing the method shown in the flowcharts. The program code means for causing a computer system to carry out the methods provided by embodiments of the present invention when the computer program product is run on the computer system.
The above-described functions defined in the system/apparatus of the embodiment of the present invention are performed when the computer program is executed by the processor 701. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the invention.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed over a network medium in the form of signals, downloaded and installed via the communication section 709, and/or installed from the removable medium 711. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. The above-described functions defined in the system of the embodiment of the present invention are performed when the computer program is executed by the processor 701. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the invention.
According to embodiments of the present invention, program code for carrying out computer programs provided by embodiments of the present invention may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or in assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams 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.
Those skilled in the art will appreciate that the features recited in the various embodiments of the invention and/or in the claims may be combined in various combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the invention. In particular, the features recited in the various embodiments of the invention and/or in the claims can be combined in various combinations and/or combinations without departing from the spirit and teachings of the invention. All such combinations and/or combinations fall within the scope of the invention.
The embodiments of the present invention are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present invention. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the invention is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the invention, and such alternatives and modifications are intended to fall within the scope of the invention.

Claims (8)

1. A method for processing a message, comprising:
determining message keywords related to the received message to be processed;
Determining target offset information corresponding to the message to be processed according to the message key words and preset comparison information, wherein the target offset information represents the offset data length related to the message to be processed; and
removing the message header of the message to be processed according to the target offset information to obtain a target message;
wherein, according to the message keyword and preset comparison information, determining target offset information corresponding to the message to be processed includes:
processing the message keywords based on a hash algorithm to obtain keyword hash values corresponding to the message keywords;
comparing the keyword hash value with the preset comparison information to obtain a comparison result; and
determining the target offset information according to the comparison result;
wherein the keyword hash value comprises N pieces;
the keyword hash value is compared with the preset comparison information, and the comparison result comprises the following steps:
comparing N keyword hash values with N preset comparison information associated with the keyword hash values in parallel to obtain N comparison results;
wherein, the N keyword hash values are respectively associated with keyword identifications;
Wherein, according to the comparison result, determining the target offset information includes:
from N comparison results, M candidate comparison results with matched characterization are determined;
determining a target comparison result from the M candidate comparison results according to the keyword identifications associated with the M candidate comparison results; and
and determining the target offset information according to the target keyword identification associated with the target comparison result.
2. The method of claim 1, wherein processing the message key based on a hash algorithm to obtain a key hash value corresponding to the message key comprises:
and processing N message keywords in parallel based on a hash algorithm to obtain keyword hash values corresponding to the N message keywords.
3. The method of claim 1, wherein determining the target offset information based on the comparison comprises:
and under the condition that the comparison result characterization is matched, determining the target offset information according to the comparison information identification of the preset comparison information related to the comparison result.
4. The method of claim 1, wherein determining message keywords associated with the received message to be processed comprises:
And extracting message data with a first preset data length from the message to be processed according to the first preset position to obtain the message keyword.
5. The method of claim 1, wherein determining message keywords associated with the received message to be processed comprises:
determining key message data corresponding to each of the K second preset positions from the message to be processed according to the K second preset positions and the second preset data lengths corresponding to each of the K second preset positions; and
and obtaining the message keywords according to the K pieces of key message data.
6. A message processing apparatus, comprising:
the message keyword determining module is used for determining message keywords related to the received message to be processed;
the target offset information determining module is used for determining target offset information corresponding to the message to be processed according to the message key words and preset comparison information, and the target offset information represents the offset data length related to the message to be processed; and
the target message obtaining module is used for removing the message header of the message to be processed according to the target offset information to obtain a target message;
Wherein the target offset information determining module includes:
the keyword hash value obtaining submodule is used for processing the message keywords based on a hash algorithm to obtain keyword hash values corresponding to the message keywords;
the comparison result obtaining submodule is used for comparing the keyword hash value with the preset comparison information to obtain a comparison result; and
the target offset information obtaining sub-module is used for determining the target offset information according to the comparison result;
wherein the keyword hash value comprises N pieces;
the comparison result obtaining submodule comprises:
the comparison result obtaining unit is used for comparing N key word hash values with N preset comparison information associated with the key word hash values in parallel to obtain N comparison results;
wherein, the N keyword hash values are respectively associated with keyword identifications;
wherein the target offset information obtaining submodule includes:
the candidate comparison result obtaining unit is used for determining M candidate comparison results with matched characterization from N comparison results;
the target comparison result obtaining unit is used for determining a target comparison result from the M candidate comparison results according to the keyword identifications associated with the M candidate comparison results; and
And the first target offset information obtaining unit is used for determining the target offset information according to the target keyword identification associated with the target comparison result.
7. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-5.
8. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method according to any of claims 1-5.
CN202310876518.0A 2023-07-18 2023-07-18 Message processing method, device, equipment and storage medium Active CN116600031B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310876518.0A CN116600031B (en) 2023-07-18 2023-07-18 Message processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310876518.0A CN116600031B (en) 2023-07-18 2023-07-18 Message processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116600031A CN116600031A (en) 2023-08-15
CN116600031B true CN116600031B (en) 2023-10-31

Family

ID=87599538

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310876518.0A Active CN116600031B (en) 2023-07-18 2023-07-18 Message processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116600031B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104104604A (en) * 2013-04-04 2014-10-15 马维尔以色列(M.I.S.L.)有限公司 Exact match hash lookup databases in network switch devices
CN106549941A (en) * 2016-10-14 2017-03-29 盛科网络(苏州)有限公司 Message filtering method and packet filtering chip based on IP message lengths
CN106789388A (en) * 2016-03-25 2017-05-31 新华三技术有限公司 The determination method and device of packet check content
CN110730143A (en) * 2015-11-11 2020-01-24 大唐移动通信设备有限公司 Fragment data packet processing method and device
CN111181857A (en) * 2018-11-09 2020-05-19 深圳市中兴微电子技术有限公司 Message processing method and device, storage medium and optical network terminal
CN113438252A (en) * 2021-07-08 2021-09-24 恒安嘉新(北京)科技股份公司 Message access control method, device, equipment and storage medium
CN113691486A (en) * 2020-05-19 2021-11-23 中移(成都)信息通信科技有限公司 Message modification method, device, equipment and storage medium
CN114500093A (en) * 2022-02-24 2022-05-13 中国工商银行股份有限公司 Safe interaction method and system for message information
CN114780537A (en) * 2022-03-23 2022-07-22 阿里巴巴(中国)有限公司 Flow table storage and message forwarding method, device, computing equipment and medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104104604A (en) * 2013-04-04 2014-10-15 马维尔以色列(M.I.S.L.)有限公司 Exact match hash lookup databases in network switch devices
CN110730143A (en) * 2015-11-11 2020-01-24 大唐移动通信设备有限公司 Fragment data packet processing method and device
CN106789388A (en) * 2016-03-25 2017-05-31 新华三技术有限公司 The determination method and device of packet check content
CN106549941A (en) * 2016-10-14 2017-03-29 盛科网络(苏州)有限公司 Message filtering method and packet filtering chip based on IP message lengths
CN111181857A (en) * 2018-11-09 2020-05-19 深圳市中兴微电子技术有限公司 Message processing method and device, storage medium and optical network terminal
CN113691486A (en) * 2020-05-19 2021-11-23 中移(成都)信息通信科技有限公司 Message modification method, device, equipment and storage medium
CN113438252A (en) * 2021-07-08 2021-09-24 恒安嘉新(北京)科技股份公司 Message access control method, device, equipment and storage medium
CN114500093A (en) * 2022-02-24 2022-05-13 中国工商银行股份有限公司 Safe interaction method and system for message information
CN114780537A (en) * 2022-03-23 2022-07-22 阿里巴巴(中国)有限公司 Flow table storage and message forwarding method, device, computing equipment and medium

Also Published As

Publication number Publication date
CN116600031A (en) 2023-08-15

Similar Documents

Publication Publication Date Title
US9104676B2 (en) Hash algorithm-based data storage method and system
CN110019080B (en) Data access method and device
WO2021023149A1 (en) Method and apparatus for dynamically returning message
CN107704202B (en) Method and device for quickly reading and writing data
US10733008B2 (en) Method, device and computer readable storage medium for managing a virtual machine
CN111460129B (en) Method, device, electronic equipment and storage medium for generating identification
CN113076153B (en) Interface calling method and device
CN112905933A (en) Page jump method and device, electronic equipment and storage medium
CN113242331A (en) Different types of address translation methods, different types of address translation devices, different types of computer equipment and different types of storage media
US11310316B2 (en) Methods, devices and computer program products for storing and accessing data
CN115190062A (en) Service processing method and device, electronic equipment and computer readable storage medium
US10897483B2 (en) Intrusion detection system for automated determination of IP addresses
CN116600031B (en) Message processing method, device, equipment and storage medium
US20140283080A1 (en) Identifying stored vulnerabilities in a web service
CN114006868B (en) Flow screening method and device
CN112948138A (en) Method and device for processing message
CN114338529B (en) Five-tuple rule matching method and device
CN115150331B (en) Information processing method, information processing device, electronic device, and medium
CN113448652A (en) Request processing method and device
CN113726885B (en) Flow quota adjusting method and device
CN112887442B (en) Method and device for processing domain name resolution query request
CN114143083B (en) Blacklist policy matching method and device, electronic equipment and storage medium
CN113360939B (en) Security access control method and device
CN114449031B (en) Information acquisition method, device, equipment and storage medium
CN114363257B (en) Five-tuple matching method and device for tunnel message

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