CN113518082B - Message processing method, electronic equipment and storage medium - Google Patents

Message processing method, electronic equipment and storage medium Download PDF

Info

Publication number
CN113518082B
CN113518082B CN202110701017.XA CN202110701017A CN113518082B CN 113518082 B CN113518082 B CN 113518082B CN 202110701017 A CN202110701017 A CN 202110701017A CN 113518082 B CN113518082 B CN 113518082B
Authority
CN
China
Prior art keywords
message
node
nodes
processor
type
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
CN202110701017.XA
Other languages
Chinese (zh)
Other versions
CN113518082A (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.)
Shenzhilan Tianjin Underwater Intelligent Technology Co ltd
Original Assignee
Shenzhilan Tianjin Underwater Intelligent 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 Shenzhilan Tianjin Underwater Intelligent Technology Co ltd filed Critical Shenzhilan Tianjin Underwater Intelligent Technology Co ltd
Priority to CN202110701017.XA priority Critical patent/CN113518082B/en
Publication of CN113518082A publication Critical patent/CN113518082A/en
Application granted granted Critical
Publication of CN113518082B publication Critical patent/CN113518082B/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
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Abstract

The invention relates to a message processing method, electronic equipment and a storage medium, wherein the method comprises the following steps: the message processor determines the message type corresponding to the first message node in the message set, wherein the message set is used for storing the message nodes according to the time sequence, and the message nodes are generated based on the received message data and are added to the message set by the message scheduler; the message processor processes the message node based on the message type. The invention realizes that the message nodes are stored in the message set according to the received time sequence through the message dispatcher, realizes that all communication data are reserved to the maximum extent, processes the first message node in the message set according to the message type by the message processor, and repeatedly executes the processes, thereby realizing the sequential storage and sequential processing of the message nodes, avoiding the condition that only one message is processed at a time and other messages are ignored, ensuring that each message node can be processed, and improving the accuracy and the real-time performance of the message processing.

Description

