CN116996449A - Data message processing system, method, computer device and storage medium - Google Patents

Data message processing system, method, computer device and storage medium Download PDF

Info

Publication number
CN116996449A
CN116996449A CN202210444766.3A CN202210444766A CN116996449A CN 116996449 A CN116996449 A CN 116996449A CN 202210444766 A CN202210444766 A CN 202210444766A CN 116996449 A CN116996449 A CN 116996449A
Authority
CN
China
Prior art keywords
data message
data
register
message
storage position
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.)
Pending
Application number
CN202210444766.3A
Other languages
Chinese (zh)
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.)
Shenzhen Yunbao Intelligent Co ltd
Original Assignee
Shenzhen Yunbao Intelligent 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 Shenzhen Yunbao Intelligent Co ltd filed Critical Shenzhen Yunbao Intelligent Co ltd
Priority to CN202210444766.3A priority Critical patent/CN116996449A/en
Publication of CN116996449A publication Critical patent/CN116996449A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal

Abstract

The application relates to a data message processing system, a data message processing method, computer equipment and a storage medium. The system comprises: the data message receiving and transmitting module and the data message processing module; the data message receiving and transmitting module is used for distributing corresponding storage position identifiers to the received data messages; storing the storage position identification to the tail end of a corresponding order-preserving queue, and storing the data message to a storage position corresponding to the storage position identification in a data message processing module; the data message processing module is used for processing the selected stored data message and sending the storage position identification of the processed data message to the data message receiving and transmitting module; and the data message receiving and transmitting module is used for reading and transmitting the processed data message from the corresponding storage position under the condition that the storage position identification of the processed data message is positioned at the head end of the queue of the corresponding order-preserving queue. By adopting the system, the message processing efficiency can be improved.

Description

