Message processing method and system for large-data-volume serial communication, computer equipment, storage medium and program product

By adopting resource reuse queue and priority detection mechanism in serial communication, the problem of low storage resource utilization is solved, and efficient message processing and fast response of priority messages are achieved.

CN120750877APending Publication Date: 2025-10-03NANJING GUODIAN NANZI WEIMEIDE AUTOMATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511027801.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-24
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

The existing serial communication master station processing module has low storage resource utilization when processing large data volume messages. Conventional methods lead to waste of vacant space at the front end of the queue, affecting the effective use of resources.

Method used

The resource reuse queue and priority detection mechanism are adopted to fill the free space at the top of the queue with messages in order of reception time and priority, and high-priority messages are processed first during the processing process, thus reducing the use of storage resources.

Benefits of technology

It improves the utilization of storage resources, ensures that high-priority messages can be processed in a timely manner, and improves the efficiency of serial communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120750877A_ABST
    Figure CN120750877A_ABST
Patent Text Reader

Abstract

The invention provides a message processing method and system for large-data-volume serial communication, computer equipment, a storage medium and a program product. The method comprises the following steps: acquiring a plurality of sending messages and / or reply messages received by a master station; filling the plurality of sending messages and / or reply messages into the free space of the target queue in sequence according to the sequence of the master station receiving time and the target queue address; wherein the sending message or the reply message at the current moment is filled into the free space of which the address is closest to the top end of the target queue; and traversing and processing all sending messages and reply messages in the master station to complete serial communication. According to the invention, after the master station processes the target message, the storage space of the target message is in the idle state, and the master station fills the newly received sending message or reply message into the idle space of which the address is closest to the top end of the target queue, so that the storage resource space required by using the queue in the message processing process is effectively reduced, and the utilization rate of the storage resource space is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of communication technology, and in particular relates to a message processing method, system, computer equipment, storage medium and program product for large-scale serial communication. Background Art

[0002] Serial communication refers to a communication mode in which data is transmitted bit by bit, requiring at least two transmission lines. Serial communication is widely used in fields such as industrial control due to its simplicity and long transmission distance. Conventional serial communication mostly uses half-duplex communication mode and is limited by the baud rate, resulting in relatively slow transmission speeds. Transmitting large amounts of data across multiple channels requires extensive data storage resources.

[0003] like Figure 1 The figure below shows a typical configuration for implementing serial port transceivers in the industrial control field. The host software sends a queue of data request messages (i.e., send messages) to the serial communication master processing module (referred to as the master) (e.g., a PLC, DCS board, etc.). The request message queue contains large data request messages for multiple serial communication channels. The serial communication master processing module receives and stores the data request message queue sent by the host software, parses the data request message queue, and then sends different request messages to the corresponding serial communication channel and to the different slaves connected to that channel. Simultaneously, the serial communication master processing module receives palindromes (i.e., reply messages) from the numerous slaves on each serial communication channel, stores these palindromes, organizes them into a queue, and sends them back to the host software.

[0004] The existing serial communication master station processing module usually uses a microprocessor MCU chip to process the message. Compared with the high-performance CPU processor host on the computer side, the storage resources of the microprocessor MCU chip are relatively small, so it is more important to improve the utilization of storage resources. In conventional serial communication methods, a sequential data request message queue is usually used to implement serial communication, such as Figure 2 As shown in the figure, the sequential data request message queue allocates two memory blocks, one for sending messages to slaves and one for receiving messages. When a certain number of messages need to be sent, the queue allocates memory blocks based on the maximum number of messages to be sent and arranges the storage addresses according to the order in which the messages are sent. This method is easy to use, but as messages are sent and received, the corresponding address space becomes vacant as the messages at the front of the queue complete their transmission and reception tasks. Subsequent messages still need to use the space at the back of the queue for storage and reception, which wastes resources and is not conducive to improving resource utilization. Summary of the Invention

[0005] The present invention provides a message processing method, system, computer equipment, storage medium and program product for large-volume serial communication, so as to save message storage space and improve the utilization rate of message storage space.

[0006] In a first aspect, the present invention provides a method for processing messages in large-scale serial communication, comprising: Obtain multiple send messages and / or reply messages received by the master station; Fill multiple send messages and / or reply messages into the free space of the target queue in the order of the master station's reception time and the target queue address; among them, the send message or reply message at the current moment is filled into the free space with the address closest to the top of the target queue; Traverse and process all send messages and reply messages in the master station to complete serial communication.