Message processing method, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a message processing method, an electronic device, and a storage medium.
Background
As shown in fig. 1, in the communication process between the single-core MCU and the protocol stack, for example, based on BLE communication, network communication, and WiFi communication, a common processing means for the message sending flow or the message receiving flow is serial processing, that is: the data is processed immediately after being retrieved from the protocol stack (BLE, WiFi, network).
If the communication between the system and the protocol stack is frequent, but other operations (such as key operation, power reporting, etc.) do not need emergency response, such as: when the system processes the current data, the protocol stack receives the data again or sends the data again, and the next data can be processed only by processing the existing communication data, so other operations cannot respond or respond disorderly, and the accuracy and the real-time performance of message processing are influenced.
Disclosure of Invention
In order to solve the technical problem or at least partially solve the technical problem, the present application provides a message processing method, an electronic device, and a storage medium.
In a first aspect, the present application provides a message processing method, including:
the message processor determines a message type corresponding to a first message node in the message set, wherein the message set is used for storing the message nodes according to time sequence, the message nodes are generated based on received message data and are added to the message set by a message scheduler, and the message type is sent to a protocol stack or received from the protocol stack;
the message processor processes the message node based on the message type;
the message processor processes the message node based on the message type, and comprises the following steps:
if the message type of the message node is to be sent to a protocol stack, a message processor encapsulates the message node by using a preset protocol and sends encapsulated message data to the protocol stack;
and if the message type of the message node is received from the protocol stack, the message processor analyzes the message node by using a preset protocol to obtain message data.
Optionally, the message dispatcher adds the message node to a message set, including:
the message dispatcher reads the priority information corresponding to the priority data bit in the data domain of the message node;
if the priority of the message node is determined to be higher than the priority of other message nodes in the message set according to the priority information;
if the priority of the message node is higher than the priorities of other message nodes in the message set, inserting the message node into the head of other message nodes in the message set;
if the priority of the message node is lower than the priorities of other message nodes in the message set, inserting the message node into the tail part of other message nodes in the message set;
and if the priority of the message node is lower than the priorities of the message nodes in the message set and higher than the priorities of the rest message nodes in the message set, inserting the message node between the message nodes in the message set and the rest message nodes.
Optionally, before the message dispatcher adds the message node to the message set, the method further includes:
the message dispatcher determines whether the message set exists or not, and if the message set exists, the message node is added to the message set;
if the message set does not exist, the message set is created, and the message node is inserted into the message set.
Optionally, the determining, by the message processor, a message type corresponding to a first message node in the message set includes:
the message processor reads the message type identification in the data field of the message node;
if the message type identification corresponds to a sending type, determining that the message type of the message node is sent to a protocol stack;
and if the message type identifier is a receiving type, determining that the message type of the message node is received from the protocol stack.
Optionally, the message processor processes the message node based on the message type, including:
if the message type of the message node is to be sent to a protocol stack, a message processor encapsulates the message node by using a preset protocol and sends encapsulated message data to the protocol stack;
and if the message type of the message node is received from the protocol stack, the message processor analyzes the message node by using a preset protocol to obtain message data.
Optionally, after the message processor processes the message node based on the message type, the method further includes:
the message dispatcher deletes the message nodes and calculates the current length of the message set;
if the current length of the message set is 0, the message dispatcher releases the space occupied by the message set;
and if the current length of the message set is greater than 0, executing a step that a message processor determines the message type corresponding to the first message node in the message set.
Optionally, the method further comprises:
in the process that the message processor processes the message node based on the message type, if the message processor detects that the priority is higher than the high-priority operation of the message processor for processing the message node, the message processor suspends the processing of the message node based on the message type;
and after the high-priority operation is finished, the message processor continues to process the message node based on the message type.
Optionally, the method further comprises:
in the process that the message processor processes the message nodes based on the message types, if the head of the message node in the message set is inserted into a message node with high priority, the message processor suspends the processing of the message node and preferentially processes the message node with high priority;
and processing the message nodes with the suspended processing when the processing of the message nodes with the high priority is finished.
In a second aspect, the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor configured to implement the message processing method according to any one of the first aspect when executing a program stored in a memory.
In a third aspect, the present application provides a computer-readable storage medium having stored thereon a program of a message processing method, which when executed by a processor, implements the steps of the message processing method of any one of the first aspects.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
the embodiment of the invention firstly constructs a message set used for storing message nodes according to the time sequence, the message nodes are generated based on received message data and are added to the message set by a message dispatcher, then a message processor can determine the message type corresponding to the first message node in the message set and process the message nodes based on the message type, namely, the embodiment of the invention generates the message nodes according to the message data when receiving the message data each time, adds the message nodes to the message set by the message dispatcher and processes the message nodes based on the message type of the message nodes by the message processor.
The message nodes are stored in the message set according to the received time sequence through the message dispatcher, all communication data are retained to the maximum extent, then the first message node in the message set is processed according to the message types through the message processor, the processes are repeatedly executed, sequential storage and sequential processing of the message nodes can be achieved, the situation that only one message is processed at a time and other messages are ignored is avoided, each message node can be processed, and the accuracy and the real-time performance of message processing are improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic diagram illustrating a flow of serially transmitting or serially receiving data with a protocol stack according to an embodiment of the present application;
FIG. 2 is a diagram of a system architecture in a practical application according to an embodiment of the present disclosure;
fig. 3 is a flowchart of a message processing method according to an embodiment of the present application;
fig. 4 is a schematic internal structure diagram of a message node according to an embodiment of the present application;
fig. 5 is a flowchart illustrating a message dispatcher adding a message node to a message set according to an embodiment of the present application;
fig. 6 is a flowchart of message processing in an actual application according to the embodiment of the present application;
fig. 7 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, 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 some embodiments of the present application, but not all 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.
In the related art, if the communication between the system and the protocol stack is frequent, but other operations (such as key operation, power reporting, etc.) do not need an emergency response, for example: when the system processes the current data, the protocol stack receives the data again or sends the data again, and the next data can be processed only by processing the existing communication data, so other operations cannot respond or respond disorderly, and the accuracy and the real-time performance of message processing are influenced.
To this end, an embodiment of the present invention provides a message processing method, an electronic device, and a storage medium, where the message processing method may be applied to a message processing module as shown in fig. 2, and the message processing module may communicate with a protocol stack, a data sending module, and a data receiving module, as shown in fig. 2, as seen from an architecture diagram, the message processing module may serve as an intermediate layer between the "protocol stack" and the "bottom layer data processing" (the sending module and the receiving module), manages message resources for receiving and sending, and has a role in overall arrangement of various messages; and the method is independent of the protocol stack type and the bottom platform, and is convenient to transplant in each hardware platform.
As shown in fig. 3, the message processing method includes:
step S101, the message processor determines the message type corresponding to the first message node in the message set.
In the embodiment of the present invention, the message set is used for storing message nodes according to a time sequence, that is, the message set (message array) is a message set composed of message nodes, the nature of the message set is a one-way linked list, and the message nodes are sequentially connected according to a generated sequence; the message nodes are generated based on the received message data and added to the message set by the message dispatcher, namely, the unresolved data received from the protocol stack and the unpacked data generated by the system and to be sent to the protocol stack are processed into the message nodes, and the generated message nodes are connected through the message dispatcher to form the message set. Since the data processing time is mostly consumed in the parsing process of the received data and the packing process of the transmitted data, the unresolved data received from the protocol stack and the unpacked data generated by the system and transmitted to the protocol stack are processed into a 'message node', so that the data can be most efficiently retained, and the parsing process or the packing process is handed over to a subsequent 'message processor'.
In the embodiment of the present invention, a message node (message node) refers to an unprocessed packet received by a protocol stack or a packet generated by a system and packed to be sent to the protocol stack. The generation of each message node depends on the message received from the protocol stack or the message generated by the system itself and to be sent to the protocol stack, and in order to perform uniform scheduling on the message nodes, the message nodes need to be encapsulated by using a specific mechanism and then mounted to a specific position of the message set.
As shown in fig. 4, the message node includes a data field and a pointer field, where the data field is a data structure, and the structure includes a "message level variable", "application data length", "message type (sending data or receiving data)", an "application data pointer", and the like, and the data to be sent and the data to be received are arrays pointed to by the "application data pointer" in the data field; the pointer field may be used to link message nodes in a message set.
The message processor (message processor) is used for processing the message nodes on the message set. The message scheduler (message scheduler) is used for creating a message set and scheduling message nodes on the message set. The "message handler" is essentially a pointer to only the first "message node" of the "message set" (singly linked list).
After the message processor finishes processing a message node, and the message dispatcher deletes the node, the next message node is used as the first message node of the message set. In the process of processing the message by the message processor, if the system has high-priority operation to interrupt the message processing, the message dispatcher does not delete the unfinished message node, and the message processor continues to process the message node after the high-priority operation of the system is finished.
If there is a high priority "message node" generated and priority processing is required, then this "message node" is scheduled by the "message scheduler" to be the first "message node" of the "message set".
And step S102, the message processor processes the message node based on the message type.
The message processor can process the message nodes according to the message types in the data structure of the data field, and the message node processing sequence of the message set is executed from the head of the message set to the tail of the message set.
The embodiment of the invention firstly constructs a message set used for storing message nodes according to the time sequence, the message nodes are generated based on received message data and are added to the message set by a message dispatcher, then a message processor can determine the message type corresponding to the first message node in the message set and process the message nodes based on the message type, namely, the embodiment of the invention generates the message nodes according to the message data when receiving the message data each time, adds the message nodes to the message set by the message dispatcher and processes the message nodes based on the message type of the message nodes by the message processor.
The message nodes are stored in the message set according to the received time sequence through the message dispatcher, all communication data are retained to the maximum extent, then the first message node in the message set is processed according to the message types through the message processor, the processes are repeatedly executed, sequential storage and sequential processing of the message nodes can be achieved, the situation that only one message is processed at a time and other messages are ignored is avoided, each message node can be processed, and the accuracy and the real-time performance of message processing are improved.
In another embodiment of the present invention, as shown in fig. 5, the message dispatcher adds the message node to the message set, including:
step 201, the message dispatcher reads the priority information corresponding to the priority data bit in the data domain of the message node;
step 202, if the priority of the message node is determined to be higher than the priority of other message nodes in the message set according to the priority information;
the message dispatcher may compare the priority of the message node to the priorities of other message nodes in the message set.
Step 203, if the priority of the message node is higher than the priority of other message nodes in the message set, inserting the message node into the head of other message nodes in the message set;
step 204, if the priority of the message node is lower than the priorities of other message nodes in the message set, inserting the message node into the tail of other message nodes in the message set;
step 205, if the priority of the message node is lower than the priorities of the plurality of message nodes in the message set and higher than the priorities of the plurality of remaining message nodes in the message set, inserting the message node between the plurality of message nodes in the message set and the plurality of remaining message nodes.
With the continuous insertion of the message nodes with different priorities into the message set, the message nodes with the same priority in the message set are sorted in time sequence, so that the message processor can sequentially process the message node with the highest priority and the earliest receiving time, then process the message node … … with the highest priority and the earliest receiving time, then process the message node … … with the next highest priority and the latest receiving time until all the message nodes in the message set are processed.
The embodiment of the invention can insert the subsequently received message nodes into the message set according to the priority order based on the priority of each message node, thus the message nodes can be processed according to the priority order, the high-priority operation of the system can be responded to the maximum extent without influencing the processing of communication data, and the important message nodes are prevented from being processed by delay.
In another embodiment of the present invention, before the message dispatcher adds the message node to the message set, the method further comprises:
step 301, the message dispatcher determines whether the message set exists, and if the message set exists, the message node is added to the message set;
step 302, if the message set does not exist, the message set is created, and the message node is inserted into the message set.
After receiving message data each time and generating message nodes based on the message data, the embodiment of the invention firstly determines whether a message set exists before inserting the message nodes into the message set, if the message set exists, the message set is directly added, and if the message set does not exist, the message set is created, and the message nodes are added into the created message set, so that the message nodes are ensured to be stored by the message set when the message nodes are generated, the message nodes can be stored sequentially according to the time sequence when the message nodes are continuously generated, the loss, the omission processing and the processing error of the messages are avoided, and the accuracy and the real-time performance of message processing are improved.
In another embodiment of the present invention, the determining, by the message processor, the message type corresponding to the first message node in the message set includes:
step 401, the message processor reads the message type identifier in the data field of the message node;
step 402, if the message type identifier corresponds to a sending type, determining that the message type of the message node is sent to a protocol stack;
step 403, if the message type identifier is a receiving type, determining that the message type of the message node is received from the protocol stack.
Correspondingly, the message processor processes the message node based on the message type, and the processing comprises the following steps:
step 404, if the message type of the message node is to be sent to a protocol stack, the message processor encapsulates the message node by using a preset protocol, and sends the encapsulated message data to the protocol stack;
step 405, if the message type of the message node is received from the protocol stack, the message processor analyzes the message node by using a preset protocol to obtain message data.
In the embodiment of the invention, the message processor always points to the first message node in the message set, and the message processor can judge whether to receive data or send data according to the specific data bit of the data field of the message node. If the data is received, the message processor analyzes the message node according to the established protocol and processes the data according to the protocol after analysis; if the data is sent, the message processor encapsulates the message node according to the established protocol and then sends the encapsulated message node to the protocol stack.
The embodiment of the invention can conveniently distinguish the message types of the message nodes by setting the transmission identifier, thereby being convenient for carrying out different processing on the message nodes according to different message types.
In another embodiment of the present invention, after the message processor processes the message node based on the message type, the method further includes:
the message dispatcher deletes the message nodes and calculates the current length of the message set;
if the current length of the message set is 0, the message dispatcher releases the space occupied by the message set;
and if the current length of the message set is greater than 0, executing a step that a message processor determines the message type corresponding to the first message node in the message set.
In the embodiment of the invention, if the message processor completes the processing of sending data or receiving data, the message dispatcher deletes the message node and calculates the length of the message set. If the length is 0, then the "message dispatcher" frees up "message set" space and the system will continue to wait for the occurrence of either "send data" or "receive data"; if the length of the 'message set' is not 0, the step that the message processor determines the message type corresponding to the first message node in the message set is continued. That is to say, the embodiment of the invention can automatically delete the space occupied by the message set when the message set is empty, thereby saving system resources.
In yet another embodiment of the present invention, the method further comprises:
in the process that the message processor processes the message node based on the message type, if the message processor detects that the priority is higher than the high-priority operation of the message processor for processing the message node, the message processor suspends the processing of the message node based on the message type;
and after the high-priority operation is finished, the message processor continues to process the message node based on the message type.
In the embodiment of the invention, if the high-priority operation occurs in the system in the data processing process and the data processing is interrupted, the message node which is being processed is not deleted, and the message node is processed again after the system finishes the high-priority operation. That is to say, when the emergency operation occurs in the system, the emergency operation can be preferentially processed, and after the emergency operation processing is completed, the message node can be processed continuously.
In yet another embodiment of the present invention, the method further comprises:
in the process that the message processor processes the message nodes based on the message types, if the head of the message node in the message set is inserted into a message node with high priority, the message processor suspends the processing of the message node and preferentially processes the message node with high priority;
and processing the message nodes with the suspended processing when the processing of the message nodes with the high priority is finished.
In the embodiment of the invention, if a system generates high-priority message nodes in the process of processing data and interrupts data processing, the message nodes being processed are not deleted, a message dispatcher mounts the high-priority message nodes to the first message node of a message set, and a message processor prioritizes the high-priority message nodes. That is, when the header of the message node in the message set is inserted into the message node with high priority, the inserted message node may be processed preferentially, and after the message node with high priority is processed, the processing of the message node whose processing is suspended previously may be continued.
In order to facilitate understanding of the present solution, an embodiment of an overall flow for performing message processing in an actual application is also provided, which is as follows:
as shown in fig. 6, receiving message data to be sent to a protocol stack or message data sent by the protocol stack, generating a message node based on the message data, determining whether a message set exists by a message scheduler, and if the message set exists, adding the message node to the message set; if no message set exists, a message set is created, and message nodes are inserted into the message set.
When the message node is added to the message set, the message dispatcher reads the priority information corresponding to the priority data bit in the data domain of the message node; if the priority of the message node is determined to be higher than the priority of other message nodes in the message set according to the priority information; if the priority of the message node is higher than the priorities of other message nodes in the message set, inserting the message node into the head of other message nodes in the message set; if the priority of the message node is lower than the priority of other message nodes in the message set, inserting the message node into the tail part of other message nodes in the message set; and if the priority of the message node is lower than the priorities of the message nodes in the message set and higher than the priorities of the rest message nodes in the message set, inserting the message node between the message nodes in the message set and the rest message nodes.
Meanwhile, the message processor determines the message type corresponding to the first message node in the message set, and specifically, the message processor reads the message type identifier in the data field of the message node; if the transmission identifier is a first numerical value, determining the message type of the message node as being sent to the protocol stack; and if the transmission identifier is the second numerical value, determining the message type of the message node as being received from the protocol stack.
If the message type of the message node is to be sent to the protocol stack, the message processor encapsulates the message node by using a preset protocol and sends the encapsulated message data to the protocol stack; if the message type of the message node is received from the protocol stack, the message processor analyzes the message node by using a preset protocol to obtain message data.
After the message processor processes the message nodes based on the message types, the message dispatcher deletes the message nodes and calculates the current length of the message set; if the current length of the message set is 0, the message dispatcher releases the space occupied by the message set; and if the current length of the message set is greater than 0, executing a step of determining the message type corresponding to the first message node in the message set by the message processor.
In another embodiment of the present invention, an electronic device is further provided, which includes a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the message processing method of any one of the method embodiments when executing the program stored in the memory.
In the electronic device provided in the embodiment of the present invention, the processor implements, by executing the program stored in the memory, that a message set for storing message nodes in time sequence is first constructed, where the message nodes are generated based on received message data and added to the message set by the message scheduler, and then the message processor may determine a message type corresponding to a first message node in the message set and process the message node based on the message type, that is, in the embodiment of the present invention, a message node is generated according to the message data and added to the message set by the message scheduler each time the message data is received, and then the message processor processes the message node based on the message type of the message node.
The message nodes are stored in the message set according to the received time sequence through the message dispatcher, all communication data are retained to the maximum extent, then the first message node in the message set is processed according to the message types through the message processor, the processes are repeatedly executed, sequential storage and sequential processing of the message nodes can be achieved, the situation that only one message is processed at a time and other messages are ignored is avoided, each message node can be processed, and the accuracy and the real-time performance of message processing are improved.
The communication bus 1140 mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 1140 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 7, but this is not intended to represent only one bus or type of bus.
The communication interface 1120 is used for communication between the electronic device and other devices.
The memory 1130 may include a Random Access Memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The processor 1110 may be a general-purpose processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the integrated circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components.
In a further embodiment of the present invention, there is also provided a computer-readable storage medium having stored thereon a program of a message processing method, which when executed by a processor, implements the steps of the message processing method of any of the preceding method embodiments.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (9)