Data message processing system, method, computer device and storage medium
Technical Field
The present application relates to the field of computer technology, and in particular, to a data packet processing system, a data packet processing method, a computer device, a storage medium, and a computer program product.
Background
In the field of computer technology, received messages are generally stored in a plurality of CPUs (Central Processing Unit, central processing units), each CPU processes the stored messages, and finally the processed messages are sent out according to the flow order-preserving requirements. The stream order-preserving requirement refers to that when messages are output, the messages of the same data stream must be output according to the input sequence, and no order requirement exists among the messages of different data streams.
In the conventional technology, when processing a data message, a received message is generally stored in a storage space of a CPU according to a ring buffer mechanism (for example, a sequence of cyclic movement from top to bottom), and the stored message is processed and output according to the storage sequence by the CPU. However, if the processing time of a certain message in a certain data stream is long in a certain CPU, the message located after the message in the CPU cannot be processed in time, and the processed message located after the message in the other CPU belongs to the same data stream and cannot be output, so that the other processed messages located after the processed message cannot be output, which results in long processing delay of the message and further reduces the processing efficiency of the message.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a data message processing system, a method, a computer device, a computer readable storage medium, and a computer program product that can improve the efficiency of message processing.
In a first aspect, the present application provides a data packet processing system, including: the data message receiving and transmitting module and the data message processing module are connected;
the data message receiving and transmitting module is used for distributing corresponding storage position identifiers to the received data messages; storing the storage position identification to the tail end of a sequence preserving queue corresponding to the data message, and storing the data message to a storage position corresponding to the storage position identification in the data message processing module; each order-preserving queue is used for storing the storage position identifiers of the data messages belonging to the same data stream according to the message receiving order;
the data message processing module is used for processing the selected stored data message and sending the storage position identification of the processed data message to the data message receiving and transmitting module;
the data message receiving and transmitting module is further configured to, when the storage location identifier of the processed data message is located at the head end of the corresponding order-preserving queue, read the processed data message from the storage location corresponding to the storage location identifier, and send the processed data message out.
In one embodiment, the data messaging module includes a messaging transceiver and a first register;
the first register is configured to set a data location corresponding to the allocated storage location identifier as a first value, and set a data location corresponding to the unallocated storage location identifier as a second value;
the message transceiver is configured to select any one storage location identifier from storage location identifiers with second values corresponding to data locations in the first register, and allocate the selected storage location identifier to a received data message; transmitting a first pulse signal carrying the selected storage location identification to the first register;
the first register is further configured to set a data location corresponding to the selected storage location identifier to a first value according to the first pulse signal.
In one embodiment, the message transceiver is further configured to identify a data flow identifier of the received data message; and screening out the order-preserving queues corresponding to the data flow identifiers from the plurality of order-preserving queues to be used as the order-preserving queues corresponding to the data messages.
In one embodiment, the system further comprises a second register;
The second register is configured to take a data location corresponding to a storage location identifier of the stored unprocessed data packet as a first value, and take a data location corresponding to a storage location identifier of the stored processed data packet as a second value;
the message transceiver is further configured to send a second pulse signal carrying the storage location identifier to the second register when it is detected that the data message is successfully stored in a storage location corresponding to the storage location identifier in the data message processing module;
the second register is further configured to set a data location corresponding to the storage location identifier to a first value according to the second pulse signal.
In one embodiment, the system further comprises a third register;
the third register is configured to set a data location corresponding to the storage location identifier of the unsent processed data packet as a first value, and set a data location corresponding to the storage location identifier of the sent processed data packet as a second value;
the data message processing module is further configured to select a stored data message from a storage location corresponding to a storage location identifier with a data location corresponding to a first value in the second register, and process the stored data message to obtain a corresponding processed data message; transmitting a third pulse signal carrying the storage position identification of the processed data message to the second register, and transmitting a fourth pulse signal carrying the storage position identification of the processed data message to the third register;
The second register is further configured to set a data location corresponding to the storage location identifier of the processed data packet to a second value according to the third pulse signal;
and the third register is further configured to set a data location corresponding to the storage location identifier of the processed data packet to a first value according to the fourth pulse signal.
In one embodiment, the message transceiver is further configured to send a fifth pulse signal carrying a storage location identifier of the processed data message to the first register and send a sixth pulse signal carrying a storage location identifier of the processed data message to the third register when it is detected that the processed data message is successfully sent out;
the first register is further configured to set a data location corresponding to the storage location identifier to a second value according to the fifth pulse signal;
and the third register is further configured to set a data location corresponding to the storage location identifier to a second value according to the sixth pulse signal.
In one embodiment, the data packet transceiver module is further configured to delete, when it is detected that the processed data packet is successfully sent out, a storage location identifier of the processed data packet from a sequence-preserving queue corresponding to the processed data packet.
In one embodiment, the data packet processing module is further configured to process the selected stored data packet by using a thread corresponding to the selected stored data packet; when the waiting time of the thread in the message processing process is recognized to be longer than the preset time, confirming that the thread meets the thread switching condition, and processing the next stored data message by using the thread corresponding to the next stored data message;
and the data message processing module is further used for processing the rest part of the selected stored data message by utilizing a thread corresponding to the selected stored data message under the condition that the waiting time period is over.
In a second aspect, the application further provides a data message processing method. The method comprises the following steps:
distributing corresponding storage position identifiers to the received data messages;
storing the storage position identification to the tail end of a sequence preserving queue corresponding to the data message, and storing the data message to a storage position corresponding to the storage position identification; each order-preserving queue is used for storing the storage position identifiers of the data messages belonging to the same data stream according to the message receiving order;
Processing the selected stored data message to obtain a processed data message;
and under the condition that the storage position identifier of the processed data message is positioned at the head end of the queue of the corresponding order-preserving queue, reading the processed data message from the storage position corresponding to the storage position identifier, and sending the processed data message out.
In one embodiment, the method further comprises:
the data position corresponding to the allocated storage position identifier is set to be a first numerical value through a first register, and the data position corresponding to the unallocated storage position identifier is set to be a second numerical value;
selecting any one storage position identifier from storage position identifiers with second values corresponding to data positions in the first register, and distributing the selected storage position identifier to a received data message; transmitting a first pulse signal carrying the selected storage location identification to the first register;
and setting the data position corresponding to the selected storage position identifier as a first numerical value through the first register according to the first pulse signal.
In one embodiment, after the corresponding storage location identifier is allocated to the received data packet, the method further includes:
Identifying a data flow identifier of the received data message; and screening out the order-preserving queues corresponding to the data flow identifiers from the plurality of order-preserving queues to be used as the order-preserving queues corresponding to the data messages.
In one embodiment, the method further comprises:
the data position corresponding to the storage position identification of the stored unprocessed data message is taken as a first numerical value through a second register, and the data position corresponding to the storage position identification of the stored processed data message is taken as a second numerical value;
under the condition that the data message is detected to be successfully stored in a storage position corresponding to the storage position identifier, a second pulse signal carrying the storage position identifier is sent to the second register;
and setting the data position corresponding to the storage position identifier as a first numerical value through the second register according to the second pulse signal.
In one embodiment, the method further comprises:
the data position corresponding to the storage position identification of the non-transmitted processed data message is taken as a first numerical value through a third register, and the data position corresponding to the storage position identification of the transmitted processed data message is taken as a second numerical value;
Selecting a stored data message from a storage position corresponding to a storage position identifier with a corresponding data position of a first value in the second register to process the stored data message, so as to obtain a corresponding processed data message; transmitting a third pulse signal carrying the storage position identification of the processed data message to the second register, and transmitting a fourth pulse signal carrying the storage position identification of the processed data message to the third register;
the data position corresponding to the storage position identification of the processed data message is set to be a second numerical value through the second register according to the third pulse signal;
and the data position corresponding to the storage position identification of the processed data message is a first numerical value through the third register according to the fourth pulse signal.
In one embodiment, the method further comprises:
under the condition that the processed data message is successfully sent out, sending a fifth pulse signal carrying the storage position identification of the processed data message to the first register, and sending a sixth pulse signal carrying the storage position identification of the processed data message to the third register;
The data position corresponding to the storage position identification is set to be a second numerical value through the first register according to the fifth pulse signal;
and the third register is used for setting the data position corresponding to the storage position identification as a second numerical value according to the sixth pulse signal.
In one embodiment, the method further comprises:
and deleting the storage position identification of the processed data message from the order-preserving queue corresponding to the processed data message under the condition that the processed data message is detected to be successfully sent out.
In one embodiment, the method further comprises:
processing the selected stored data message by using a thread corresponding to the selected stored data message; when the waiting time of the thread in the message processing process is recognized to be longer than the preset time, confirming that the thread meets the thread switching condition, and processing the next stored data message by using the thread corresponding to the next stored data message;
and under the condition that the waiting time is over, processing the rest part of the selected stored data message by utilizing a thread corresponding to the selected stored data message.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor which when executing the computer program performs the steps of:
distributing corresponding storage position identifiers to the received data messages;
storing the storage position identification to the tail end of a sequence preserving queue corresponding to the data message, and storing the data message to a storage position corresponding to the storage position identification; each order-preserving queue is used for storing the storage position identifiers of the data messages belonging to the same data stream according to the message receiving order;
processing the selected stored data message to obtain a processed data message;
and under the condition that the storage position identifier of the processed data message is positioned at the head end of the queue of the corresponding order-preserving queue, reading the processed data message from the storage position corresponding to the storage position identifier, and sending the processed data message out.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
Distributing corresponding storage position identifiers to the received data messages;
storing the storage position identification to the tail end of a sequence preserving queue corresponding to the data message, and storing the data message to a storage position corresponding to the storage position identification; each order-preserving queue is used for storing the storage position identifiers of the data messages belonging to the same data stream according to the message receiving order;
processing the selected stored data message to obtain a processed data message;
and under the condition that the storage position identifier of the processed data message is positioned at the head end of the queue of the corresponding order-preserving queue, reading the processed data message from the storage position corresponding to the storage position identifier, and sending the processed data message out.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the steps of:
distributing corresponding storage position identifiers to the received data messages;
storing the storage position identification to the tail end of a sequence preserving queue corresponding to the data message, and storing the data message to a storage position corresponding to the storage position identification; each order-preserving queue is used for storing the storage position identifiers of the data messages belonging to the same data stream according to the message receiving order;
Processing the selected stored data message to obtain a processed data message;
and under the condition that the storage position identifier of the processed data message is positioned at the head end of the queue of the corresponding order-preserving queue, reading the processed data message from the storage position corresponding to the storage position identifier, and sending the processed data message out.
The data message processing system, method, computer device, storage medium and computer program product described above, the system comprising: the data message receiving and transmitting module and the data message processing module are connected; the data message receiving and transmitting module is used for distributing corresponding storage position identifiers to the received data messages; storing the storage position identification to the tail end of a sequence preserving queue corresponding to the data message, and storing the data message to a storage position corresponding to the storage position identification in a data message processing module; each order-preserving queue is used for storing the storage position identifiers of the data messages belonging to the same data stream according to the message receiving order; the data message processing module is used for processing the selected stored data message and sending the storage position identification of the processed data message to the data message receiving and transmitting module; and the data message receiving and transmitting module is also used for reading the processed data message from the storage position corresponding to the storage position identifier and transmitting the processed data message under the condition that the storage position identifier of the processed data message is positioned at the head end of the corresponding queue of the order-preserving queue. In this way, the application stores the received data message to the storage position corresponding to the storage position mark allocated to the data message in the data message processing module through the data message transceiver module included in the data message processing system, processes the selected stored data message through the data message processing module, and can be output when the storage position mark of the processed data message is positioned at the head end of the corresponding order-preserving queue; the stored messages are not required to be processed and output according to the storage sequence, so that the defect that in a certain CPU, the processing time of a certain message of a certain data stream is long, the messages positioned behind the message cannot be processed in time in the CPU, and in other CPUs, the messages which belong to the same data stream and are positioned behind the message and are processed cannot be output, and further the other messages positioned behind the processed message and are processed and finished cannot be output is avoided, the message processing delay is reduced, and the message processing efficiency is further improved.
Drawings
FIG. 1 is a block diagram of a data packet processing system in one embodiment;
FIG. 2 is a schematic diagram of different data flows in one embodiment;
FIG. 3 is a schematic diagram of data message storage of different CPUs in one embodiment;
FIG. 4 is a block diagram of a data packet processing system in another embodiment;
FIG. 5 is a flow chart of a method of processing data messages in one embodiment;
FIG. 6 is a timing diagram of different registers in one embodiment;
FIG. 7 is a flow chart of a method of processing data messages according to another embodiment;
FIG. 8 is a flow chart of a method of processing data messages according to yet another embodiment;
FIG. 9 is a flow chart of a method of processing data messages in yet another embodiment;
fig. 10 is an internal structural view of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
In one embodiment, as shown in FIG. 1, there is provided a data message processing system comprising: the connected data message transceiver module 101 and data message processing module 102; the data message transceiver module 101 is configured to allocate a corresponding storage location identifier to the received data message; storing the storage position identification to the tail end of a sequence preserving queue corresponding to the data message, and storing the data message to a storage position corresponding to the storage position identification in the data message processing module 102; each order-preserving queue is used for storing the storage position identifiers of the data messages belonging to the same data stream according to the message receiving order; the data message processing module 102 is configured to process the selected stored data message, and send a storage location identifier of the processed data message to the data message transceiver module 101; the data message transceiver module 101 is further configured to, when the storage location identifier of the processed data message is located at the head end of the corresponding order-preserving queue, read the processed data message from the storage location corresponding to the storage location identifier, and send the processed data message out.
The data message transceiver module 101 is a module for receiving unprocessed data messages, storing the unprocessed data messages to a storage location in the data message processing module 102, and sending the processed data messages. The data packet processing module 102 refers to a module, such as a CPU, that processes a stored data packet. It should be noted that each data packet processing system may include a plurality of data packet processing modules 102, such as a plurality of CPUs.
The data message refers to a data block that needs to be processed. One data stream may include a plurality of data messages. For example, referring to fig. 2, the data Flow0 includes 3 data packets, which are respectively Flow0Packet0, flow0Packet1, and Flow0Packet 2; the data Flow1 comprises 2 data messages, namely Flow1 Packet0 and Flow1 Packet1; the data Flow2 comprises 2 data messages, namely Flow2 Packet0 and Flow2 Packet1; the data Flow3 includes 2 data packets, namely Flow3 Packet0 and Flow3 Packet1.
The storage location identifier refers to identification information, such as Entry ID, corresponding to a storage location in the data packet processing module 102; the data message processing module 102 includes a memory, where the memory includes a plurality of storage locations, and each storage location corresponds to a storage location identifier. For example, as shown in fig. 3, the data space of CPU0 includes 4 storage locations, corresponding to Entry 0, entry 1, entry 2, entry 3, the data space of CPU1 includes 4 storage locations, corresponding to Entry 4, entry 5, entry 6, entry 7, the data space of CPU2 includes 4 storage locations, corresponding to Entry 8, entry 9, entry 10, entry 11; wherein Flow refers to data Flow, packet refers to data message, entry refers to interval. In fig. 3, the data packets may be randomly placed without depending on the read-write sequence under the ring buffer mechanism. The CPU may also process the data packets out of order. It should be noted that, the data packet processing module 102 includes, in addition to the memory, a program module that specifically processes the data packet.
It should be noted that, the data message processing module 102 supports out-of-order storage of the data message, that is, the data message transceiver module 101 may arbitrarily allocate an idle storage location identifier to the received data message, and store the received data message to a storage location in the data message processing module 102 corresponding to the storage location identifier; the free storage location identifier refers to any one of the free storage location identifiers corresponding to all the data packet processing modules 102. The received data messages are not required to be stored in the storage space of the CPU according to a ring buffer mechanism (such as the order of cyclic movement from top to bottom). For example, in the memory of the CPU1, the free memory locations from top to bottom correspond to Entry 1, entry 2, entry 3 … … Entry 8, entry 9, and Entry 10, respectively, and the data messaging module 101 may store the received data message to any one of the memory locations of the CPU1, without storing the received data message to the memory location corresponding to Entry 1. Of course, the data packet transceiver module 101 may store the received data packet to any free storage location in the data packet processing module 102 with the lightest load according to the load balancing rule.
Each data stream corresponds to one order-preserving queue, and each order-preserving queue is used for sequentially storing the storage position identifiers of the data messages of the same data stream according to the message receiving sequence. For example, for the data flow a, the data packet A1 is received first, then the data packet A2 is received, and finally the data packet A3 is received, and then the data packet A1, the data packet A2, and the storage location identifier of the data packet A3 are sequentially stored in the order-preserving queue corresponding to the data flow a. It should be noted that, each time a data packet is received, the data packet transceiver module 101 stores the storage location identifier allocated to the data packet to the end of the queue of the order-preserving queue of the data flow to which the data packet belongs, so that the data packet belonging to the same data flow can be output according to the input order.
The tail end of the queue is the next position of the position where the last storage position mark in the order-preserving queue is located; if the storage position identifier 1 and the storage position identifier 2 are stored in the order-preserving queue, the tail end of the queue refers to the 3 rd position; if the storage location identifier 1, the storage location identifier 2 and the storage location identifier 3 are already stored in the order-preserving queue, the end of the queue refers to the 4 th location.
The data message processing modules 102 may support out-of-order processing of data messages, for example, each data message processing module 102 may select any one stored data message from the stored data messages corresponding to the data message processing module to process the data message; the stored data messages do not need to be processed according to the storage sequence, for example, the later stored data messages can be processed first. In addition, each time a stored data message is processed, the data message processing module 102 sends the obtained storage location identifier of the processed data message to the data message transceiver module 101, so that the data message transceiver module 101 can check the corresponding order-preserving queue according to the storage location identifier to determine whether the processed data message can be output.
The data message transceiver module 101 may also query a sequence-preserving queue of a data stream to which the processed data message belongs according to the received storage location identifier of the processed data message, determine whether the storage location identifier of the processed data message is located at the head end of the sequence-preserving queue, if yes, read the processed data message from a storage location corresponding to the storage location identifier in the data message processing module 102, and send the processed data message.
Specifically, the data message transceiver module 101 receives the data message transmitted upstream, and randomly selects one storage location identifier from the storage location identifiers of the idle storage locations corresponding to all the data message processing modules 102, and distributes the selected storage location identifier to the received data message; identifying the data flow to which the received data message belongs, taking the order-preserving queue corresponding to the data flow to which the data message belongs as the order-preserving queue corresponding to the data message, and storing the storage position identification to the end of the order-preserving queue corresponding to the data message. Meanwhile, the data message transceiver module 101 stores the data message to a storage location corresponding to the storage location identifier in the data message processing module 102. Next, the data packet processing module 102 selects one stored data packet from all the stored data packets, processes the selected stored data packet to obtain a processed data packet, and sends a storage location identifier of the processed data packet to the data packet transceiver module 101. The data message transceiver module 101 queries a corresponding order-preserving queue according to the storage position identification of the processed data message; if the storage location identifier of the processed data message is located at the head end of the queue of the corresponding order-preserving queue, a message reading request carrying the storage location identifier is sent to the corresponding data message processing module 102; the data message processing module 102 reads the processed data message from the storage position corresponding to the storage position identifier according to the received message reading request, and sends the processed data message to the data message transceiver module 101; the data message transceiver module 101 sends out the processed data message.
Further, if the storage location identifier of the processed data message is not located at the head end of the corresponding order-preserving queue, the processed data message is not read from the storage location corresponding to the storage location identifier.
The data message processing system comprises a data message receiving and transmitting module 101 and a data message processing module 102 which are connected; the data message transceiver module 101 is configured to allocate a corresponding storage location identifier to the received data message; storing the storage position identification to the tail end of a sequence preserving queue corresponding to the data message, and storing the data message to a storage position corresponding to the storage position identification in the data message processing module 102; each order-preserving queue is used for storing the storage position identifiers of the data messages belonging to the same data stream according to the message receiving order; the data message processing module 102 is configured to process the selected stored data message, and send the obtained storage location identifier of the processed data message to the data message transceiver module 101; the data message transceiver module 101 is further configured to, when the storage location identifier of the processed data message is located at the head end of the corresponding order-preserving queue, read the processed data message from the storage location corresponding to the storage location identifier, and send the processed data message out. In this way, the received data message is stored to the storage position corresponding to the storage position identifier allocated to the data message in the data message processing module 102 through the data message transceiver module 101 included in the data message processing system, the selected stored data message is processed through the data message processing module 102, and the data message can be output when the storage position identifier of the processed data message is positioned at the head end of the queue of the corresponding order-preserving queue; the stored messages are not required to be processed and output according to the storage sequence, so that the defect that in a certain CPU, the processing time of a certain message of a certain data stream is long, the messages positioned behind the message cannot be processed in time in the CPU, and in other CPUs, the messages which belong to the same data stream and are positioned behind the message and are processed cannot be output, and further the other messages positioned behind the processed message and are processed and finished cannot be output is avoided, the message processing delay is reduced, and the message processing efficiency is further improved.
In one embodiment, as shown in fig. 4, the data messaging module 101 includes a messaging transceiver 101a and a first register 101b; a first register 101b, configured to set a data location corresponding to an allocated storage location identifier to a first value, and set a data location corresponding to an unallocated storage location identifier to a second value; a message transceiver 101a, configured to select any one storage location identifier from storage location identifiers with corresponding data locations in the first register 101b being second values, and allocate the selected storage location identifier to the received data message; transmitting a first pulse signal carrying the selected storage location identification to the first register 101b; the first register 101b is further configured to set a data location corresponding to the selected storage location identifier to a first value according to the first pulse signal.
The message transceiver 101a refers to a device responsible for receiving and transmitting data messages. The first register 101b is referred to as an Occupy register, and includes a plurality of data bits (bits), where the number of bits is equal to the sum of the numbers of storage locations corresponding to all the data packet processing modules 102. For example, the number of bits of the first register 101 b=the number of cpus×the number of storage locations corresponding to each CPU.
The first register 101b is configured to record a situation that a storage location in the current data packet processing module 102 is occupied by a data packet, where the data bit included in the first register corresponds to a storage location identifier of the storage location in the data packet processing module 102 one by one. For example, referring to FIG. 3, the first register 101b includes 12 data bits corresponding to Entry 0, entry 1, entry 2, entry 3, entry 4, entry 5, entry 6, entry 7, entry 8, entry 9, entry 10, entry 11, respectively. The first register 101b is maintained in the data messaging module 101, set by hardware and reset by hardware.
The first register 101b is configured to set a value of a data bit corresponding to a storage location identifier of an allocated storage location in the data packet processing module 102 to a first value (e.g. 1), and set a value of a data bit corresponding to a storage location identifier of an unallocated storage location in the data packet processing module 102 to a second value (e.g. 0). For example, referring to fig. 3, in the first register 101b, the values of the data bits corresponding to the Entry 0, entry 1, entry 2, entry 4, entry 5, entry 7, entry 8, entry 10, and Entry 11 are all 1, and the values of the data bits corresponding to the Entry 3, entry 6, and Entry 9 are all 0. Note that, setting the value of the corresponding data bit in the first register 101b to the first value refers to the bit; setting the value of the corresponding data bit in the first register 101b to the second value is referred to as resetting.
The message transceiver 101a may randomly select a storage location identifier from the storage location identifiers with the values of the corresponding data bits in the first register 101b set to the second values, and allocate the storage location identifier to the received data message. For example, referring to fig. 3, in the first register 101b, if the values of the data bits corresponding to the Entry 3, the Entry 6, and the Entry 9 are all 0, one of the Entry 3, the Entry 6, and the Entry 9 may be randomly selected and allocated to the received data packet.
Specifically, in the data packet processing system as shown in fig. 4, the first register 101b sets the value of the data bit corresponding to the allocated storage location identifier in the data packet processing module 102 to a first value, and sets the value of the data bit corresponding to the unallocated storage location identifier in the data packet processing module 102 to a second value. Then, the message transceiver 101a selects any one storage location identifier from the storage location identifiers whose corresponding data bit values in the first register 101b are set to the second values, and allocates the selected storage location identifier to the received data message; a first pulse signal carrying the selected storage location identification is generated and sent to the first register 101b. The first register 101b sets the value of the data bit corresponding to the selected storage location identifier to be a first value according to the received first pulse signal, so as to indicate that the storage location identifier corresponding to the data bit is allocated to the received data packet, thereby avoiding repeated allocation.
In this embodiment, the allocation situation of the storage location in the data packet processing module 102 is recorded by using the first register 101b, so that the situation that the storage location in the data packet processing module 102 is occupied by the data packet can be accurately determined, and repeated allocation is avoided. Meanwhile, by using the message transceiver 101a, any one of the idle storage location identifiers is selected and allocated to the received data message, and the data message is not required to be stored according to a ring buffer mechanism, so that the data message is not required to be processed according to a storage sequence, and the message processing delay is further reduced.
In one embodiment, as shown in fig. 4, the packet transceiver 101a is further configured to identify a data flow identifier of the received data packet; and screening out the order-preserving queues corresponding to the data flow identifiers from the plurality of order-preserving queues to be used as the order-preserving queues corresponding to the data messages.
The data Flow identifier is identification information corresponding to the data Flow, and specifically refers to a Flow ID, such as Flow0, flow1, flow2, flow3, and the like. The received data message carries the data flow identification.
Specifically, in the data message processing system shown in fig. 4, the message transceiver 101a identifies the carried information of the received data message, and determines the data flow identifier carried by the received data message as the data flow identifier of the received data message; and screening out the order-preserving queues corresponding to the data flow identifiers of the received data messages from the plurality of order-preserving queues corresponding to the data flow identifiers as the order-preserving queues corresponding to the received data messages.
In this embodiment, by determining the order-preserving queue corresponding to the received data packet, it is beneficial to store the storage location identifier allocated to the received data packet to the end of the order-preserving queue corresponding to the data packet, so that it is convenient to determine whether the data packet can be output by querying the corresponding order-preserving queue after the packet processing is completed, and the data packet does not need to be output according to the storage location, thereby avoiding the defect that the processed packet cannot be normally output, and further improving the packet processing efficiency.
In one embodiment, as shown in fig. 4, the data packet processing system further includes a second register 103; a second register 103, configured to set a data location corresponding to the storage location identifier of the stored unprocessed data packet to a first value, and set a data location corresponding to the storage location identifier of the stored processed data packet to a second value; the message transceiver 101a is further configured to send a second pulse signal carrying a storage location identifier to the second register 103 when it is detected that the data message is successfully stored in a storage location corresponding to the storage location identifier in the data message processing module 102; the second register 103 is further configured to set a data location corresponding to the storage location identifier to a first value according to the second pulse signal.
The second register 103 refers to a Busy register, and includes a plurality of data bits (bits) equal to the sum of the numbers of storage locations corresponding to all the data message processing modules 102. For example, the number of bits=the number of cpus×the number of storage locations corresponding to each CPU of the second register 103.
The second register 103 is configured to record a processing condition of a data packet stored in a storage location in the current data packet processing module 102, where the data bit corresponds to a storage location identifier of the storage location in the data packet processing module 102 one by one. For example, with respect to FIG. 3, the second register 103 includes 12 data bits corresponding to Entry 0, entry 1, entry 2, entry 3, entry 4, entry 5, entry 6, entry 7, entry 8, entry 9, entry 10, entry 11, respectively. The second register 103 is maintained in the data message processing module 102, set by hardware and reset by software.
The second register 103 is configured to set a value of a data bit corresponding to a storage location identifier of an unprocessed data packet stored in the data packet processing module 102 to a first value (e.g. 1), and set a value of a data bit corresponding to a storage location identifier of a processed data packet stored in the data packet processing module 102 to a second value (e.g. 0). For example, referring to fig. 3, in the second register 103, if the data packet Flow 0packet 0 is already stored in the storage location corresponding to Entry 0 in the CPU0, the value of the data bit corresponding to Entry 0 is 1, which indicates that the data packet Flow 0packet 0 is already successfully stored in the corresponding storage location; if the data packet Flow 0packet 0 has been processed, the value of the data bit corresponding to Entry 0 is 0, indicating that the data packet Flow 0packet 0 has been successfully processed.
Specifically, in the data packet processing system as shown in fig. 4, the second register 103 sets the value of the data bit corresponding to the storage location identifier of the unprocessed data packet stored in the data packet processing module 102 to a first value, and sets the value of the data bit corresponding to the storage location identifier of the processed data packet stored in the data packet processing module 102 to a second value. Then, the message transceiver 101a detects in real time whether the received data message is successfully stored in a storage location corresponding to the storage location identifier in the data message processing module 102, if so, generates a second pulse signal carrying the storage location identifier, and sends the second pulse signal to the second register 103. The second register 103 sets the value of the data bit corresponding to the storage location identifier to a first value according to the received second pulse signal, so as to indicate that the received data message has been successfully stored in the corresponding storage location in the data message processing module 102, and the data message processing module 102 can process the received data message.
In this embodiment, the second register 103 is used to record the processing condition of the data packets stored in the storage location in the data packet processing module 102, so that it can accurately determine which data packets are successfully stored and successfully processed; in this way, the subsequent data message processing module 102 can quickly determine which data messages are processed by querying the second register 103, and does not need to process according to the storage sequence every time, thereby reducing the processing delay and further improving the message processing efficiency.
In one embodiment, as shown in fig. 4, the data packet processing system further includes a third register 104; a third register 104, configured to set a data location corresponding to the storage location identifier of the unsent processed data packet to a first value, and set a data location corresponding to the storage location identifier of the sent processed data packet to a second value; the data message processing module 102 is further configured to select a stored data message from a storage location corresponding to a storage location identifier with a data location corresponding to the first value in the second register 103, and process the selected stored data message to obtain a corresponding processed data message; transmitting a third pulse signal carrying the storage location identification of the processed data message to the second register 103, and transmitting a fourth pulse signal carrying the storage location identification of the processed data message to the third register 104; the second register 103 is further configured to set a data location corresponding to the storage location identifier of the processed data packet to a second value according to the third pulse signal; the third register 104 is further configured to set a data location corresponding to the storage location identifier of the processed data packet to a first value according to the fourth pulse signal.
The third register 104 is a Ready register, and includes a plurality of data bits (bits) equal to the sum of the numbers of storage locations corresponding to all the data message processing modules 102. For example, the number of bits of the third register 104=the number of cpus×the number of storage positions corresponding to each CPU.
The third register 104 is configured to record a transmission condition of the processed data packet stored in the storage location of the current data packet processing module 102, where the data bit included in the transmission condition corresponds to the storage location identifier of the storage location of the data packet processing module 102 one by one. For example, with respect to FIG. 3, the third register 104 includes 12 data bits corresponding to Entry 0, entry 1, entry 2, entry 3, entry 4, entry 5, entry 6, entry 7, entry 8, entry 9, entry 10, entry 11, respectively. The third register 104 is maintained in the data message processing module 102, set by software and reset by hardware.
The third register 104 is configured to set a value of a data bit corresponding to the storage location identifier of the processed data packet that is not transmitted in the data packet processing module 102 to a first value (for example, 1), and set a value of a data bit corresponding to the storage location identifier of the processed data packet that is transmitted in the data packet processing module 102 to a second value (for example, 0). For example, referring to fig. 3, in the third register 104, if the data packet Flow 0packet 0 has been successfully processed, but is not sent, the value of the data bit corresponding to Entry 0 is 1, which indicates that the data packet Flow 0packet 0 is in an outputtable state; if the data packet Flow 0packet 0 has been successfully processed and sent, the value of the data bit corresponding to Entry 0 is 0, indicating that the data packet Flow 0packet 0 has been successfully sent.
Specifically, in the data packet processing system as shown in fig. 4, the third register 104 sets the value of the data bit corresponding to the storage location identifier of the processed data packet that is not transmitted in the data packet processing module 102 to a first value, and sets the value of the data bit corresponding to the storage location identifier of the processed data packet that is transmitted in the data packet processing module 102 to a second value. Next, each data packet processing module 102 selects an associated storage location from the storage locations corresponding to the storage location identifiers with the values of the corresponding data bits in the second register 103 set as the first values, and selects a stored data packet of any one storage location from the associated storage locations for processing, so as to obtain a corresponding processed data packet; for example, with respect to fig. 3, cpu0 randomly selects one data packet from Flow 0packet 0, flow 1packet 0, and Flow 2packet 1 for processing; CPU1 randomly selects one data message from Flow 0packet 1, flow 2packet 0 and Flow 3packet 0 for processing; the CPU2 randomly selects one data packet from the Flow 1packet 1, the Flow 0packet 2, and the Flow 3packet 1 for processing. Then, if the data packet processing module 102 detects that the data packet is processed, it generates a third pulse signal and a fourth pulse signal carrying the storage location identifier of the processed data packet, and sends the third pulse signal to the second register 103 and the fourth pulse signal to the third register 104. Finally, the second register 103 sets the value of the data bit corresponding to the storage location identifier of the processed data packet to a second value (e.g. 0) according to the received third pulse signal, which indicates that the data packet is processed, and no reprocessing is required; the third register 104 sets the value of the data bit corresponding to the storage location identifier of the processed data packet to a first value (for example, 1) according to the received fourth pulse signal, which indicates that the data packet has been processed and is in an outputtable state.
In this embodiment, the third register 104 is used to record the sending condition of the processed data packets stored in the storage location in the data packet processing module 102, so as to accurately determine which data packets are in the outputtable state; in this way, the subsequent data message processing module 102 can quickly determine which data messages are in the outputtable state by querying the third register 104, and does not need to output according to the storage sequence every time, thereby avoiding the defect that the processed data messages cannot be output in time, reducing the processing delay and further improving the message processing efficiency.
In one embodiment, as shown in fig. 4, the message transceiver 101a is further configured to send a fifth pulse signal carrying a storage location identifier of the processed data message to the first register 101b and send a sixth pulse signal carrying a storage location identifier of the processed data message to the third register 104 when it is detected that the processed data message is successfully sent out; the first register 101b is further configured to set a data location corresponding to the storage location identifier to a second value according to the fifth pulse signal; the third register 104 is further configured to set the data location corresponding to the storage location identifier to the second value according to the sixth pulse signal.
Specifically, in the data packet processing system shown in fig. 4, the packet transceiver 101a detects in real time whether the processed data packet is successfully sent out, and if so, generates a fifth pulse signal and a sixth pulse signal carrying the storage location identifier of the processed data packet, sends the fifth pulse signal to the first register 101b, and sends the sixth pulse signal to the third register 104. Then, the first register 101b sets the value of the data bit corresponding to the storage location identifier to a second value (e.g., 0) according to the received fifth pulse signal, which indicates that the storage location identifier is in an idle state and can be allocated to the next received data packet. The third register 104 sets the value of the data bit corresponding to the storage location identifier to a second value (e.g., 0) according to the received sixth pulse signal, which indicates that the processed data packet stored in the storage location corresponding to the storage location identifier has been successfully sent.
In this embodiment, the message transceiver 101a detects whether the processed data message is successfully sent out in real time, and updates the values of the data bits corresponding to the first register 101b and the third register 104 in real time according to the detection situation, so that the idle storage location identifier is convenient to update in time, so that the data message processing module 102 can store and process a new data message, and the message processing efficiency is further improved.
In one embodiment, as shown in fig. 1, the data packet transceiver module 101 is further configured to delete the storage location identifier of the processed data packet from the order-preserving queue corresponding to the processed data packet when it is detected that the processed data packet is successfully sent.
The storage position identification of the processed data message is deleted from the order-preserving queue corresponding to the processed data message, so that the storage position identification of the head end of the corresponding order-preserving queue can be updated in time, and the method is beneficial to the timely output of the processed data message which belongs to the same data stream and is positioned behind the processed data message.
For example, assume that in the order-preserving queue corresponding to Flow 0, the storage location identifiers corresponding to the data messages Flow 0packet 0, flow 0packet 1, flow 0packet 2, and Flow 0packet 3 are sequentially stored, and if the data message Flow 0packet 0 has been successfully sent out, the storage location identifier corresponding to the data message Flow 0packet 0 is deleted from the order-preserving queue corresponding to Flow 0, so that in the updated order-preserving queue corresponding to Flow 0, the storage location identifier corresponding to the data message Flow 0packet 1 is located at the head end of the queue.
In this embodiment, when it is detected that the processed data packet is successfully sent out, the storage location identifier of the processed data packet is deleted from the order-preserving queue corresponding to the processed data packet, so that the purpose of updating the order-preserving queue is achieved, the processed data packet belonging to the same data stream and located behind the processed data packet can be timely output, and timely output of the processed data packet is ensured, thereby improving the packet processing efficiency.
In one embodiment, as shown in fig. 1, the data packet processing module 102 is further configured to process the selected stored data packet by using a thread corresponding to the selected stored data packet; under the condition that the waiting time of the thread in the message processing process is longer than the preset time, confirming that the thread meets the thread switching condition, and processing the next stored data message by using the thread corresponding to the next stored data message; the data message processing module 102 is further configured to process, when the waiting duration is over, a remaining portion of the selected stored data message by using a thread corresponding to the selected stored data message.
The thread is a flow of processing the data message in the data message processing module 102, such as a flow of processing the data message by the CPU. Moreover, each thread corresponds to a data message to be processed. The thread corresponding to the selected stored data message refers to the thread that processes the selected stored data message. The thread corresponding to the next stored data message refers to the thread that processes the next stored data message.
Wherein the next stored data message refers to a stored data message arbitrarily selected from among the stored data messages except the selected stored data message.
The meeting of the thread switching condition means that the current thread needs to wait for a relatively long time and other threads are to be processed.
The current thread needs to wait for a long time, namely, the current thread processing needs to wait for a certain condition to be met before processing can be continued; before this condition is met, the CPU will be in an idle state if the thread is not switched, and the condition is met requiring a longer wait. For example, when the CPU processes a message, it needs to access the coprocessor to perform a table look-up operation, and the table look-up operation needs to be t us (e.g. 1 us) to return a table look-up result. If the CPU is in an idle state during this tus, CPU power is wasted. Therefore, after the CPU sends out the table look-up instruction, the processing is switched to the next thread, and after the table look-up result is returned, the original thread is switched back; thus, CPU calculation power can be fully utilized. It should be noted that access delays for different coprocessors are predetermined, and software can determine which coprocessors are to be accessed with larger delays and consider switching threads.
Specifically, in the data packet processing system shown in fig. 1, each data packet processing module 102 is further configured to process the selected stored data packet by using a thread corresponding to the selected stored data packet, and identify a waiting duration of the thread in a packet processing process in real time. And if the waiting time of the thread in the message processing process is less than or equal to the preset time, and the thread is confirmed to not meet the thread switching condition, continuing to process the rest part of the selected stored data message by using the thread. And when the waiting time of the thread in the message processing process is recognized to be longer than the preset time, confirming that the thread meets the thread switching condition, selecting a thread corresponding to the next stored data message from other threads to be processed, and processing the next stored data message by utilizing the thread corresponding to the next stored data message. In addition, the data packet processing module 102 identifies that the waiting time of the thread corresponding to the selected stored data packet in the packet processing process is over, stops processing the next stored data packet by the thread corresponding to the next stored data packet, and processes the remaining part of the selected stored data packet by the thread corresponding to the selected stored data packet again.
In this embodiment, when it is identified that a waiting time of a thread corresponding to a selected stored data packet in a packet processing process is longer than a preset time, it is confirmed that the thread meets a thread switching condition, and then the thread corresponding to a next stored data packet is used to process the next stored data packet; under the condition that the waiting time is over, the thread corresponding to the selected stored data message is utilized again to process the rest part of the selected stored data message, so that the data message processing module 102 is prevented from being in an idle state, the processing resources of the data message processing module 102 can be effectively utilized, and the message processing efficiency is further improved.
In one embodiment, as shown in fig. 5, a data message processing method is provided, which can be applied to a data message processing system, and includes the following steps:
step S501, corresponding storage location identifiers are allocated to the received data packets.
Step S502, storing the storage position identification to the end of the queue of the order-preserving queue corresponding to the data message, and storing the data message to the storage position corresponding to the storage position identification.
Each order-preserving queue is used for storing the storage position identifiers of the data messages belonging to the same data flow according to the message receiving order.
Wherein, storing the data message to the storage location corresponding to the storage location identifier refers to storing the data message to the storage location corresponding to the storage location identifier in the data message processing module 102.
Step S503, processing the selected stored data message to obtain a processed data message.
The stored data message refers to a data message that has been successfully stored in a corresponding storage location in the data message processing module 102.
The selected stored data message refers to a stored data message arbitrarily selected by the data message processing module 102 from the stored data messages in the storage space.
Step S504, under the condition that the storage position identification of the processed data message is positioned at the head end of the corresponding order-preserving queue, the processed data message is read from the storage position corresponding to the storage position identification, and the processed data message is sent out.
Specifically, the data message processing system receives a data message, selects any one storage position identifier from idle storage position identifiers, and distributes the selected storage position identifier to the received data message; then, identifying the carried information of the received data message, and determining the data flow identifier carried by the received data message as the data flow identifier of the received data message; screening out order-preserving queues corresponding to the data flow identifiers of the received data messages from a plurality of order-preserving queues corresponding to the data flow identifiers, taking the order-preserving queues as the order-preserving queues corresponding to the received data messages, and storing the storage position identifiers to the tail ends of the order-preserving queues corresponding to the data messages; and simultaneously, storing the data message to a storage position corresponding to the storage position identifier. Then, selecting a stored data message from the storage position, and processing the data message to obtain a corresponding processed data message; inquiring a corresponding order-preserving queue according to the storage position identification of the processed data message, and reading the processed data message from the storage position corresponding to the storage position identification and sending the processed data message out under the condition that the storage position identification of the processed data message is positioned at the head end of the queue of the corresponding order-preserving queue.
It should be noted that, regarding the specific limitation of the above steps, reference may be made to the related embodiments of the data packet processing system of fig. 1 and fig. 4, which are not described herein again.
In the above data message processing method, the received data message is stored to a storage position corresponding to the storage position identifier allocated to the data message in the data message processing module 102 through the data message transceiver module 101 included in the data message processing system, the selected stored data message is processed through the data message processing module 102, and the data message can be output when the storage position identifier of the processed data message is located at the head end of the queue of the corresponding order-preserving queue; the stored messages are not required to be processed and output according to the storage sequence, so that the defect that in a certain CPU, the processing time of a certain message of a certain data stream is long, the messages positioned behind the message cannot be processed in time in the CPU, and in other CPUs, the messages which belong to the same data stream and are positioned behind the message and are processed cannot be output, and further the other messages positioned behind the processed message and are processed and finished cannot be output is avoided, the message processing delay is reduced, and the message processing efficiency is further improved.
In one embodiment, the data message processing method of the present application further includes the following: setting a data position corresponding to the allocated storage location identifier to a first value and a data position corresponding to the unallocated storage location identifier to a second value through the first register 101b; selecting any one storage location identifier from storage location identifiers with second values corresponding to data locations in the first register 101b, and distributing the selected storage location identifier to the received data message; transmitting a first pulse signal carrying the selected storage location identification to the first register 101b; the first register 101b sets the data position corresponding to the selected storage position identifier to the first value according to the first pulse signal.
In this embodiment, the allocation situation of the storage location in the data packet processing module 102 is recorded by using the first register 101b, so that the situation that the storage location in the data packet processing module 102 is occupied by the data packet can be accurately determined, and repeated allocation is avoided. Meanwhile, by using the message transceiver 101a, any one of the idle storage location identifiers is selected and allocated to the received data message, and the data message is not required to be stored according to a ring buffer mechanism, so that the data message is not required to be processed according to a storage sequence, and the message processing delay is further reduced.
In one embodiment, after the corresponding storage location identifier is allocated to the received data packet, the method further includes the following steps: identifying a data flow identifier of the received data message; and screening out the order-preserving queues corresponding to the data flow identifiers from the plurality of order-preserving queues to be used as the order-preserving queues corresponding to the data messages.
In this embodiment, by determining the order-preserving queue corresponding to the received data packet, it is beneficial to store the storage location identifier allocated to the received data packet to the end of the order-preserving queue corresponding to the data packet, so that it is convenient to determine whether the data packet can be output by querying the corresponding order-preserving queue after the packet processing is completed, and the data packet does not need to be output according to the storage location, thereby avoiding the defect that the processed packet cannot be normally output, and further improving the packet processing efficiency.
In one embodiment, the data message processing method of the present application further includes the following: setting a data position corresponding to the storage position identifier of the stored unprocessed data message as a first value and setting a data position corresponding to the storage position identifier of the stored processed data message as a second value through the second register 103; in case that successful storage of the data message to the storage position corresponding to the storage position identifier is detected, sending a second pulse signal carrying the storage position identifier to the second register 103; the data position corresponding to the storage position identification is set to the first value by the second register 103 according to the second pulse signal.
In this embodiment, the second register 103 is used to record the processing condition of the data packets stored in the storage location in the data packet processing module 102, so that it can accurately determine which data packets are successfully stored and successfully processed; in this way, the subsequent data message processing module 102 can quickly determine which data messages are processed by querying the second register 103, and does not need to process according to the storage sequence every time, thereby reducing the processing delay and further improving the message processing efficiency.
In one embodiment, the data message processing method of the present application further includes the following: setting a data position corresponding to the storage position identifier of the unsent processed data message as a first value and setting a data position corresponding to the storage position identifier of the sent processed data message as a second value through the third register 104; selecting a stored data message from a storage position corresponding to a storage position identifier with a corresponding data position of a first value in a second register to process the stored data message, so as to obtain a corresponding processed data message; transmitting a third pulse signal carrying the storage location identification of the processed data message to the second register 103, and transmitting a fourth pulse signal carrying the storage location identification of the processed data message to the third register 104; the data position corresponding to the storage position mark of the processed data message is set to be a second numerical value through a second register 103 according to the third pulse signal; the data location corresponding to the storage location identifier of the processed data packet is set to the first value by the third register 104 according to the fourth pulse signal.
In this embodiment, the third register 104 is used to record the sending condition of the processed data packets stored in the storage location in the data packet processing module 102, so as to accurately determine which data packets are in the outputtable state; in this way, the subsequent data message processing module 102 can quickly determine which data messages are in the outputtable state by querying the third register 104, and does not need to output according to the storage sequence every time, thereby avoiding the defect that the processed data messages cannot be output in time, reducing the processing delay and further improving the message processing efficiency.
In one embodiment, the data message processing method of the present application further includes the following: in case that the processed data message is detected to be successfully sent out, sending a fifth pulse signal carrying the storage location identifier of the processed data message to the first register 101b, and sending a sixth pulse signal carrying the storage location identifier of the processed data message to the third register 104; setting the data position corresponding to the storage position identifier to a second value according to the fifth pulse signal through the first register 101 b; the third register 104 sets the data position corresponding to the storage position identifier to the second value according to the sixth pulse signal.
In this embodiment, the message transceiver 101a detects whether the processed data message is successfully sent out in real time, and updates the values of the data bits corresponding to the first register 101b and the third register 104 in real time according to the detection situation, so that the idle storage location identifier is convenient to update in time, so that the data message processing module 102 can store and process a new data message, and the message processing efficiency is further improved.
In one embodiment, the data message processing method of the present application further includes the following: and deleting the storage position identification of the processed data message from the order-preserving queue corresponding to the processed data message under the condition that the processed data message is detected to be successfully sent out.
In this embodiment, when it is detected that the processed data packet is successfully sent out, the storage location identifier of the processed data packet is deleted from the order-preserving queue corresponding to the processed data packet, so that the purpose of updating the order-preserving queue is achieved, the processed data packet belonging to the same data stream and located behind the processed data packet can be timely output, and timely output of the processed data packet is ensured, thereby improving the packet processing efficiency.
In one embodiment, the data message processing method of the present application further includes: processing the selected stored data message by using a thread corresponding to the selected stored data message; under the condition that the waiting time of the thread in the message processing process is longer than the preset time, confirming that the thread meets the thread switching condition, and processing the next stored data message by using the thread corresponding to the next stored data message; and processing the rest part of the selected stored data message by using the thread corresponding to the selected stored data message under the condition that the waiting time period is over.
In this embodiment, when it is identified that a waiting time of a thread corresponding to a selected stored data packet in a packet processing process is longer than a preset time, it is confirmed that the thread meets a thread switching condition, and then the thread corresponding to a next stored data packet is used to process the next stored data packet; under the condition that the waiting time is over, the thread corresponding to the selected stored data message is utilized again to process the rest part of the selected stored data message, so that the data message processing module 102 is prevented from being in an idle state, the processing resources of the data message processing module 102 can be effectively utilized, and the message processing efficiency is further improved.
In an embodiment, in order to more clearly illustrate the data message processing method provided by the embodiment of the present application, a specific embodiment is used to specifically describe the data message processing method. In one embodiment, the present application also provides a bitmap (bitmap) -based data message processing method, which includes the following 3 features: (1) The data message can be arbitrarily placed in a reserved entry (storage interval) in the data storage space of the CPU, and one CPU can support a plurality of entries. (2) When the CPU processes the message, the message is not required to be processed according to the writing sequence, and the disorder processing of the message can be supported, namely, the message written later can be processed and completed earlier, and the processing depends on the behavior of software. (3) Setting a sequence-preserving queue table in the data transceiver, and recording the entry ID and sequence relation of the message when the message is read in; when the message processing is finished, the CPU cluster sends the entry ID of the processed message to the data transceiver; the data transceiver can search the current outputtable message according to the first packet entry ID of each flow in the order-preserving queue. The processed message can be output only when the flow first packet position of the order queue appears, and the message pointed by rptr (read pointer) can be output only without the need of the ring buffer mechanism.
The Bitmap mechanism mainly completes software and hardware interaction through 3 groups of registers, and the number of bits of each group of registers is equal to the number of data messages which need to be processed concurrently by the data message processing system. Wherein the 3 sets of registers function as follows. An Occupy register set: the CPU is used for recording the occupation condition of the entry of the current CPU by the data message, and is maintained in the data transceiver, and setting and resetting are completed by hardware. Busy register set: the method is used for recording the processing state of the current CPU on the message carried by the corresponding entry, maintaining the current CPU on the CPU side, setting the current CPU by hardware and resetting the current CPU by software. For example, the Busy register is used for recording that the message carried by the entry is completely stored in the internal storage space of the CPU by the hardware, and is set to 1 by the hardware, and the software determines whether the processing can be started by querying the value of the register; after the software finishes the message processing, the register is cleared, and the software is marked to finish the processing. Ready register set: the method is used for recording whether the message carried in the current entry is processed and is in an outputtable state; the CPU is maintained at the side of the CPU, is set by CPU software and is cleared by a completion signal of the data transceiver. For example, the Ready register is used for recording that the message carried by the entry is processed by the software, and can be output, and the software is set to be 1 after the processing is completed; after the data transceiver finishes the sending of the message, the corresponding bit of the register is cleared to 0 through a hardware signal.
Referring to fig. 6, the message processing at each time is as follows. Time T0: after receiving the message, the data transceiver distributes the message to the entry section of the designated CPU, and the hardware sets the corresponding ocupy register bit. Time T1: the message is transmitted to the data storage space of the CPU, the hardware sets the corresponding busy register bit, and the CPU starts to process the message; at this time, the CPU can process the effective message at will without processing according to the input sequence. Time T2: the CPU completes message processing (supports random out-of-order completion), the software resets the corresponding busy register bit, and simultaneously sets the ready register bit to inform the data transceiver of the entry state, and the latter judges whether the data transceiver can output according to the order-preserving queue. Time T3: reading data from the corresponding entry for the outputtable message, and sending the data out through a sending port; after completion, the occupy register bit is reset by hardware, while the ready register bit is reset by hardware. Where bit refers to a data bit in a register.
Fig. 7 provides a flow diagram of a method for processing a data message under a view angle of a receiving end of a message transceiver. Referring to fig. 7, the busy register=0 is initialized, i.e., the values of the respective data bits in the busy register are all set to 0; receiving a data message, and confirming the receiving address of the received data message through load distribution; the load distribution refers to which Entry of which CPU is allocated to a packet, and corresponds to different internal addresses, so that a fixed correspondence relationship can be formed. Then, DMA (Direct Memory Access) transfer is started, data is moved by DMA, a data message is stored in a corresponding storage location, and a corresponding busy bit=1 is refreshed, i.e. the value of the corresponding data bit in the busy register is set to 1. For example, the starting address is obtained in the last step, a DMA engine is configured, and the data message of the message channel is fetched through the DMA and written into the designated storage interval. Different processes are performed according to different CPU states, for example, in the case that the CPU is in wakeup state (wake state), any stored data message is selected by the CPU to be processed. Under the condition that the CPU is in the WFI (Wait for interrupt, waiting for the wake-up state), the CPU is waken, and any stored data message is selected for processing by the waken CPU. And keeping the previous processing state for the CPU which does not store the data message at the present time.
Fig. 8 provides a flow chart of a method for processing a data message under an originating view angle of a message transceiver. Referring to fig. 8, the ready register is initialized to = 0, i.e., the value of each data bit in the ready register is set to 0; inquiring the data bit of the ready register, if the value of the data bit of the ready register is 0, waiting for the CPU to process, and setting the value of the data bit corresponding to the ready register to be 1. If the data bit value of the ready register is not 0, judging whether order-preserving output is possible; the order-preserving output means that the order of the messages is built during input, and the list is checked during output, so as to judge whether the order requirement is met. And under the condition that order-preserving output is not possible, waiting for the CPU to finish processing, and setting the value of the data bit corresponding to the ready register to be 1. Under the condition that order output can be ensured, for example, when the completed data message is positioned at the first flow packet position, starting DMA transmission, reading the completed data message from the corresponding entry section, transmitting the completed data message to a data transceiver, sending the completed data message out through the data transceiver, and setting the value of the corresponding data bit of the occup register to 0 through a hardware signal; and sends a done signal (a signal that the data message is processed) to the ready register, and the value of the corresponding data bit is set to 0 through the ready register.
Fig. 9 provides a flow chart of a data message processing method under the CPU view angle. Referring to fig. 9, the busy register is polled, and if the value of the data bit in the busy register is all 0, it is determined whether there is no data bit in the busy register for a period of time is 1, if so, the control CPU enters a waiting wakeup state (WFI) and waits for an interrupt to wake; if not, processing the packet of the next busy bit=1, namely, selecting one data message arbitrarily from the data messages corresponding to the data bit with the value of 1 in the busy register as the data message to be processed next. Under the condition that the numerical value of the data bit in the busy register is not 0, processing the packet of the next busy bit=1, namely, randomly selecting one data message from the data messages corresponding to the data bit with the numerical value of 1 in the busy register as the next data message to be processed, and judging whether the current thread accords with the thread switching condition; the thread switching condition means that the current thread needs to wait for a relatively long time and other threads are waiting to be processed. And if the current thread meets the thread switching condition, re-entering the step of polling the busy register. If the current thread does not meet the thread switching condition, continuing to process the rest part of the current packet (data message) by using the current thread; after the current packet processing is completed, the value of the corresponding data bit of the busy register is set to 0, and the value of the corresponding data bit of the ready register is set to 1.
According to the bitmap-based data message processing method, the disordered storage and disordered processing of the messages are supported, and when the storage position identification of the processed data message is positioned at the head end of the corresponding order-preserving queue, the processed data message can be output, so that the use efficiency of a processor and the message processing efficiency are improved; the method and the device avoid the defects that in a certain CPU, the processing time of a certain message of a certain data stream is long, the message positioned behind the message in the CPU cannot be processed in time, and in other CPUs, the finished message positioned behind the message cannot be output, which is the same data stream, and further the other finished messages positioned behind the finished message cannot be output.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
In one embodiment, a computer device is provided, which may be a data center data processor chip (DPU) or a server configured with the data processor chip. The internal structure of the computer device may be as shown in fig. 10. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing data such as data messages. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a data message processing method.
It will be appreciated by those skilled in the art that the structure shown in FIG. 10 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In an embodiment, there is also provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
The user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (19)

