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

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

Info

Publication number
CN113595931A
CN113595931A CN202110772783.5A CN202110772783A CN113595931A CN 113595931 A CN113595931 A CN 113595931A CN 202110772783 A CN202110772783 A CN 202110772783A CN 113595931 A CN113595931 A CN 113595931A
Authority
CN
China
Prior art keywords
message
determining
type
label information
layer protocol
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110772783.5A
Other languages
Chinese (zh)
Other versions
CN113595931B (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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN202110772783.5A priority Critical patent/CN113595931B/en
Publication of CN113595931A publication Critical patent/CN113595931A/en
Application granted granted Critical
Publication of CN113595931B publication Critical patent/CN113595931B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2441Traffic characterised by specific attributes, e.g. priority or QoS relying on flow classification, e.g. using integrated services [IntServ]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2483Traffic characterised by specific attributes, e.g. priority or QoS involving identification of individual flows
    • 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/30Definitions, standards or architectural aspects of layered protocol stacks
    • H04L69/32Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
    • H04L69/322Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions
    • H04L69/324Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions in the data link layer [OSI layer 2], e.g. HDLC
    • 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/30Definitions, standards or architectural aspects of layered protocol stacks
    • H04L69/32Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
    • H04L69/322Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions
    • H04L69/326Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions in the transport layer [OSI layer 4]

Abstract

The application relates to a message processing method, a message processing device, message processing equipment and a storage medium. Relates to the technical field of communication. The problem that the integrated equipment cannot identify whether the received message is a message of a transmission layer protocol or a message of a data link layer protocol can be solved. The method comprises the following steps: acquiring a first message; the first message is derived based on an initial message from the communication device. Determining the type of the first message based on a linked list rule; the type comprises a message of a transmission layer protocol or a message of a data link layer protocol; the linked list rule comprises the corresponding relation between the characteristic information and the type of the message; the characteristic information comprises at least one of a source address for characterizing the message, a destination address for the message, and a network type. And determining a target message according to the type of the first message, and transmitting the target message.

Description

Message processing method, device, equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing a packet.
Background
The terminal device generally uses a message of a transport layer protocol such as a transmission control protocol/internet protocol (TCP/IP); the switch device generally uses a Link Layer Discovery Protocol (LLDP), a Link Aggregation Control Protocol (LACP), and other data Link layer Protocol messages.
However, whether for the transmission of messages of the transport layer protocol or for the transmission of messages of the data link layer protocol, the data switching function provided by the switch device is indispensable. Therefore, in order to reduce the number of devices, the data exchange function of the switch device and the function of the terminal device may be integrated into one device. However, the integrated device cannot identify whether the received message is a message of a transport layer protocol or a data link layer protocol, which results in that the message cannot be accurately transmitted.
Disclosure of Invention
The application provides a message processing method, a message processing device and a message processing storage medium, which can solve the problem that an integrated device cannot identify whether a received message is a message of a transport layer protocol or a message of a data link layer protocol.
In order to achieve the purpose, the technical scheme is as follows:
in a first aspect, a resource allocation method is provided, where the method includes: acquiring a first message; the first message is derived based on an initial message from the communication device. Determining the type of the first message based on a linked list rule; the type comprises a message of a transmission layer protocol or a message of a data link layer protocol; the linked list rule comprises the corresponding relation between the characteristic information and the type of the message; the characteristic information comprises at least one of a source address for characterizing the message, a destination address for the message, and a network type. And determining a target message according to the type of the first message, and transmitting the target message.
Optionally, determining the type of the first packet based on the linked list rule includes: determining label information of the first message; the label information is at least used for identifying the port of the communication equipment for transmitting the initial message and the network to which the port belongs. And deleting the label information to generate a second message. And determining the type of the second message based on the linked list rule, and taking the type of the second message as the type of the first message.
Optionally, determining the target packet according to the type of the first packet includes: and under the condition that the type of the first message is the message of the transport layer protocol, adding label information into the second message to generate a target message. And/or determining the second message as the target message under the condition that the type of the first message is the message of the data link layer protocol.
Optionally, determining the tag information of the first packet includes: and calling a hook function to analyze the second message and determine the label information.
Optionally, determining the type of the second packet based on the linked list rule includes: and matching the linked list rule with the second message. And if the matching is successful, determining the type of the second message as the message of the data link layer protocol. And/or if the matching fails, determining that the type of the second message is a message of a transport layer protocol.
Optionally, the tag information includes: the number of the communication device, the port number of the communication device, the network to which the port of the communication device belongs, and the priority setting of the network.
Optionally, the obtaining the first packet includes: an initial message is received from a communication device. And determining whether the initial message contains label information. And if the initial message is contained and the label information is accurate, determining that the initial message is the first message. And/or if the first message contains the new label information and the label information is wrong, determining the new label information according to the transmission information of the initial message, updating the label information in the initial message by using the new label information, and determining the updated initial message as the first message. And/or if the first message does not contain the first message, determining label information according to the transmission information of the initial message, adding the label information into the initial message, and determining that the initial message added with the label information is the first message.
Optionally, determining the target packet according to the type of the first packet includes: and under the condition that the type of the first message is a message of a transport layer protocol, determining the label information of the first message, deleting the label information in the first message, and generating a target message. And/or determining the first message as a target message under the condition that the type of the first message is a message of a data link layer protocol.
Optionally, before receiving the first message from the communication device, the method includes: receiving debugging parameters input by a user; the debugging parameters are used for indicating to capture messages received and transmitted by the MAC layer. After receiving the first message from the communication device, the method includes: and capturing the first message and the target message based on the debugging parameters. Determining a difference between the first message and the target message.
In a second aspect, a message processing apparatus is provided, which includes: a switch chip and a processor. The switching chip is used for acquiring a first message; the first message is derived based on an initial message from the communication device. The processor is used for determining the type of the first message acquired by the switching chip based on the chain table rule; the type comprises a message of a transmission layer protocol or a message of a data link layer protocol; the linked list rule comprises the corresponding relation between the characteristic information and the type of the message; the characteristic information comprises at least one of a source address for characterizing the message, a destination address for the message, and a network type. And the processor is also used for determining a target message according to the type of the first message and transmitting the target message.
Optionally, the processor is specifically configured to: determining label information of the first message; the label information is at least used for identifying a port of the communication equipment for transmitting the initial message and a network to which the port belongs; deleting the label information to generate a second message; and determining the type of the second message based on the linked list rule, and taking the type of the second message as the type of the first message.
Optionally, the processor is specifically configured to: under the condition that the type of the first message is a message of a transport layer protocol, adding tagging information into the second message to generate a target message; and/or determining the second message as the target message under the condition that the type of the first message is the message of the data link layer protocol.
Optionally, the processor is specifically configured to invoke a hook function to analyze the second message and determine the tag information.
Optionally, the processor is specifically configured to: matching the linked list rule with the second message; if the matching is successful, determining the type of the second message as a message of a data link layer protocol; and/or if the matching fails, determining that the type of the second message is a message of a transport layer protocol.
Optionally, the tag information includes: the number of the communication device, the port number of the communication device, the network to which the port of the communication device belongs, and the priority setting of the network.
Optionally, the switching chip is specifically configured to: receiving an initial message from a communication device; determining whether the initial message contains label information; if the first message is contained and the label information is accurate, determining that the initial message is a first message; and/or if the first message contains the new label information and the label information is wrong, determining the new label information according to the transmission information of the initial message, updating the label information in the initial message by using the new label information, and determining the updated initial message as the first message; and/or if the first message does not contain the first message, determining label information according to the transmission information of the initial message, adding the label information into the initial message, and determining that the initial message added with the label information is the first message.
Optionally, the processor is specifically configured to: determining the label information of the first message under the condition that the type of the first message is a message of a transport layer protocol, deleting the label information in the first message, and generating a target message; and/or determining the first message as a target message under the condition that the type of the first message is a message of a data link layer protocol.
Optionally, the processor is further configured to: receiving debugging parameters input by a user; the debugging parameters are used for indicating to capture messages received and transmitted by the MAC layer. And capturing the first message and the target message based on the debugging parameters. Determining a difference between the first message and the target message.
In a third aspect, a network device is provided, where the structure of the network device includes a processor, and the processor is configured to execute program instructions to cause the network device to perform the method of the first aspect.
In a fourth aspect, a computer-readable storage medium is provided, having computer program code stored therein, which, when run on a network device, causes the network device to perform the method of the first aspect described above.
In a fifth aspect, there is provided a computer program product having stored thereon the above computer software instructions, which, when run on a network device, cause the network device to execute a program of the method of the first aspect as described above.
The message processing method, the device, the equipment and the storage medium provided by the application can accurately identify whether the message required to be uploaded by the user is a data link layer protocol message or a network layer standard transport layer protocol message in a link rule matching mode. Therefore, the problem that the existing integrated equipment can not identify whether the received message is the message of a transmission layer protocol or the message of a data link layer protocol is solved. Therefore, the accurate shunting processing of the message under the corresponding type can be realized through the type of the message.
Drawings
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a schematic structural diagram of a communication system to which a message processing method according to an embodiment of the present application is applied;
fig. 2 is a schematic hardware structure diagram of a network device according to an embodiment of the present disclosure;
fig. 3 is a schematic hardware structure diagram of an electronic device according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a network architecture according to an embodiment of the present application;
fig. 5 is a schematic flowchart of a message receiving process according to an embodiment of the present application;
fig. 6 is a schematic flowchart of a message processing method according to an embodiment of the present application;
fig. 7 is a schematic flowchart of initialization of a network card driver according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a linked list rule configuration driver framework according to an embodiment of the present application;
fig. 9 is a second schematic flowchart of a message processing method according to an embodiment of the present application;
fig. 10 is a schematic diagram of a message structure according to an embodiment of the present application;
fig. 11 is a schematic diagram of another message structure provided in the embodiment of the present application;
fig. 12 is a schematic structural diagram of a message processing apparatus according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a computer program product of a resource allocation method according to an embodiment of the present application.
Detailed Description
A message processing method, a message processing apparatus, and a storage medium according to embodiments of the present application are described in detail below with reference to the accompanying drawings.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone.
The terms "first" and "second" and the like in the description and drawings of the present application are used for distinguishing different objects or for distinguishing different processes for the same object, and are not used for describing a specific order of the objects.
Furthermore, the terms "including" and "having," and any variations thereof, as referred to in the description of the present application, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or modules is not limited to the listed steps or modules but may alternatively include other steps or modules not listed or inherent to such process, method, article, or apparatus.
It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to mean serving as examples, illustrations or descriptions. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
In the description of the present application, the meaning of "a plurality" means two or more unless otherwise specified.
It can be understood that, in practical applications of the message processing method provided in the embodiment of the present application, the step sequence of the specific method may be adjusted, and the embodiment of the present application does not limit this.
Before explaining the embodiments of the present application in detail, some terms related to the embodiments of the present application will be explained.
1. Network card driver
The network card driver is the matched software for enabling the network card to work normally. The network card is used as a hardware device to carry a network card drive. Without the network card drive, the network card cannot be used normally.
2. Switching chip driver
The switch chip driver runs a driver program on the switch chip and is used for finishing data receiving and transmitting of the data link layer. Is a software module for connecting a processor and a switch chip.
3. MAC layer
The MAC layer is located in a data link layer in an Open System Interconnection (OSI) reference model, and the data link layer is divided into an upper layer LLC (logical link control) and a lower layer MAC (medium access control), and the MAC is mainly responsible for controlling and connecting a physical medium of the physical layer.
4. Messages of data link layer protocol
The messages of the data link layer protocol are protocol messages running on the switch equipment, and the protocol messages are mainly generated by taking the data link layer protocol as a standard. And hence also referred to as a layer two protocol message. The adopted protocols comprise common LLDP protocol, LACP protocol and the like.
5. Character device driver
The character device driver is one of the driver types of the linux operating system. The method has a fixed framework form, abstracts specific device operations into a file set, provides a complete operation set of file handles for a user, and can shield hardware interaction.
In order to reduce the number of devices, the data switching function of the switch device may be integrated with the function of the terminal device in one device. However, the integrated device cannot identify whether the received message is a message of a transport layer protocol or a data link layer protocol, which results in that the message cannot be accurately transmitted.
In view of this, an embodiment of the present application provides a message processing method to solve the problems in the prior art. First, a system architecture applied to a message processing method provided by the embodiment of the present disclosure is introduced.
Fig. 1 is a schematic diagram of a communication system architecture applied to the technical solution provided in the embodiment of the present application. The system can comprise: communication device 01 and network device 02.
The communication device 01 and the network device 02 may be terminal devices, computers or servers; the terminal device may be a device having a transceiving function. The terminal equipment may be referred to by different names, such as User Equipment (UE), access equipment, terminal unit, terminal station, mobile station, remote terminal, mobile equipment, wireless communication equipment, terminal agent, or terminal device. The terminal equipment can be deployed on land, including indoors or outdoors, handheld or vehicle-mounted; can also be deployed on the water surface (such as a ship and the like); and may also be deployed in the air (e.g., airplanes, balloons, satellites, etc.). The terminal device comprises a handheld device, a vehicle-mounted device, a wearable device or a computing device with communication function. For example, the terminal device may be a mobile phone (mobile phone), a tablet computer, or a computer with a transceiving function. The terminal device may also be a Virtual Reality (VR) device, an Augmented Reality (AR) device, a terminal of an industrial control terminal, a terminal in unmanned, a terminal in telemedicine, a terminal in a smart grid, a terminal in a smart city (smart city), a terminal in a smart home (smart home), etc. In this embodiment, the apparatus for implementing the function of the communication device 01 may be a communication device, and the apparatus for implementing the function of the network device 02 may be a network device, or may be an apparatus, such as a network card or a chip system, capable of supporting the communication device 01 or the network device 02 to implement the corresponding function of the communication device 01 or the network device 02. In the present application, a chip system may be composed of a chip, and may also include a chip and other discrete devices. The network card may be a network transmission device, such as a network adapter, on an electronic device, such as a terminal device, a server, or a computer, for performing data transmission with other devices.
In addition, the communication device 01 and the network device 02 in the embodiment of the present application may be a switch or a gateway device (e.g., an internet of things gateway device or a wireless gateway device, etc.) in practical applications.
In an implementation manner, an embodiment of the present application provides a schematic diagram of a hardware structure of a network device (taking the network card 02 shown in fig. 2 as an example). Wherein, network card 02 includes: processor cpu, mac controller and switch chip. The switch chip is responsible for receiving a message sent by the terminal device 01 through a physical port xn (n is greater than or equal to 2), and sending the message to the mac controller through a management port x 1; the mac controller is used for sending the received message to the processor; so that the processor can identify and process the message. Here, the management port x1 and the mac controller are connected by a link, and the message arrives at the mac controller according to the link connection. Note that the physical port xn belongs to an extended physical port of a switch (switch) chip. In addition, the sending process and the receiving process of the message are reverse, the sending processing process of the message is mainly packet of the message, the network card 02 passively receives the message transmitted by the protocol layer, so special processing is not needed, and the message can be directly sent to the corresponding terminal device through the physical port xn of the switch chip, which will not be described in detail in the technology.
Alternatively, the devices mentioned in the embodiments of the present application, such as the communication device 01 and the network device 02, may be implemented by the electronic device shown in fig. 3.
The electronic device comprises a processor 31, a communication bus 34 and at least one transceiver (which is only exemplary in fig. 3 to include transceiver 33).
Processor 31 may include one or more processing units, such as: the processor 31 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a Video Processing Unit (VPU) controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The controller can be a neural center and a command center of the communication device. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 31 for storing instructions and data. In some embodiments, the memory in the processor 31 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 31. If the processor 31 needs to use the instruction or data again, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 31 and thus increases the efficiency of the system.
In some embodiments, the processor 31 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, a Serial Peripheral Interface (SPI) interface, and/or the like.
The communication bus 34 may include a path that carries information between the aforementioned components.
The transceiver 33 may be any device, such as a transceiver, for communicating with other devices or communication networks, such as an ethernet, a Radio Access Network (RAN), a Wireless Local Area Network (WLAN), etc.
Optionally, the communication device may also include a memory 32.
The memory 32 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disk storage, optical disk storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory may be self-contained and coupled to the processor via a communication bus 34. The memory may also be integral to the processor.
The memory 32 is used for storing computer-executable instructions for executing the scheme of the application, and is controlled by the processor 31 to execute. The processor 31 is configured to execute the computer-executable instructions stored in the memory 32, so as to implement the message processing method provided in the following embodiments of the present application.
Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application program codes, which are not specifically limited in the embodiments of the present application.
In particular implementations, processor 31 may include one or more CPUs such as CPU0 and CPU1 in fig. 3, for example, as one embodiment.
In particular implementations, the communication device may include multiple processors, such as processor 31 and processor 35 in fig. 3, as one embodiment. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
The technical solution provided by the embodiments of the present application is specifically described below with reference to the drawings of the specification, in which a network card is taken as an example of a network device, and the network card is taken as an execution subject.
Referring to fig. 4, an embodiment of the present application provides a network architecture diagram, which includes a data link layer to which the embodiment of the present application is applied. The system also comprises a physical layer, a network layer, a transmission layer, a session layer, a presentation layer and an application layer. Of course, fig. 4 shows only a seven-layer network architecture diagram. Other network architectures may include only a physical layer, a data link layer, a network layer, a transport layer, and an application layer. Therefore, the embodiments of the present application do not limit the network architecture involved.
The technical principle of the embodiment of the application is as follows: when the network card driver receives the message from the communication equipment, the communication equipment can remind the network card driver to receive the message by triggering the hard interrupt of the network card, and after the network card driver detects that the hard interrupt of the network card is triggered, corresponding interrupt response is executed. In the embodiment of the application, a hook function is added in a program driven by a network card. When the network card driver detects that the hard interrupt of the network card is triggered, the hook function is immediately scheduled and executed after the message from the communication equipment is received, and the network card driver analyzes and shunts the type of the message based on the linked list rule by calling the hook function. If the message is a message of a transport layer protocol, the network card driver pushes the message to a protocol stack to complete the processing of a subsequent network layer; if the message is the message of the data link layer protocol, the network card driver pushes the message to the protocol stack to be directly transmitted to the user layer. Therefore, the embodiment of the application can realize message identification and distribution at a data link layer through the hook function.
In addition, the method provided by the embodiment of the application also provides a message debugging and printing principle. In fact, in the process of message processing according to the technical principle, the network card driver captures messages before hook function call and after shunt processing according to the indication corresponding to the debugging parameters determined in advance, so that the two messages are compared, and debugging and application of the product are facilitated.
For example, referring to fig. 5, in combination with the above principle, an embodiment of the present application provides a message receiving processing flow. The message receiving processing is mainly at the mac layer and the protocol stack layer. The receiving and processing of the message in the mac layer comprises the following steps: when the terminal equipment needs the network card to receive the message, the hardware of the network card is triggered to interrupt to inform the network card to receive the message. Then, the network card driver receives the message in response to the hard interrupt of the network card, and calls a hook function to perform type identification on the message (here, the purpose of identifying the message type is to perform shunting processing on the message based on the type of the message). At this time, messages before hook function call and after shunt processing can be captured according to the debugging parameters. And then, reporting the shunted message to a kernel protocol stack (namely a protocol stack) of a protocol stack layer for corresponding processing. And finally, informing the user layer of receiving the message. It should be noted that fig. 5 only briefly summarizes the content of the message receiving process, and the above description is taken as the standard.
Referring to fig. 6, the message processing method provided in the embodiment of the present application is applied to the network device 02 shown in fig. 1, and the method of the embodiment of the present application is described in detail below with a network card as an exemplary execution subject instead of a network device. The method specifically comprises the following steps.
S11, the network card acquires the first message.
Wherein the first message is obtained based on an initial message from the communication device.
Optionally, before the network card acquires the message, the network card driver needs to be initialized in the network platform of the operating system. Referring to fig. 7, a device registration of the network platform of the network card is performed first. And then, performing drive registration of the network platform. And then, initializing a rule chain table head driven by the network card and configuring a label function. And after the configuration is completed, the network card driver is initialized. Specifically, the rule chain table header initialization is to add a single chain table management function in the network card drive, and is used for taking over the chain table rule configured by the user layer, the chain table rule mainly performs rule matching processing on the message of the data link layer, the processing user layer calls another drive interface to issue the chain table rule of the message expected to be received by the user to the network card drive, and the chain table rule comprises the corresponding relation between the characteristic information and the type of the message; the characteristic information comprises at least one of a source address for representing the message, a target address of the message and a network type; such as mac address, IP address, or protocol. The network card driver compares the field information contained in the linked list rule with the field information in the currently received message, and if the field information in the currently received message contains the field information contained in the linked list rule, the matching is successful; otherwise, the matching fails. And secondly, the label function configuration driven by the network card is used for realizing the addition of label information in the message by the network card. The specific content of the label information can refer to various types of switches of the current mainstream manufacturers, is not limited to a specific switch, and is configured by referring to a data manual. The label information is added in the message by a switch chip in the network card. It should be noted that fig. 7 only briefly summarizes the initialization processing flow of the network card driver, and the details are based on the above description.
Optionally, the acquiring, by the network card, the first message specifically includes: the network card receives an initial message from the communication equipment; and determining whether the initial message contains label information.
And if the initial message is contained and the label information is accurate, determining that the initial message is the first message.
And/or if the first message contains the new label information and the label information is wrong, determining the new label information according to the transmission information of the initial message, updating the label information in the initial message by using the new label information, and determining the updated initial message as the first message. Wherein the transmission information includes new tag information.
And/or if the first message does not contain the first message, determining label information according to the transmission information of the initial message, adding the label information into the initial message, and determining that the initial message added with the label information is the first message.
Actually, the first packet obtaining method includes the following two ways:
the first mode is as follows: the communication equipment adds the label information in the process of generating the initial message. Therefore, when the network card receives the initial message, whether the label information in the initial message is accurate or not is determined firstly, namely, whether the content of the label information is consistent with the transmission information of the initial message or not is determined; for example, by comparing whether the port number in the tag information is consistent with the port number in the initial message transmission. If the initial message is accurate, the initial message is the first message; if not, determining a new label information according to at least the port of the communication equipment for transmitting the initial message and the network (i.e. transmission information) to which the port belongs, and updating the label information in the initial message by using the new label information. And determining the updated initial message as the first message. It should be noted that the above is not limited to determining whether the tag information in the initial message is accurate by comparing whether the port number in the tag information is consistent with the port number in the initial message during transmission. For example, whether the label information in the initial message is accurate or not may be determined by comparing whether the network to which the port in the label information belongs is consistent with the network to which the port belongs during the initial message transmission. Therefore, the embodiment of the present application does not limit any way of determining whether the tag information in the initial message is accurate or not.
The second mode is as follows: the communication equipment does not add label information in the process of generating the first message. The network card determines label information at least according to the port of the communication equipment for transmitting the first message and the network to which the port belongs, adds the label information into the initial message, and determines the added initial message as the first message.
It should be noted that, with reference to fig. 2, for the above two ways, the process of acquiring the first message in the network card includes: the Switch chip receives an initial message sent by the communication equipment through the physical port Xn, and the Switch chip determines a first message according to the initial message and the two modes.
S12, the network card determines the type of the first message based on the linked list rule.
Wherein, the type comprises a message of a transmission layer protocol or a message of a data link layer protocol; the linked list rule comprises the corresponding relation between the characteristic information and the type of the message; the characteristic information comprises at least one of a source address for characterizing the message, a destination address for the message, and a network type.
Optionally, determining the type of the first packet based on the linked list rule specifically includes: matching the linked list rule with the first message, wherein the matching result comprises the following steps: if the matching is successful, determining the type of the first message as a message of a data link layer protocol; and if the matching fails, determining that the type of the first message is a message of a transport layer protocol. It should be noted that the linked list rule in the embodiment of the present application is configured for a packet of a data link layer protocol.
Specifically, the network card determines the type of the first message based on the linked list rule, and mainly performs query and matching on a user layer issued linked list rule (i.e. an attribute field of a message which the user expects to receive), and if the configured linked list rule is queried, the matching is successful. For example, if the linked list rule issued by the dest _ mac user is the same as the dest _ mac address field extracted from the received message, the matching is successful. And packaging the successfully matched messages according to the message packet of the data link layer protocol, and adding configuration information based on the mac layer. Otherwise, directly reporting the mac layer message in TCP/IP format to the kernel protocol stack, namely the mac layer packet format of standard TCP/IP,
further, the linked list rule is generated by another driver, such as the linked list rule configuration driver framework shown in fig. 8, which is a character device driver independent of the physical layer, from top to bottom, including a user layer and a driver layer. The user layer is used for providing an interface for adding and deleting the linked list rules for the user, and the drive layer provides and processes the added linked list rules and the deleted linked list rules and the like for the user layer through registering character equipment and packaging an operation set. The linked list rules include, but are not limited to, one or more of the following table 1.
TABLE 1
Source code address 6 bytes
Source code address mask length
6 bytes of the target code address
Destination address mask length
Network type
Network type mask length
Source IP address
Source IP address mask length
Destination IP address
Destination IP address mask length
Custom tag type
S13, the network card determines a target message according to the type of the first message and transmits the target message.
Specifically, when the type of the first packet is a packet of a transport layer protocol, the tag information of the first packet is determined, and the tag information is deleted from the first packet, so as to generate a target packet. And/or determining the first message as a target message under the condition that the type of the first message is a message of a data link layer protocol.
In application, when the target message is a message of a data link layer protocol, the target message is transmitted and received at the data link layer, and the generated target message is transmitted to a user layer through a protocol stack without being processed again. For the case that the target message is a message of a transport layer protocol, the target message needs to be transmitted to a network layer through a data link layer for processing.
It should be noted that the format of the first packet referred to in the embodiment of the present application is the same as the format of the packet of the data link layer protocol. The format of the second message is the same as that of the message of the transmission layer protocol; however, after the second packet is matched based on the linked list rule, the type of the second packet may be a packet of a data link layer protocol or a packet of a transport layer protocol. When the type of the second message is a message of a data link layer protocol, the label information deleted in the first message is required to be added into the second message again to generate a target message, and the format of the target message is the message format of the data link layer protocol; and when the type of the second message is the message of the transmission layer protocol, the second message is the target message, and the format of the target message is the message format of the transmission layer protocol.
In the method, the message which is required to be uploaded by the user can be accurately identified to be the message of a data link layer protocol or the message of a network layer standard transmission layer protocol in a link rule matching mode. Therefore, the problem that the existing integrated equipment can not identify whether the received message is the message of a transmission layer protocol or the message of a data link layer protocol is solved. Therefore, the accurate shunting processing of the message under the corresponding type can be realized through the type of the message.
In one implementation, referring to fig. 9 in combination with fig. 6, S12 specifically includes the following implementation manners:
s121, the network card determines the label information of the first message; the label information is at least used for identifying the port of the communication equipment for transmitting the initial message and the network to which the port belongs.
The network card determines the label information of the first message; the label information is at least used for identifying a port of the communication equipment for transmitting the first message and a network to which the port belongs.
Optionally, the network card calls a hook function to analyze the first message, and determines the tag information.
Wherein the tag information includes: the number of the communication device, the port number of the communication device, the network to which the port of the communication device belongs, and the priority setting of the network.
Illustratively, the length of the tag information in the message is typically 6 bytes. Which may contain 2 bytes of tag _ id (e.g., 0x9126) and 4 bytes of tag data information. the tag data information includes a source device number of 1byte, a source device port number of 1byte, a priority of 1byte, and an upper 4-bit of a VLAN Identification (VID), and a lower 8-bit of the VID of 1 byte. Wherein the source device number indicates from which device the message was received; the port number of the source equipment indicates that the message is received from the fourth port of the equipment; the priority represents the priority setting of a Virtual Local Area Network (VLAN) of the port; the upper 4 and lower 8 bits of the VID indicate which VLAN the port receiving the packet belongs to.
And S122, deleting the label information by the network card to generate a second message.
Further, after the network card determines the tag information in the first message, the network card firstly performs storage management on the tag information, and then deletes the tag information in the first message.
Specifically, the network card deletes the tag information in the first message by calling the hook function, and generates a second message.
S123, the network card determines the type of the second message based on the linked list rule, and takes the type of the second message as the type of the first message.
Optionally, determining the type of the second packet based on the linked list rule specifically includes: and matching the linked list rule with the second message, wherein the matching result comprises the following steps: if the matching is successful, determining the type of the second message as a message of a data link layer protocol; and if the matching fails, determining that the type of the second message is the message of the transport layer protocol. It should be noted that the linked list rule in the embodiment of the present application is configured for a packet of a data link layer protocol.
Specifically, the network card determines the type of the second message based on the linked list rule, and mainly performs query and matching on the linked list rule (i.e. the attribute field of the message that the user expects to receive) issued by the user layer, and if the configured linked list rule is queried, the matching is successful. For example, if the address field included in the linked list rule issued by the dest _ mac user is the same as the dest _ mac address field extracted from the received message, the matching is successful. And packaging the successfully matched messages according to the message packet of the data link layer protocol, and adding configuration information based on the mac layer. Otherwise, directly reporting the mac layer message in TCP/IP format to the kernel protocol stack, namely the mac layer packet format of standard TCP/IP,
on the basis of S121-S123, determining a target message according to the type of the first message, including: and under the condition that the type of the first message is the message of the transport layer protocol, adding label information into the second message to generate a target message. And/or determining the second message as the target message under the condition that the type of the first message is the message of the data link layer protocol.
And further, calling a hook function to analyze the second message and determining the label information.
In the implementation mode, considering that the message types of the transport layer protocol occupy most, the first message deletes the label information, and then the link rule matching is performed, so that the message which needs to be uploaded by the user can be accurately identified to be the message of the data link layer protocol or the message of the transport layer protocol of the network layer standard. Therefore, the problem that the existing integrated equipment can not identify whether the received message is the message of a transmission layer protocol or the message of a data link layer protocol is solved. Therefore, the accurate shunting processing of the message under the corresponding type can be realized through the type of the message.
In one implementation, referring to fig. 9, if the type of the second packet is a packet of a data link layer protocol. The method specifically comprises the following steps:
s101, the network card transmits a target message to a user layer through a protocol stack; the target message is the first message.
Specifically, a required linked list rule is added through a user layer provided by a character device driver, and the character device driver transmits the linked list rule to a network card driver through a preset interface between the character device driver and the network card driver. And then, when the network card drive executes recv receiving message through the socket, acquiring the first message, determining and storing the label information of the first message. And then deleting the label information in the first message to generate a second message. And matching the linked list rule with the second message, and determining that the second message has data corresponding to the linked list elements in the linked list rule, wherein the matching is successful. At this time, the deleted tag information needs to be added again in the second message, so as to generate a target message of the message which needs to be transmitted and is of the type of the data link layer protocol. And then transmitting the target message to a user layer through a protocol stack.
Illustratively, the format of the first message including the tag information is as shown in fig. 10, where the first message includes a tag information having a length of 6 bytes, a preamble having a length of 7 bytes, a start delimiter having a length of 1byte, a source mac address having a length of 6 bytes, a destination mac address having a length of 6 bytes, a length/type having a length of 2 bytes, user data having a length, a PAD field PAD having a length of 4 bytes, and a frame check sequence FSC having a length of 4 bytes. It should be noted that the data specifically included in the 6-byte tag information may refer to the above description, and is not described herein again.
In the implementation mode, the label information is added in the second message to generate a target message which is the message type of the data link layer protocol, and the target message is directly transmitted to the user layer through the protocol stack. So as to realize accurate transmission of the target message.
In another implementation, referring to fig. 9, if the type of the first packet is a packet of a transport layer protocol; the method specifically comprises the following steps:
s102, the network card transmits the second message to a network layer; the second message is a target message.
For example, an Internet Control Message Protocol (ICMP) Internet link ping packet needs to be received. The communication device sends a request packet (i.e., a first packet) of an Internet Group Management Protocol (IGMP), and the request packet is received by the switch chip according to the hardware connection relationship shown in fig. 2 and forwarded to the network card. At this time, the hook function is called by the network card, stripping of the tag of the physical layer is executed (i.e., the tag information is deleted, and the tag information is different from each manufacturer and can be determined by respective data manuals, which are not described in detail), and the message is integrated into the second message in the standard network mac message format (i.e., the message format of the transport layer protocol) as shown in fig. 11. And then matching the linked list rule with the second message. And assuming that the matching fails, determining the type of the second message as a message of a transport layer protocol. And uploading the second message to a network layer of the protocol stack, receiving the second message by the network layer of the protocol stack, replying a response message, and realizing the link ping communication process.
Wherein, the matching failure condition may be that the user does not generate the linked list rule through the character device driver. It is also possible that a linked list rule is generated, but the data of the linked list rule and the data in the second message cannot correspond to each other. If the type of the filled message is not consistent with the actual type 0x0800 of the received message, reporting the protocol stack according to the standard format.
According to the implementation mode, the second message which fails to be matched is uploaded to the network layer without any processing, and accurate transmission of the target message is achieved.
In one implementation, before receiving the first message from the communication device, the method includes: receiving debugging parameters input by a user; the debugging parameters are used for indicating to capture the received and transmitted messages of the MAC layer; after receiving the first message from the communication device, the method includes: and capturing the first message and the target message based on the debugging parameters. Determining a difference between the first message and the target message.
It should be noted that, for the description of the present implementation, reference is made to the description corresponding to fig. 7, and details are not repeated here.
In the implementation mode, the messages received by the mac layer and the transmitted messages are captured through the preset adjustment parameters, so that the information change conditions of the front messages and the rear messages are determined through the comparison of the front messages and the rear messages.
In the embodiment of the present application, the resource configuration apparatus may be divided into the functional modules according to the method embodiment, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, in the embodiment of the present application, the division of the module is schematic, and is only one logic function division, and there may be another division manner in actual implementation.
As shown in fig. 12, which is a schematic structural diagram of a message processing apparatus 120 according to an embodiment of the present disclosure, the message processing apparatus 120 specifically includes a switch chip 121 and a processor 122.
The switch chip 121 is configured to obtain a first message; the first message is derived based on an initial message from the communication device. For example, the switch chip 121 may be used to implement S11 shown in fig. 6.
The processor 122 is configured to determine, based on a linked list rule, a type of the first packet acquired by the switch chip 121; the type comprises a message of a transmission layer protocol or a message of a data link layer protocol; the linked list rule comprises the corresponding relation between the characteristic information and the type of the message; the characteristic information comprises at least one of a source address for characterizing the message, a destination address for the message, and a network type. For example, the processor 122 may be configured to implement S12 as shown in fig. 6.
The processor 122 is further configured to determine a target packet according to the type of the first packet, and transmit the target packet. For example, the processor 122 may be configured to implement S13 as shown in fig. 6.
Optionally, the processor 122 is specifically configured to: determining label information of the first message; the label information is at least used for identifying a port of the communication equipment for transmitting the initial message and a network to which the port belongs; deleting the label information to generate a second message; and determining the type of the second message based on the linked list rule, and taking the type of the second message as the type of the first message.
Optionally, the processor 122 is specifically configured to: under the condition that the type of the first message is a message of a transport layer protocol, adding tagging information into the second message to generate a target message; and/or determining the second message as the target message under the condition that the type of the first message is the message of the data link layer protocol.
Optionally, the processor 122 is specifically configured to invoke a hook function to analyze the second message and determine the tag information.
Optionally, the processor 122 is specifically configured to: matching the linked list rule with the second message; if the matching is successful, determining the type of the second message as a message of a data link layer protocol; and/or if the matching fails, determining that the type of the second message is a message of a transport layer protocol.
Optionally, the tag information includes: the number of the communication device, the port number of the communication device, the network to which the port of the communication device belongs, and the priority setting of the network.
Optionally, the switch chip 121 is specifically configured to: receiving an initial message from a communication device; determining whether the initial message contains label information; if the first message is contained and the label information is accurate, determining that the initial message is a first message; and/or if the first message contains the new label information and the label information is wrong, determining the new label information according to the transmission information of the initial message, updating the label information in the initial message by using the new label information, and determining the updated initial message as the first message; and/or if the first message does not contain the first message, determining label information according to the transmission information of the initial message, adding the label information into the initial message, and determining that the initial message added with the label information is the first message.
Optionally, the processor 122 is specifically configured to: determining the label information of the first message under the condition that the type of the first message is a message of a transport layer protocol, deleting the label information in the first message, and generating a target message; and/or determining the first message as a target message under the condition that the type of the first message is a message of a data link layer protocol.
Optionally, the processor 122 is further configured to: receiving debugging parameters input by a user; the debugging parameters are used for indicating to capture messages received and transmitted by the MAC layer.
And capturing the first message and the target message based on the debugging parameters. Determining a difference between the first message and the target message.
Here, the system architecture and the service scenario described in the embodiment of the present invention are for more clearly illustrating the technical solution of the embodiment of the present application, and do not constitute a limitation to the technical solution provided in the embodiment of the present application, and it can be known by a person skilled in the art that the technical solution provided in the embodiment of the present application is also applicable to similar technical problems along with the evolution of the network architecture and the appearance of a new service scenario.
Another embodiment of the present invention further provides a computer-readable storage medium, which stores instructions that, when executed on a computer, cause the computer to perform the method shown in the above method embodiment.
In some embodiments, the disclosed methods may be implemented as computer program instructions encoded on a computer-readable storage medium in a machine-readable format or encoded on other non-transitory media or articles of manufacture.
Fig. 13 schematically illustrates a conceptual partial view of a computer program product comprising a computer program for executing a computer process on a computing device provided by an embodiment of the invention.
In one embodiment, the computer program product is provided using a signal bearing medium 410. The signal bearing medium 410 may include one or more program instructions that, when executed by one or more processors, may provide the functions or portions of the functions described above with respect to fig. 6. Thus, for example, referring to the embodiment shown in FIG. 6, one or more features of S11-S13 may be undertaken by one or more instructions associated with the signal bearing medium 410. Further, the program instructions in FIG. 13 also describe example instructions.
In some examples, signal bearing medium 410 may include a computer readable medium 411, such as, but not limited to, a hard disk drive, a Compact Disc (CD), a Digital Video Disc (DVD), a digital tape, a memory, a read-only memory (ROM), a Random Access Memory (RAM), or the like.
In some implementations, the signal bearing medium 410 may comprise a computer recordable medium 412 such as, but not limited to, a memory, a read/write (R/W) CD, a R/W DVD, and the like.
In some implementations, the signal bearing medium 410 may include a communication medium 413, such as, but not limited to, a digital and/or analog communication medium (e.g., a fiber optic cable, a waveguide, a wired communications link, a wireless communication link, etc.).
The signal bearing medium 410 may be conveyed by a wireless form of communication medium 413, such as a wireless communication medium compliant with the IEEE802.41 standard or other transport protocol. The one or more program instructions may be, for example, computer-executable instructions or logic-implementing instructions.
In some examples, a processor such as described with respect to fig. 12 may be configured to provide various operations, functions, or actions in response to one or more program instructions through computer-readable medium 411, computer-recordable medium 412, and/or communication medium 413.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical functional division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another device, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, that is, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present invention may be essentially or partially contributed to by the prior art, or all or part of the technical solution may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only an embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions within the technical scope of the present invention are intended to be covered by the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (20)

1. A message processing method is characterized in that the method is applied to network equipment; the method comprises the following steps:
acquiring a first message; the first message is obtained based on an initial message from the communication equipment;
determining the type of the first message based on a linked list rule; the type comprises a message of a transmission layer protocol or a message of a data link layer protocol; the linked list rule comprises the corresponding relation between the characteristic information and the type of the message; the characteristic information comprises at least one of a source address for representing the message, a target address of the message and a network type;
and determining a target message according to the type of the first message, and transmitting the target message.
2. The message processing method of claim 1, wherein determining the type of the first message based on a linked list rule comprises:
determining label information of the first message; the label information is at least used for identifying a port of the communication equipment for transmitting the initial message and a network to which the port belongs;
deleting the label information to generate a second message;
and determining the type of the second message based on a linked list rule, and taking the type of the second message as the type of the first message.
3. The message processing method according to claim 2, wherein the determining a target message according to the type of the first message comprises:
adding the label information to the second message to generate the target message under the condition that the type of the first message is a message of a transport layer protocol;
and/or the presence of a gas in the gas,
and determining the second message as the target message under the condition that the type of the first message is the message of the data link layer protocol.
4. The message processing method according to claim 2 or 3, wherein the determining the label information of the first message includes:
and calling a hook function to analyze the second message and determine the label information.
5. The message processing method according to claim 2 or 3, wherein the determining the type of the second message based on a linked list rule comprises:
matching the linked list rule with the second message;
if the matching is successful, determining the type of the second message as the message of the data link layer protocol;
and/or the presence of a gas in the gas,
and if the matching fails, determining that the type of the second message is the message of the transport layer protocol.
6. The message processing method according to claim 2 or 3, wherein the label information includes: the number of the communication device, the port number of the communication device, the network to which the port of the communication device belongs, and the priority setting of the network.
7. The message processing method according to claim 1, wherein the obtaining the first message comprises:
receiving the initial message from the communication equipment;
determining whether the initial message contains the tag information;
if the first message is contained and the label information is accurate, determining that the initial message is the first message;
and/or the presence of a gas in the gas,
if the first message contains the label information, determining new label information according to the transmission information of the initial message, updating the label information in the initial message by using the new label information, and determining the updated initial message as the first message;
and/or the presence of a gas in the gas,
if not, determining the label information according to the transmission information of the initial message, adding the label information into the initial message, and determining that the initial message added with the label information is the first message.
8. The message processing method according to claim 1, wherein the determining a target message according to the type of the first message comprises:
determining label information of the first message under the condition that the type of the first message is a message of a transport layer protocol, deleting the label information in the first message, and generating the target message;
and/or the presence of a gas in the gas,
and determining the first message as the target message under the condition that the type of the first message is the message of the data link layer protocol.
9. The message processing method according to claim 1, wherein before receiving the first message from the communication device, comprising:
receiving debugging parameters input by a user; the debugging parameter is used for indicating to capture messages received and transmitted by the MAC layer;
after receiving the first message from the communication device, the method includes:
capturing the first message and the target message based on the debugging parameters;
and determining the difference between the first message and the target message.
10. A message processing apparatus, comprising: a switching chip and a processor;
the switching chip is used for acquiring a first message; the first message is obtained based on an initial message from the communication equipment;
the processor is configured to determine a type of the first packet acquired by the switch chip based on a linked list rule; the type comprises a message of a transmission layer protocol or a message of a data link layer protocol; the linked list rule comprises the corresponding relation between the characteristic information and the type of the message; the characteristic information comprises at least one of a source address for representing the message, a target address of the message and a network type;
the processor is further configured to determine a target packet according to the type of the first packet, and transmit the target packet.
11. The message processing device according to claim 10, wherein the processor is specifically configured to:
determining label information of the first message; the label information is at least used for identifying a port of the communication equipment for transmitting the initial message and a network to which the port belongs;
deleting the label information to generate a second message;
and determining the type of the second message based on a linked list rule, and taking the type of the second message as the type of the first message.
12. The message processing apparatus according to claim 11, wherein the processor is specifically configured to:
adding the label information to the second message to generate the target message under the condition that the type of the first message is a message of a transport layer protocol;
and/or the presence of a gas in the gas,
and determining the second message as the target message under the condition that the type of the first message is the message of the data link layer protocol.
13. The message processing apparatus according to claim 11 or 12,
the processor is specifically configured to invoke a hook function to analyze the second packet, and determine the tag information.
14. The message processing apparatus according to claim 11 or 12, wherein the processor is specifically configured to:
matching the linked list rule with the second message;
if the matching is successful, determining the type of the second message as the message of the data link layer protocol;
and/or the presence of a gas in the gas,
and if the matching fails, determining that the type of the second message is the message of the transport layer protocol.
15. The message processing apparatus according to claim 11 or 12, wherein the label information includes: the number of the communication device, the port number of the communication device, the network to which the port of the communication device belongs, and the priority setting of the network.
16. The message processing apparatus according to claim 10, wherein the switch chip is specifically configured to:
receiving the initial message from the communication equipment;
determining whether the initial message contains the tag information;
if the first message is contained and the label information is accurate, determining that the initial message is the first message;
and/or the presence of a gas in the gas,
if the first message contains the label information, determining new label information according to the transmission information of the initial message, updating the label information in the initial message by using the new label information, and determining the updated initial message as the first message;
and/or the presence of a gas in the gas,
if not, determining the label information according to the transmission information of the initial message, adding the label information into the initial message, and determining that the initial message added with the label information is the first message.
17. The message processing device according to claim 10, wherein the processor is specifically configured to:
determining label information of the first message under the condition that the type of the first message is a message of a transport layer protocol, deleting the label information in the first message, and generating the target message;
and/or the presence of a gas in the gas,
and determining the first message as the target message under the condition that the type of the first message is the message of the data link layer protocol.
18. The message processing device of claim 10, wherein the processor is further configured to:
receiving debugging parameters input by a user; the debugging parameter is used for indicating to capture messages received and transmitted by the MAC layer;
capturing the first message and the target message based on the debugging parameters;
and determining the difference between the first message and the target message.
19. A network device, comprising: a memory for storing a computer program and a processor for executing the computer program to perform the message processing method of any of claims 1-9.
20. A computer-readable storage medium, having stored thereon a computer program which, when run on a network device, causes the network device to execute the message processing method of any of claims 1-9.
CN202110772783.5A 2021-07-08 2021-07-08 Message processing method, device, equipment and storage medium Active CN113595931B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110772783.5A CN113595931B (en) 2021-07-08 2021-07-08 Message processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110772783.5A CN113595931B (en) 2021-07-08 2021-07-08 Message processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113595931A true CN113595931A (en) 2021-11-02
CN113595931B CN113595931B (en) 2024-01-16

Family

ID=78246458

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110772783.5A Active CN113595931B (en) 2021-07-08 2021-07-08 Message processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113595931B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113810428A (en) * 2021-09-30 2021-12-17 深圳市九洲电器有限公司 Safety control system and safety control method of edge computing equipment
CN114244916A (en) * 2021-11-19 2022-03-25 国网经济技术研究院有限公司 Port identification method of intelligent electronic equipment, electronic equipment and storage medium
CN115052054A (en) * 2022-08-15 2022-09-13 江西联创精密机电有限公司 Communication message configuration method, device, readable storage medium and equipment
CN115550250A (en) * 2022-11-17 2022-12-30 鹏城实验室 Small flow message retransmission method, system, electronic equipment and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1816008A (en) * 2005-02-04 2006-08-09 华为技术有限公司 Route, signal and control protocol message transmission method in network transmission
US20080013532A1 (en) * 2006-07-11 2008-01-17 Cisco Technology, Inc. Apparatus for hardware-software classification of data packet flows
WO2013059991A1 (en) * 2011-10-25 2013-05-02 华为技术有限公司 Data message processing method and system, message forwarding device
US20140376405A1 (en) * 2013-06-25 2014-12-25 Nest Labs, Inc. Efficient Communication for Devices of a Home Network
WO2015096409A1 (en) * 2013-12-24 2015-07-02 中兴通讯股份有限公司 Method, device and system for discovering link in software-defined network
CN106533890A (en) * 2016-12-30 2017-03-22 华为技术有限公司 Message processing method, device and system
US20190190811A1 (en) * 2017-12-14 2019-06-20 Lenovo Enterprise Solutions (Singapore) Pte. Ltd. Automatic sharing of routing information between neighboring routers using a link-local address
WO2020093737A1 (en) * 2018-11-09 2020-05-14 深圳市中兴微电子技术有限公司 Message processing method and device, storage medium and optical network terminal
CN111818041A (en) * 2020-07-06 2020-10-23 桦蓥(上海)信息科技有限责任公司 Real-time message processing system and method based on network layer message analysis
CN112152927A (en) * 2019-06-26 2020-12-29 杭州海康威视数字技术股份有限公司 Message forwarding method, system, network card and storage medium
CN112235266A (en) * 2020-09-29 2021-01-15 腾讯科技(深圳)有限公司 Data processing method, device, equipment and storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1816008A (en) * 2005-02-04 2006-08-09 华为技术有限公司 Route, signal and control protocol message transmission method in network transmission
US20080013532A1 (en) * 2006-07-11 2008-01-17 Cisco Technology, Inc. Apparatus for hardware-software classification of data packet flows
WO2013059991A1 (en) * 2011-10-25 2013-05-02 华为技术有限公司 Data message processing method and system, message forwarding device
CN103181129A (en) * 2011-10-25 2013-06-26 华为技术有限公司 Data message processing method and system, message forwarding device
US20140376405A1 (en) * 2013-06-25 2014-12-25 Nest Labs, Inc. Efficient Communication for Devices of a Home Network
WO2015096409A1 (en) * 2013-12-24 2015-07-02 中兴通讯股份有限公司 Method, device and system for discovering link in software-defined network
CN106533890A (en) * 2016-12-30 2017-03-22 华为技术有限公司 Message processing method, device and system
US20190190811A1 (en) * 2017-12-14 2019-06-20 Lenovo Enterprise Solutions (Singapore) Pte. Ltd. Automatic sharing of routing information between neighboring routers using a link-local address
WO2020093737A1 (en) * 2018-11-09 2020-05-14 深圳市中兴微电子技术有限公司 Message processing method and device, storage medium and optical network terminal
CN112152927A (en) * 2019-06-26 2020-12-29 杭州海康威视数字技术股份有限公司 Message forwarding method, system, network card and storage medium
CN111818041A (en) * 2020-07-06 2020-10-23 桦蓥(上海)信息科技有限责任公司 Real-time message processing system and method based on network layer message analysis
CN112235266A (en) * 2020-09-29 2021-01-15 腾讯科技(深圳)有限公司 Data processing method, device, equipment and storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113810428A (en) * 2021-09-30 2021-12-17 深圳市九洲电器有限公司 Safety control system and safety control method of edge computing equipment
CN114244916A (en) * 2021-11-19 2022-03-25 国网经济技术研究院有限公司 Port identification method of intelligent electronic equipment, electronic equipment and storage medium
CN114244916B (en) * 2021-11-19 2022-11-18 国网经济技术研究院有限公司 Port identification method of intelligent electronic equipment, electronic equipment and storage medium
CN115052054A (en) * 2022-08-15 2022-09-13 江西联创精密机电有限公司 Communication message configuration method, device, readable storage medium and equipment
CN115052054B (en) * 2022-08-15 2022-10-25 江西联创精密机电有限公司 Communication message configuration method, device, readable storage medium and equipment
CN115550250A (en) * 2022-11-17 2022-12-30 鹏城实验室 Small flow message retransmission method, system, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113595931B (en) 2024-01-16

Similar Documents

Publication Publication Date Title
CN113595931B (en) Message processing method, device, equipment and storage medium
WO2017067391A1 (en) Data sharing method and device for virtual machines
WO2020143680A1 (en) Data transmission method and related apparatus
CN106034084B (en) Data transmission method and device
US11431624B2 (en) Communication method and network interface card
US10609633B2 (en) Method for triggering registrar protocol interaction, access point, and station
US11563832B2 (en) Data sending method and device, data receiving method and device, and system
EP2339792A1 (en) Method for accessing USB device attached to home gateway, home gateway and terminal
CN104937896A (en) Method for processing address resolution protocol message, forwarder and controller
KR102217114B1 (en) Method for controlling of accelerating edge platform network and electronic device using the same
CN108347392B (en) Cross-board processing method, device and system for service message
CN108471390B (en) Cross-board processing system for service message and redirection method for service message
CN114745255B (en) Hardware chip, DPU, server, communication method and related device
CN110167197B (en) GTP downlink data transmission optimization method and device
US20180234535A1 (en) Method and apparatus for communication
US20230370899A1 (en) Packet forwarding method, packet processing method, and device
US20120102149A1 (en) Inter-Board Communication Apparatus, Method for Transmitting and Receiving Message of Inter-Board Communication
EP4145729A1 (en) Port state configuration method, apparatus, system, and storage medium
CN109379269A (en) Virtual swap device data forwarding method, device and computer equipment
CN114697387A (en) Data packet transmission method, device and storage medium
CN115190087B (en) Data transmission method, device, equipment and medium based on two-layer intermediate equipment
WO2020048355A1 (en) User interface (ui) display control method and apparatus
CN110753135A (en) IP address configuration method, configuration equipment and storage medium
CN115550104A (en) AXI bus expansion method, device, electronic equipment and storage medium
CN115022424A (en) Virtual control method, system, equipment and medium for network card of hydroelectric LCU controller

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