1. A message processing method, comprising:
the message processor determines a message type corresponding to a first message node in a message set, wherein the message set is used for storing the message nodes according to time sequence, the message nodes are generated based on received message data and are added to the message set by a message scheduler, and the message type is sent to a protocol stack or received from the protocol stack;
the message processor processes the message node based on the message type;
the message processor processes the message node based on the message type, and comprises the following steps:
if the message type of the message node is to be sent to a protocol stack, a message processor encapsulates the message node by using a preset protocol and sends encapsulated message data to the protocol stack;
and if the message type of the message node is received from the protocol stack, the message processor analyzes the message node by using a preset protocol to obtain message data.
2. The message processing method of claim 1, wherein the message dispatcher adds the message node to a message set, comprising:
the message dispatcher reads the priority information corresponding to the priority data bit in the data domain of the message node;
if the priority of the message node is determined to be higher than the priority of other message nodes in the message set according to the priority information;
if the priority of the message node is higher than the priorities of other message nodes in the message set, inserting the message node into the head of other message nodes in the message set;
if the priority of the message node is lower than the priorities of other message nodes in the message set, inserting the message node into the tail part of other message nodes in the message set;
and if the priority of the message node is lower than the priorities of the message nodes in the message set and higher than the priorities of the rest message nodes in the message set, inserting the message node between the message nodes in the message set and the rest message nodes.
3. The message processing method of claim 1, wherein before the message dispatcher adds the message node to the message set, the method further comprises:
the message dispatcher determines whether the message set exists or not, and if the message set exists, the message node is added to the message set;
if the message set does not exist, the message set is created, and the message node is inserted into the message set.
4. The message processing method of claim 1, wherein the message processor determines the message type corresponding to the first message node in the message set, comprising:
the message processor reads the message type identification in the data field of the message node;
if the message type identification corresponds to a sending type, determining that the message type of the message node is sent to a protocol stack;
and if the message type identifier is a receiving type, determining that the message type of the message node is received from the protocol stack.
5. The message processing method of claim 1, wherein after the message processor processes the message node based on the message type, the method further comprises:
the message dispatcher deletes the message nodes and calculates the current length of the message set;
if the current length of the message set is 0, the message dispatcher releases the space occupied by the message set;
and if the current length of the message set is greater than 0, executing a step that a message processor determines the message type corresponding to the first message node in the message set.
6. The message processing method of claim 1, wherein the method further comprises:
in the process that the message processor processes the message node based on the message type, if the message processor detects that the priority is higher than the high-priority operation of the message processor for processing the message node, the message processor suspends the processing of the message node based on the message type;
and after the high-priority operation is finished, the message processor continues to process the message node based on the message type.
7. The message processing method of claim 1, wherein the method further comprises:
in the process that the message processor processes the message nodes based on the message types, if the head of the message node in the message set is inserted into a message node with high priority, the message processor suspends the processing of the message node and preferentially processes the message node with high priority;
and processing the message nodes with the suspended processing when the processing of the message nodes with the high priority is finished.
8. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the message processing method according to any one of claims 1 to 7 when executing a program stored in a memory.
9. A computer-readable storage medium, characterized in that a program of a message processing method is stored on the computer-readable storage medium, which when executed by a processor implements the steps of the message processing method of any one of claims 1 to 7.
CN202110701017.XA 2021-06-24 2021-06-24 Message processing method, electronic equipment and storage medium Active CN113518082B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110701017.XA CN113518082B (en) 2021-06-24 2021-06-24 Message processing method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110701017.XA CN113518082B (en) 2021-06-24 2021-06-24 Message processing method, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113518082A CN113518082A (en) 2021-10-19
CN113518082B true CN113518082B (en) 2021-12-17