1. A data message processing system, comprising: the data message receiving and transmitting module and the data message processing module are connected;
the data message receiving and transmitting module is used for distributing corresponding storage position identifiers to the received data messages; storing the storage position identification to the tail end of a sequence preserving queue corresponding to the data message, and storing the data message to a storage position corresponding to the storage position identification in the data message processing module; each order-preserving queue is used for storing the storage position identifiers of the data messages belonging to the same data stream according to the message receiving order;
The data message processing module is used for processing the selected stored data message and sending the storage position identification of the processed data message to the data message receiving and transmitting module;
the data message receiving and transmitting module is further configured to, when the storage location identifier of the processed data message is located at the head end of the corresponding order-preserving queue, read the processed data message from the storage location corresponding to the storage location identifier, and send the processed data message out.
2. The system of claim 1, wherein the data messaging module comprises a messaging transceiver and a first register;
the first register is configured to set a data location corresponding to the allocated storage location identifier as a first value, and set a data location corresponding to the unallocated storage location identifier as a second value;
the message transceiver is configured to select any one storage location identifier from storage location identifiers with second values corresponding to data locations in the first register, and allocate the selected storage location identifier to a received data message; transmitting a first pulse signal carrying the selected storage location identification to the first register;
The first register is further configured to set a data location corresponding to the selected storage location identifier to a first value according to the first pulse signal.
3. The system of claim 2, wherein the message transceiver is further configured to identify a data flow identification of the received data message; and screening out the order-preserving queues corresponding to the data flow identifiers from the plurality of order-preserving queues to be used as the order-preserving queues corresponding to the data messages.
4. The system of claim 2, wherein the system further comprises a second register;
the second register is configured to take a data location corresponding to a storage location identifier of the stored unprocessed data packet as a first value, and take a data location corresponding to a storage location identifier of the stored processed data packet as a second value;
the message transceiver is further configured to send a second pulse signal carrying the storage location identifier to the second register when it is detected that the data message is successfully stored in a storage location corresponding to the storage location identifier in the data message processing module;
The second register is further configured to set a data location corresponding to the storage location identifier to a first value according to the second pulse signal.
5. The system of claim 4, further comprising a third register;
the third register is configured to set a data location corresponding to the storage location identifier of the unsent processed data packet as a first value, and set a data location corresponding to the storage location identifier of the sent processed data packet as a second value;
the data message processing module is further configured to select a stored data message from a storage location corresponding to a storage location identifier with a data location corresponding to a first value in the second register, and process the stored data message to obtain a corresponding processed data message; transmitting a third pulse signal carrying the storage position identification of the processed data message to the second register, and transmitting a fourth pulse signal carrying the storage position identification of the processed data message to the third register;
the second register is further configured to set a data location corresponding to the storage location identifier of the processed data packet to a second value according to the third pulse signal;
And the third register is further configured to set a data location corresponding to the storage location identifier of the processed data packet to a first value according to the fourth pulse signal.
6. The system of claim 5, wherein the message transceiver is further configured to send a fifth pulse signal carrying a storage location identification of the processed data message to the first register and a sixth pulse signal carrying a storage location identification of the processed data message to the third register if successful sending of the processed data message is detected;
the first register is further configured to set a data location corresponding to the storage location identifier to a second value according to the fifth pulse signal;
and the third register is further configured to set a data location corresponding to the storage location identifier to a second value according to the sixth pulse signal.
7. The system of claim 1, wherein the data message transceiver module is further configured to delete a storage location identifier of the processed data message from an order-preserving queue corresponding to the processed data message if successful sending of the processed data message is detected.
8. The system of claim 1, wherein the data message processing module is further configured to process the selected stored data message using a thread corresponding to the selected stored data message; when the waiting time of the thread in the message processing process is recognized to be longer than the preset time, confirming that the thread meets the thread switching condition, and processing the next stored data message by using the thread corresponding to the next stored data message;
and the data message processing module is further used for processing the rest part of the selected stored data message by utilizing a thread corresponding to the selected stored data message under the condition that the waiting time period is over.
9. A method for processing a data message, the method comprising:
distributing corresponding storage position identifiers to the received data messages;
storing the storage position identification to the tail end of a sequence preserving queue corresponding to the data message, and storing the data message to a storage position corresponding to the storage position identification; each order-preserving queue is used for storing the storage position identifiers of the data messages belonging to the same data stream according to the message receiving order;
Processing the selected stored data message to obtain a processed data message;
and under the condition that the storage position identifier of the processed data message is positioned at the head end of the queue of the corresponding order-preserving queue, reading the processed data message from the storage position corresponding to the storage position identifier, and sending the processed data message out.
10. The method according to claim 9, wherein the method further comprises:
the data position corresponding to the allocated storage position identifier is set to be a first numerical value through a first register, and the data position corresponding to the unallocated storage position identifier is set to be a second numerical value;
selecting any one storage position identifier from storage position identifiers with second values corresponding to data positions in the first register, and distributing the selected storage position identifier to a received data message; transmitting a first pulse signal carrying the selected storage location identification to the first register;
and setting the data position corresponding to the selected storage position identifier as a first numerical value through the first register according to the first pulse signal.
11. The method of claim 10, further comprising, after assigning the corresponding storage location identifier to the received data message:
Identifying a data flow identifier of the received data message; and screening out the order-preserving queues corresponding to the data flow identifiers from the plurality of order-preserving queues to be used as the order-preserving queues corresponding to the data messages.
12. The method according to claim 10, wherein the method further comprises:
the data position corresponding to the storage position identification of the stored unprocessed data message is taken as a first numerical value through a second register, and the data position corresponding to the storage position identification of the stored processed data message is taken as a second numerical value;
under the condition that the data message is detected to be successfully stored in a storage position corresponding to the storage position identifier, a second pulse signal carrying the storage position identifier is sent to the second register;
and setting the data position corresponding to the storage position identifier as a first numerical value through the second register according to the second pulse signal.
13. The method according to claim 12, wherein the method further comprises:
the data position corresponding to the storage position identification of the non-transmitted processed data message is taken as a first numerical value through a third register, and the data position corresponding to the storage position identification of the transmitted processed data message is taken as a second numerical value;
Selecting a stored data message from a storage position corresponding to a storage position identifier with a corresponding data position of a first value in the second register to process the stored data message, so as to obtain a corresponding processed data message; transmitting a third pulse signal carrying the storage position identification of the processed data message to the second register, and transmitting a fourth pulse signal carrying the storage position identification of the processed data message to the third register;
the data position corresponding to the storage position identification of the processed data message is set to be a second numerical value through the second register according to the third pulse signal;
and the data position corresponding to the storage position identification of the processed data message is a first numerical value through the third register according to the fourth pulse signal.
14. The method of claim 13, wherein the method further comprises:
under the condition that the processed data message is successfully sent out, sending a fifth pulse signal carrying the storage position identification of the processed data message to the first register, and sending a sixth pulse signal carrying the storage position identification of the processed data message to the third register;
The data position corresponding to the storage position identification is set to be a second numerical value through the first register according to the fifth pulse signal;
and the third register is used for setting the data position corresponding to the storage position identification as a second numerical value according to the sixth pulse signal.
15. The method according to claim 9, wherein the method further comprises:
and deleting the storage position identification of the processed data message from the order-preserving queue corresponding to the processed data message under the condition that the processed data message is detected to be successfully sent out.
16. The method according to claim 9, wherein the method further comprises:
processing the selected stored data message by using a thread corresponding to the selected stored data message; when the waiting time of the thread in the message processing process is recognized to be longer than the preset time, confirming that the thread meets the thread switching condition, and processing the next stored data message by using the thread corresponding to the next stored data message;
and under the condition that the waiting time is over, processing the rest part of the selected stored data message by utilizing a thread corresponding to the selected stored data message.
17. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 9 to 16 when the computer program is executed.
18. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 9 to 16.
19. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the method of any of claims 9 to 16.
CN202210444766.3A 2022-04-26 2022-04-26 Data message processing system, method, computer device and storage medium Pending CN116996449A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210444766.3A CN116996449A (en) 2022-04-26 2022-04-26 Data message processing system, method, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210444766.3A CN116996449A (en) 2022-04-26 2022-04-26 Data message processing system, method, computer device and storage medium