[0007] Optionally, the first aspect further includes: The target byte of each sent message or reply message is used as the function code of the message to determine the priority of the sent message or reply message according to the function code; Scan the function code of the message in each space of the target queue every target time; Determine whether there is a function code with the highest priority at the current moment; If it exists, the scan is stopped, and after the current send message or reply message is processed, the send message or reply message corresponding to the function code with the highest priority is processed; If it does not exist, after the current sending message or reply message is processed, the sending message or reply message is processed according to the priority.

[0008] Optionally, the step of sequentially filling the plurality of sent messages and / or reply messages into the free space of the target queue according to the order of the master station reception time and the target queue address; wherein the sent message or reply message at the current moment is filled into the free space of the address closest to the top of the target queue, includes: When the master station processes any send message or reply message, it fills the m'+1th send message or reply message into the free space closest to the top of the target queue; where m' is the total number of send messages and reply messages in the master station when the master station processes any send message or reply message.

[0009] In a second aspect, the present invention provides a message processing system for large-scale serial communication, comprising: An acquisition module, used to acquire multiple sent messages and / or reply messages received by the master station; A sorting module is used to fill multiple sent messages and / or reply messages into the free space of the target queue in the order of the master station reception time and the target queue address; wherein, the sent message or reply message at the current moment is filled into the free space with the address closest to the top of the target queue; The traversal module is used to traverse and process all send messages and reply messages in the master station to complete serial communication.

[0010] Optionally, the second aspect further includes: A first determining module is configured to use the target byte of each sent message or reply message as a function code of the message, so as to determine the priority of the sent message or reply message according to the function code; Scanning module, used to scan the function code of the message in each space of the target queue every target time; A judgment module is used to judge whether there is a function code with the highest priority at the current moment; The second determining module is used for determining to stop scanning when the judging module determines that there is a function code with the highest priority at the current moment, and processing the sending message or reply message corresponding to the function code with the highest priority after the sending message or reply message at the current moment is processed; The third determining module is used to determine that if the judging module determines that the function code with the highest priority does not exist at the current moment, after the sending message or reply message at the current moment is processed, process the sending message or reply message according to the priority.

[0011] Optionally, the sorting module includes: The sorting unit is used to fill the m'+1th send message or reply message into the free space of the address closest to the top of the target queue when the master station processes any send message or reply message; where m' is the total number of send messages and reply messages in the master station when the master station processes any send message or reply message.

[0012] In a third aspect, the present invention provides a computer device comprising a processor and a memory; wherein, when the processor executes a computer program stored in the memory, the steps of the message processing method for large-scale serial communication described in the first aspect are implemented.

[0013] In a fourth aspect, the present invention provides a computer-readable storage medium for storing a computer program; when the computer program is executed by a processor, the steps of the message processing method for large-scale serial communication described in the first aspect are implemented.

[0014] In a fifth aspect, the present invention provides a computer program product comprising computer executable instructions or a computer program, which, when executed by a processor, implements the steps of the message processing method for large-scale serial communication of data as described in the first aspect.

[0015] The present invention provides a message processing method, system, computer equipment, storage medium and program product for large-scale serial communication. In the method, after a master station processes a target message, the storage space of the target message is in an idle state. The master station fills the newly received send message or reply message into the idle space of the address closest to the top of the target queue, effectively reducing the storage resource space required for the queue during message processing and improving the utilization rate of the storage resource space. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0017] Figure 1 A schematic diagram of the basic structure of serial communication message processing provided by an embodiment of the present invention; Figure 2 A schematic diagram of the basic structure of a traditional queue provided in an embodiment of the present invention; Figure 3 A schematic flow chart of a method for processing messages in large-scale serial communications provided by an embodiment of the present invention; Figure 4 A schematic diagram of the basic framework of a resource reuse queue provided in an embodiment of the present invention; Figure 5 A schematic diagram of a flow chart of a resource reuse queue top insertion mechanism provided by an embodiment of the present invention; Figure 6 A schematic diagram of a flow chart of a resource reuse queue insertion mechanism provided by an embodiment of the present invention; Figure 7 A schematic diagram of the queue message receiving and sending process of the resource reuse queue provided in an embodiment of the present invention; Figure 8 A schematic diagram of the process flow of the absolute priority scanning mechanism provided by an embodiment of the present invention; Figure 9 A schematic diagram of a process flow of a relative priority scanning mechanism provided by an embodiment of the present invention; Figure 10 A schematic diagram of the overall process of resource reuse queues in conjunction with absolute priority scanning provided by an embodiment of the present invention; Figure 11 A schematic diagram of the overall process of resource reuse queues in conjunction with relative priority scanning provided by an embodiment of the present invention; Figure 12 A schematic structural diagram of a message processing system for large-scale serial communication provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0018] The following will provide a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0019] like Figure 4 As shown, Figure 4 This is a basic framework diagram of the designed resource reuse queue. The queue combines the request message array sent by the upper software to each serial communication channel and the reply message array sent back to the upper software by many slave stations of each serial communication channel into one queue, completing the related operations of message sending and message reply.