Family

ID=78066169

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110701017.XA Active CN113518082B (en) 2021-06-24 2021-06-24 Message processing method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113518082B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105975433A (en) * 2016-06-30 2016-09-28 瑞斯康达科技发展股份有限公司 Message processing method and device
CN109491809A (en) * 2018-11-12 2019-03-19 西安微电子技术研究所 A kind of communication means reducing high-speed bus delay
CN110177083A (en) * 2019-04-26 2019-08-27 阿里巴巴集团控股有限公司 A kind of network interface card, data transmission/method of reseptance and equipment
CN110995540A (en) * 2019-12-13 2020-04-10 中国电子科技集团公司第五十四研究所 PTP network time on-line monitoring module
CN112468483A (en) * 2020-11-24 2021-03-09 中国电子科技集团公司第三十研究所 Service dynamic allocation and signaling protection method based on 5G edge protection agent

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8935329B2 (en) * 2012-01-11 2015-01-13 International Business Machines Corporation Managing message transmission and reception

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105975433A (en) * 2016-06-30 2016-09-28 瑞斯康达科技发展股份有限公司 Message processing method and device
CN109491809A (en) * 2018-11-12 2019-03-19 西安微电子技术研究所 A kind of communication means reducing high-speed bus delay
CN110177083A (en) * 2019-04-26 2019-08-27 阿里巴巴集团控股有限公司 A kind of network interface card, data transmission/method of reseptance and equipment
CN110995540A (en) * 2019-12-13 2020-04-10 中国电子科技集团公司第五十四研究所 PTP network time on-line monitoring module
CN112468483A (en) * 2020-11-24 2021-03-09 中国电子科技集团公司第三十研究所 Service dynamic allocation and signaling protection method based on 5G edge protection agent