Publications (1)

Publication Number Publication Date
CN116996449A true CN116996449A (en) 2023-11-03

Family

ID=88528952

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210444766.3A Pending CN116996449A (en) 2022-04-26 2022-04-26 Data message processing system, method, computer device and storage medium

Country Status (1)

Country Link
CN (1) CN116996449A (en)

Similar Documents

Publication Publication Date Title
US7337275B2 (en) Free list and ring data structure management
US5535361A (en) Cache block replacement scheme based on directory control bit set/reset and hit/miss basis in a multiheading multiprocessor environment
CN109388590B (en) Dynamic cache block management method and device for improving multichannel DMA (direct memory access) access performance
US20090037689A1 (en) Optimal Use of Buffer Space by a Storage Controller Which Writes Retrieved Data Directly to a Memory
CN110858162B (en) Memory management method and device and server
CN110555001B (en) Data processing method, device, terminal and medium
US20120331187A1 (en) Bandwidth control for a direct memory access unit within a data processing system
US20090070560A1 (en) Method and Apparatus for Accelerating the Access of a Multi-Core System to Critical Resources
KR100895536B1 (en) Data transfer mechanism
CN113918101A (en) Method, system, equipment and storage medium for writing data cache
CN111949568A (en) Message processing method and device and network chip
US20240143392A1 (en) Task scheduling method, chip, and electronic device
WO2024082747A1 (en) Router having cache, routing and switching network system, chip, and routing method
WO2024016617A1 (en) Cache management method, apparatus and system, and device and medium
CN115048142A (en) Cache access command processing system, method, device, equipment and storage medium
CN112506823A (en) FPGA data reading and writing method, device, equipment and readable storage medium
JPH05274252A (en) Transaction execution method for computer system
CN116955247B (en) Cache descriptor management device and method, medium and chip thereof
CN106201918A (en) A kind of method and system quickly discharged based on big data quantity and extensive caching
CN106537321B (en) Method, device and storage system for accessing file
CN111221773A (en) Data storage architecture method based on RMDA high-speed network and skip list
CN116996449A (en) Data message processing system, method, computer device and storage medium
CN111416858A (en) Media resource processing platform, method, device and server
US9811403B1 (en) Method, apparatus and system for performing matching operations in a computing system
CN114063923A (en) Data reading method and device, processor and electronic equipment

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