[0020] Example 1

[0021] like Figure 3 As shown, an embodiment of the present invention provides a message processing method for large-scale serial communication, including: Step 101: Acquire multiple send messages and / or reply messages received by the master station.

[0022] According to the number of messages n that need to be processed and the existing resources sent by the upper software, a queue is set up, and the length of the message queue is set to S. The addresses of each message are S1, S2, ..., S n .

[0023] like Figure 5 As shown in the figure, when the message interactive serial communication starts, the upper software first sends m messages to the microprocessor MCU (i.e., the master station) in the serial communication master station processing module. At this time, the queue cache pointer of the first message sent (send message) points to S1, and the first send message is stored at address S1. If the microprocessor MCU has not started processing the message at this time, the pointers of the m messages are placed in the order of the queue addresses, namely S1, S2, ..., S m .

[0024] Step 102, multiple send messages and / or reply messages are filled into the free space of the target queue in sequence according to the order of the master station reception time and the target queue address; among them, the send message or reply message at the current moment is filled into the free space with the address closest to the top of the target queue.

[0025] This step includes filling the m'+1th sent message or reply message into the free space closest to the top of the target queue when the master station processes any sent message or reply message; where m' is the total number of sent messages and reply messages in the master station when the master station processes any sent message or reply message.

[0026] First, implement message insertion in the resource reuse mode queue: the upper software starts to send several messages to the microprocessor MCU in the serial communication master station processing module. The address pointer corresponding to the first message sent points to the top of the queue, and subsequent messages are filled into the queue space in address order; when the microprocessor MCU starts to process the message, it first takes out the message at the top of the queue for processing and sends it to the slave station. At this time, the address space at the top of the queue is vacant, and the next message sent by the upper software will point to the free space address at the front of the queue. If there is no vacant space at the front of the queue, the messages will be placed in the address space at the end of the queue.

[0027] The microprocessor MCU sequentially removes messages from the queue, processes them, and sends them to the slave station, based on the order in which the messages sent by the upper-level software are stored. Each new message sent by the upper-level software is stored at the topmost address in the queue's free space, depending on the queue's free space status. During the process of the microprocessor MCU in the serial communication master station processing module completing the transmission and reception of multiple messages, if the middle address space in the queue becomes free, the microprocessor MCU will fill the newly sent message from the upper-level software into the address at the front of the free space in the current queue. If there is no free space at the front of the queue, the message will be placed at the end of the queue.

[0028] When the microprocessor MCU completes processing a message and sends it, it locates the address of the message. Accordingly, the address space corresponding to the message becomes free. According to the above-mentioned interleaving method, this space corresponds to the top position of the queue's free space. The microprocessor MCU then updates the pointer of this address as the pointer to the top of the free queue. The storage address pointer of the next message to be processed then points to this free address.

[0029] After the microprocessor (MCU) in the serial communication master's processing module sends the processed (transmitted) message to the slave, the slave begins processing (transmitting) the message and compiling a reply message, which is then uploaded to the host software. The MCU then stores the reply message at the top of the queue's free addresses, waiting for the MCU to retrieve it for processing. Because the slave's reply message and the host software's outgoing messages use the same queue, they both share a common storage pointer pointing to the queue address.