Also Published As

Publication number Publication date
CN113518082A (en) 2021-10-19

Similar Documents

Publication Publication Date Title
WO2020052605A1 (en) Network slice selection method and device
CN109688058B (en) Message processing method and device and network equipment
CN111147184B (en) Ethernet transmitting and receiving equipment supporting multi-service preemption and continuous transmission and transmission device
US8121129B2 (en) Optimizing throughput of data in a communications network
CN105052077A (en) Method and apparatus for processing information in M2M communications
CN110519388B (en) Processing method and device for block chain request, electronic equipment and readable storage medium
CN110708234B (en) Message transmission processing method, message transmission processing device and storage medium
JP2017118407A (en) Communication system
CN113157465B (en) Message sending method and device based on pointer linked list
CN108737397B (en) Method for realizing data interaction between service and protocol stack in router
CN113518082B (en) Message processing method, electronic equipment and storage medium
CN112261142B (en) RDMA network data retransmission method, device and FPGA
JP3713977B2 (en) Real-time distributed system
CN115344405A (en) Data processing method, network interface card, electronic equipment and storage medium
CN116204487A (en) Remote data access method and device
CN113760559A (en) Dual-core communication method and electronic equipment
CN111245867A (en) Sensor data analysis method and system
CN112835823B (en) Storage controller response sending method
CN112399470A (en) LoRa communication method, LoRa gateway, LoRa system and computer readable storage medium
KR101923850B1 (en) Wireless communication apparatus, wireless communication method, and wireless communication program
CN110795371A (en) I/O request processing method, system, equipment and computer storage medium
CN114095576B (en) Call request sending method and device
CN117170889B (en) Heterogeneous non-blocking data packet synchronous processing system
WO2023221486A1 (en) Method and apparatus for processing messages
CN111049761B (en) Data processing method of wireless water controller communication module

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