[0030] For example, suppose that the upper software processes 1 message after sending m messages. At this time, the cache queues of the 1st to mth messages point to addresses S1, S2, ..., S m ; Then the pointer of the microprocessor MCU processing the message points to address S1. After the microprocessor MCU takes the message at address S1 for processing, the microprocessor MCU will locate the storage pointer of the m+1th message sent by the upper software to address S1, and the pointer of the next message to be processed will point to address S2. If the MCU has not processed the message at address S2 at this time, the cache pointer of the m+2th message sent by the upper software will point to address S m+1 .

[0031] like Figure 6 As shown in the figure, as the message sending and processing proceeds, it is assumed that at a certain moment the upper software has sent n messages, and the microprocessor MCU starts to process m (n>m+8) messages at the same time. At this time, the message order of the top queue is that address S1 stores the m+4th message, address S2 stores the m+2th message, address S3 stores the n-1th message, address S4 is vacant, address S5 is vacant, and address S6 stores the m+8th message. At this time, the upper software sends the n+1th and n+2th messages again, and the storage pointers of these two messages (n+1th and n+2th messages) point to addresses S4 and S5 respectively.

[0032] like Figure 7 As shown in the figure, if the upper software starts serial communication between the master station and the slave station after processing the message, and the microprocessor MCU starts processing the message after sending m messages, then the queue addresses corresponding to the first m messages sent are S1, S2, ..., S m At this time, the microprocessor MCU starts to process the message. If the microprocessor MCU processes m1 (m1≤m) messages at this time, it will take away the addresses S1, S2, ..., S in order. m1 If the message is sent, then these storage addresses (S1, S2, ..., S m1 ) enters the idle state. At this time, the upper software continues to send messages from m+1 to m2 (m≤m2), then the storage pointer of the m+1 message points to address S1. If the slave station starts to reply m3 messages during this period, the storage pointer of the first message replied by the slave station points to address S2. At this time, according to the order in which the upper software sends messages and the slave station replies to messages, the idle addresses at the top of the queue are filled in sequence. Assuming that the upper software sends a message, the microprocessor MCU takes a message, and the slave station replies a message, then the m+2 message is stored at address S3; the slave station replies to the second message and stores it at address S4; the microprocessor MCU takes the m1+1 message for processing, and so on, completing all message sending and receiving work.

[0033] Step 103: traverse and process all the sending messages and reply messages in the master station to complete the serial communication.

[0034] Because the data request message queue sent by the upper-level software may contain multiple message types, in actual applications, messages may have different importance or priorities based on their functions. Messages with higher importance or priority are expected to be executed earlier in the queue. When a typical queue processes messages, it must process them in the order in which they were stored. In situations such as when a slave is offline and does not respond to messages, some messages may be processed relatively slowly, and several lower-priority messages may accumulate at the front of the queue. At this time, newly sent high-priority messages often have to wait a long time before being processed, which is not conducive to real-time response to high-importance, high-priority serial communication messages.

[0035] Therefore, the message processing method for large-scale serial communication provided by this embodiment also includes: The target byte of each sent message or reply message is used as the function code of the message, so as to determine the priority of the sent message or reply message according to the function code.

[0036] Scan the function code of the message in each space of the target queue at target intervals.

[0037] Determine whether there is a function code with the highest priority at the current moment.

[0038] If it exists, the scanning is stopped, and after the sending message or reply message at the current moment is processed, the sending message or reply message corresponding to the function code with the highest priority is processed.

[0039] If it does not exist, after the current sending message or reply message is processed, the sending message or reply message is processed according to the priority.

[0040] A message can have many bytes, for example, the message 01 03 27 1C 00 03 ce b9, where the first byte 01 is the slave address and the second byte 03 is the function code, which means reading the register value; if the message 01 10………… comes at this time, where 10 is the function code, which means writing a value to the register, the value of the second byte function code can be detected in the program. If the priority of 10 is set higher than 03 in the priority, the order can be adjusted according to the function code.

[0041] Confirm that a certain byte in the message is the function code of the message, determine the priority according to the message function code, set the message with the highest function code priority as the absolute priority message, and then confirm several messages with the second highest priority as relative priority messages based on the requirements of the message type, and confirm the overall order of the priority according to the message function code.

[0042] During normal serial communication between the master and slave stations, the microprocessor MCU in the serial communication master station processing module scans the queue once every certain period (such as 2 seconds), scanning only the function code byte in each space to confirm the priority of the message stored in that space. During the scanning process, if the message is detected as a message with the set absolute priority, the microprocessor MCU immediately stops the priority scanning process, locates the storage address of the absolute priority message, and confirms that the pointer of the next message to be processed by the microprocessor MCU points to the address of the absolute priority message, ensuring that the message is processed as soon as possible.

[0043] During the message sending and receiving process, the microprocessor MCU scans the queue once every 2 seconds. If it is detected that the message is a set relative priority message, the relative priority message is located, but the microprocessor MCU continues the priority scanning process. If it is detected that there is no higher priority message in the subsequent messages, it is confirmed that the pointer of the next message to be processed by the microprocessor MCU points to the address of the relative priority message; if it is detected that there is a higher priority relative priority message subsequently, the pointer for processing the next message is located at the address of the message with higher priority; if it is detected that there is an absolute priority message subsequently, the scanning is stopped at the absolute priority message, and the pointer for processing the next message is located at the absolute priority message address.

[0044] For example, assume that serial communication uses P types of function code messages, and set these P types of messages to M1, M2, M3, ..., M4, M5, M6, M7, M8, M9, M10, M11, M12, M13, M14, M15, M16, M17, M18, M19, M20, M21, M22, M33, M44, M55, M66, M77, M88 P , where M1 is defined as the absolute priority message, M2, M3, ..., M a Relative priority message.

[0045] like Figure 8 As shown, it is assumed that the microprocessor MCU starts to perform priority scanning every 2 seconds. The microprocessor MCU scans from address S1 in the order of addresses. Each address space only scans the bytes corresponding to the function code. If the address S is scanned, m If an absolute priority message of type M1 is found, the scan stops and the message processing pointer points to address S m .

[0046] like Figure 9 As shown, it is assumed that the microprocessor MCU starts to perform priority scanning every 2 seconds. The microprocessor MCU starts scanning from address S1 according to the address sequence. If the address S is scanned, m When the message type is M3, the relative priority message is found. At this time, the address is located first, but the microprocessor MCU continues to scan according to the address queue. If the address S is scanned m+3 When the absolute priority message of M1 is found, the microprocessor MCU stops the queue scan and positions the message pointer to address Sm+3 At this point, the M1 message is preferentially processed; if the address is S m After scanning, it scans to the address S m+3 At this point, a relative priority message of M2 is found. Since the priority of M2 is higher than that of M3, the processing message pointer is positioned at the address S m+3 At this point, but the microprocessor MCU still continues to scan the queue. If there is no message with a higher priority later, the pointer remains unchanged.

[0047] The resource reuse queue cooperates with the message priority detection to achieve the serial communication message sending and receiving between the master and slave stations: Suppose within t seconds, as Figure 10 shown, it is necessary to complete the sending and receiving of p2 messages for p1 slave stations. According to the above resource reuse queue, the microprocessor MCU stores the pointer of the sent message starting from the address S1. Suppose the upper software sends m (m = 1, 2, 3,..., p2) messages and then starts to process the first message. Then the cache queue pointers of the m messages respectively point to the addresses S1, S2,..., S m , at this time the microprocessor MCU starts to process the message at the address S1. Suppose after the microprocessor MCU processes m1 messages, the upper software continues to send messages. Then the free space addresses at this time are S1, S2,..., S m1 , at this time the upper software continues to send m2 (m2 < m1) messages. The message storage address pointer first points to the address S1 and continues to fill in the messages in the order of the free space addresses. Suppose the serial communication situation during this period is: the slave station replies with one message, the upper software sends one message, and the microprocessor MCU processes one message. Then the current message storage situation should be the messages stored at the storage addresses S1 and S2, and the message at the address S m1+1 is taken away, the messages stored at the storage addresses S3 and S4, and the message at the address S m1+2 is taken away, and so on, and it is stored until the address S 2m2 .

[0048] As Figure 10 shown, suppose the priority detection starts at this time. The upper software starts scanning from the address S1. If it detects that there is an absolute priority message at the address S m3 (m3 < m1), the scanning stops, and the next processing pointer of the message points to the address S m3 . After the absolute priority message is processed, the space at the address S m3 is free. If the position of the address S m3 is the front end of the current queue free address, then the next message storage pointer points to the address S m3 . If the position of S 2m2+1 is at the front end of the free address, then the next message storage address still points to S 2m2+1 .

[0049] As Figure 11As shown, assuming that the priority detection starts at this time, the upper software starts scanning from address S1. If address S m5 If there is a relative priority message M3, the next processing pointer of the message is first pointed to address S m5 At this time, the upper software continues to scan the queue priority. If there is no higher priority message, the next processing pointer of the message will point to address S m5 ; If the address S is found later m6 If there is an absolute priority message, the microprocessor MCU stops detecting and points the next processing pointer of the message to address S m6 ; If address S is found m7 If there is a relative priority message M2, the next message processing pointer points to address S m7 , and the microprocessor MCU continues to scan according to the corresponding mechanism.

[0050] In summary, this embodiment provides a message processing method for large-scale serial communication. In view of the limited storage resources of the microprocessor MCU chip on the serial communication master station processing module, it effectively reduces the storage resource space required for the queue during message processing and improves the storage resource utilization of the MCU chip; a message priority detection method is set up to find higher-priority messages in the queue more quickly and complete high-priority message processing; combined with resource reuse queues and priority detection, effective serial communication of multi-channel large-scale messages is realized.

[0051] Example 2

[0052] Based on the same inventive concept as Example 1, this embodiment provides a message processing system for large-scale serial communication. Since the principle of solving the problem of this system is similar to the aforementioned message processing method for large-scale serial communication, the implementation of this system can refer to the implementation of the message processing method for large-scale serial communication.

[0053] like Figure 12 As shown, the message processing system for large-scale serial communication includes: The acquisition module 10 is used to acquire multiple sending messages and / or reply messages received by the master station.

[0054] The sorting module 20 is used to fill multiple sending messages and / or reply messages into the free space of the target queue in sequence according to the order of the master station reception time and the target queue address; among them, the sending message or reply message at the current moment is filled into the free space with the address closest to the top of the target queue.

[0055] The traversal module 30 is used to traverse and process all the sent messages and reply messages in the master station to complete the serial communication.

[0056] Illustratively, this embodiment provides a message processing system for large-volume serial communication, further comprising: The first determining module is configured to use the target byte of each sent message or reply message as a function code of the message, so as to determine the priority of the sent message or reply message according to the function code.

[0057] The scanning module is used to scan the function code of the message in each space of the target queue at target time intervals.

[0058] The judgment module is used to judge whether there is a function code with the highest priority at the current moment.

[0059] The second determination module is used to determine to stop scanning when the judgment module determines that there is a function code with the highest priority at the current moment, and to process the sending message or reply message corresponding to the function code with the highest priority after the sending message or reply message at the current moment is processed.

[0060] The third determining module is used to determine that if the judging module determines that the function code with the highest priority does not exist at the current moment, after the sending message or reply message at the current moment is processed, process the sending message or reply message according to the priority.

[0061] Exemplarily, the sorting module includes: The sorting unit is used to fill the m'+1th send message or reply message into the free space of the address closest to the top of the target queue when the master station processes any send message or reply message; where m' is the total number of send messages and reply messages in the master station when the master station processes any send message or reply message.

[0062] For more specific working processes of the above modules, please refer to the corresponding content disclosed in Example 1, which will not be repeated here.

[0063] Example 3

[0064] This embodiment provides a computer device, including a processor and a memory; wherein, when the processor executes a computer program stored in the memory, the steps of the message processing method for large-scale serial communication described in Example 1 are implemented.

[0065] For more specific details about the above method, please refer to the corresponding content disclosed in Example 1, which will not be repeated here.

[0066] Example 4

[0067] This embodiment provides a computer-readable storage medium for storing a computer program; when the computer program is executed by a processor, the steps of the message processing method for large-scale serial communication described in Example 1 are implemented.

[0068] For more specific details about the above method, please refer to the corresponding content disclosed in Example 1, which will not be repeated here.

[0069] Example 5

[0070] This embodiment provides a computer program product, including computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the steps of the message processing method for large-scale serial communication described in Example 1 are implemented.

[0071] For more specific details about the above method, please refer to the corresponding content disclosed in Example 1, which will not be repeated here.

[0072] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. References to the same or similar parts between the various embodiments will be sufficient. The systems, devices, storage media, and computer program products disclosed in the embodiments correspond to the methods disclosed in the embodiments, so their descriptions are relatively simplified. For relevant details, refer to the method descriptions.

[0073] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software and a necessary general-purpose hardware platform. Based on this understanding, the technical solutions in the embodiments of the present invention, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium such as ROM / RAM, a magnetic disk, or an optical disk, and includes instructions for enabling a computer device (such as a personal computer, server, or network device) to execute the methods described in various embodiments of the present invention, or portions thereof.

[0074] In some embodiments, computer-executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0075] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).

[0076] By way of example, computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed across multiple sites and interconnected by a communication network.

[0077] The present invention has been described in detail above with reference to specific embodiments and exemplary examples. However, these descriptions should not be construed as limiting the present invention. Those skilled in the art will appreciate that various equivalent substitutions, modifications, or improvements may be made to the technical solutions and implementations of the present invention without departing from the spirit and scope of the present invention, all of which fall within the scope of the present invention. The scope of protection of the present invention shall be determined by the appended claims.

Claims

1. A method for processing messages in large-volume serial communications, characterized in that: include: Obtain multiple send messages and / or reply messages received by the master station; Fill multiple send messages and / or reply messages into the free space of the target queue in the order of the master station's reception time and the target queue address; among them, the send message or reply message at the current moment is filled into the free space with the address closest to the top of the target queue; Traverse and process all send messages and reply messages in the master station to complete serial communication.

2. The message processing method for large-scale serial communication according to claim 1, characterized in that: Also includes: The target byte of each sent message or reply message is used as the function code of the message to determine the priority of the sent message or reply message according to the function code; Scan the function code of the message in each space of the target queue every target time; Determine whether there is a function code with the highest priority at the current moment; If it exists, the scan is stopped, and after the current send message or reply message is processed, the send message or reply message corresponding to the function code with the highest priority is processed; If it does not exist, after the current sending message or reply message is processed, the sending message or reply message is processed according to the priority.

3. The message processing method for large-scale serial communication according to claim 1, characterized in that: The method of sequentially filling the plurality of sent messages and / or reply messages into the free space of the target queue according to the order of the master station reception time and the target queue address; wherein the sent message or reply message at the current moment is filled into the free space of the address closest to the top of the target queue, includes: When the master station processes any send message or reply message, it fills the m'+1th send message or reply message into the free space closest to the top of the target queue; where m' is the total number of send messages and reply messages in the master station when the master station processes any send message or reply message.

4. A message processing system for large-scale serial communication, characterized in that: include: An acquisition module, used to acquire multiple sent messages and / or reply messages received by the master station; A sorting module is used to fill multiple sent messages and / or reply messages into the free space of the target queue in the order of the master station reception time and the target queue address; wherein, the sent message or reply message at the current moment is filled into the free space with the address closest to the top of the target queue; The traversal module is used to traverse and process all send messages and reply messages in the master station to complete serial communication.

5. The message processing system for large-scale serial communication according to claim 4, characterized in that: Also includes: A first determining module is configured to use the target byte of each sent message or reply message as a function code of the message, so as to determine the priority of the sent message or reply message according to the function code; Scanning module, used to scan the function code of the message in each space of the target queue every target time; A judgment module is used to judge whether there is a function code with the highest priority at the current moment; The second determining module is used for determining to stop scanning when the judging module determines that there is a function code with the highest priority at the current moment, and processing the sending message or reply message corresponding to the function code with the highest priority after the sending message or reply message at the current moment is processed; The third determining module is used to determine that if the judging module determines that the function code with the highest priority does not exist at the current moment, after the sending message or reply message at the current moment is processed, process the sending message or reply message according to the priority.

6. The message processing system for large-volume serial communication according to claim 4, characterized in that: The sorting module includes: The sorting unit is used to fill the m'+1th send message or reply message into the free space of the address closest to the top of the target queue when the master station processes any send message or reply message; where m' is the total number of send messages and reply messages in the master station when the master station processes any send message or reply message.

7. A computer device, characterized in that: It comprises a processor and a memory; wherein, when the processor executes the computer program stored in the memory, it implements the steps of the message processing method for large-scale serial communication according to any one of claims 1 to 3.

8. A computer-readable storage medium, characterized in that Used to store computer programs; when the computer programs are executed by the processor, the steps of the message processing method for large-scale serial communication of claims 1-3 are implemented.

9. A computer program product, characterized in that The method comprises computer executable instructions or a computer program, which, when executed by a processor, implements the steps of the message processing method for large-scale serial communication of claims 1 to 3.