Message processing method, device and storage medium

By setting up multiple time slots and task queues in the industrial fieldbus, and scheduling and processing messages according to message priorities, the problems of real-time transmission and low bandwidth utilization in the existing technology are solved, and timely delivery of high-priority messages is achieved. Processing and bandwidth efficiency improvements.

CN114500402BActive Publication Date: 2024-08-23LI QUN INTELLIGENT ROBOT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111626083.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-28
Publication Date
2024-08-23
Estimated Expiration
2041-12-28

AI Technical Summary

Technical Problem

Existing industrial fieldbuses rely on the self-adjustment of the data link layer of IEEE802.3, which makes it difficult to ensure stable and on-time transmission of real-time messages and improve network bandwidth utilization, and cannot meet the needs of industrial automation for timely processing and transmission of massive data.

Method used

By setting the first time slot and multiple second time slots, the message is cached in the corresponding task queue according to the priority of the message parameters, and the message is scheduled and processed according to the processing priority in each scheduling cycle to ensure high priority. timely processing and orderly transmission of level-1 packets, and dynamically adjust the transmission bandwidth of the second time slot to adapt to changes in link quality.

Benefits of technology

It ensures the real-time and orderly processing of high-priority messages in emergency situations, improves the bandwidth utilization and real-time transmission of transmission links, and effectively ensures the transmission of high-priority messages especially when the link quality is poor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114500402B
    Figure CN114500402B
Patent Text Reader

Abstract

The present application provides a method, device and storage medium for message processing, which relates to the field of communication technology. The method includes: according to the message parameters of the first message to be processed, caching the first message to the first task queue or the second task queue; wherein the second task queue is one of several third task queues with different processing priorities; the processing priority of the first task queue is greater than the processing priority of any third task queue; in each scheduling cycle, according to the processing priority, the second message of the first task queue is scheduled to be processed in the first time slot corresponding to the first task queue, and the third message of the third task queue is scheduled to be processed in the second time slot corresponding to each third task queue. The device and storage medium apply the above method, and the above method can improve the transmission bandwidth and improve the real-time performance of the first message transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to but are not limited to the field of communication technology, and in particular, to a method, device and storage medium for message processing. Background Art

[0002] The existing industrial field bus completely relies on the self-adjustment of the data link layer of IEEE802.3. As the demand for industrial field networks in industrial automation increases, in addition to ensuring the stable and timely transmission of real-time messages, there are also massive amounts of data that need to be processed and transmitted in a timely manner. How to ensure the transmission of real-time messages and how to improve the bandwidth utilization of the network to meet the transmission of more data are issues that urgently need to be solved in the field of industrial control technology. Summary of the invention

[0003] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.

[0004] The embodiments of the present invention provide a message processing method, device and storage medium, which can improve the real-time performance of transmission and improve bandwidth utilization.

[0005] In a first aspect, an embodiment of the present invention provides a method for message processing, the method comprising:

[0006] According to the message parameters of the first message to be processed, the first message is cached in the first task queue or the second task queue; wherein the second task queue is one of a plurality of third task queues with different processing priorities, and the processing priority of the second task queue matches the configuration priority in the message parameters; the processing priority of the first task queue is greater than the processing priority of any of the third task queues;

[0007] In each scheduling cycle, according to the processing priority, the second message of the first task queue is scheduled to be processed in the first time slot corresponding to the first task queue, and the third message of the third task queue is scheduled to be processed in the second time slot corresponding to each third task queue.

[0008] In a second aspect, an embodiment of the present invention further provides a device, including:

[0009] An allocation module, configured to cache a first message to be processed into a first task queue or a second task queue according to a message parameter of the first message to be processed; wherein the second task queue is one of a plurality of third task queues having different processing priorities, and the processing priority of the second task queue matches the configuration priority in the message parameter; and the processing priority of the first task queue is greater than the processing priority of any of the third task queues;

[0010] The scheduling and processing module is used to schedule and process the second message of the first task queue in the first time slot corresponding to the first task queue and the third message of the third task queue in the second time slot corresponding to each third task queue in each scheduling cycle according to the processing priority.

[0011] In a third aspect, an embodiment of the present invention further provides a device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program according to the message processing method as described in any one of the first aspects.

[0012] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the message processing method described in any one of the first aspects.

[0013] According to the above-mentioned embodiments of the application, at least the following beneficial effects are achieved: by setting a first time slot and multiple second time slots to respectively schedule the first task queue and the third task queue, and matching the processing priority of each second time slot with the configuration priority in the message parameters, so that in an emergency, the first message configured with the configuration priority can still be scheduled from the first task queue, thereby ensuring the real-time performance of the message, while the first message with the configuration priority can be processed in order and the first message with a higher configuration priority can be processed preferentially, and in the case of poor link quality, it can be ensured that the transmission link is occupied by the higher configuration priority and the second message in the first task queue, thereby improving the transmission bandwidth and improving the real-time performance of the first message transmission.

[0014] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.

[0016] Figure 1 is a schematic diagram of the structure of the device of the embodiment of the present application;

[0017] Figure 2 It is a flowchart of a message processing method according to an embodiment of the present application;

[0018] Figure 3It is a flow chart of transmission bandwidth adjustment in the message processing method of an embodiment of the present application;

[0019] Figure 4 It is a flow chart of the second time slot fusion in the message processing method of the embodiment of the present application;

[0020] Figure 5 It is a structural schematic diagram of another device of an embodiment of the present application. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0022] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0023] The existing industrial fieldbus completely relies on the self-adjustment of the data link layer of IEEE802.3; as the demand for industrial automation on industrial field networks becomes higher and higher, in addition to the need to ensure the stable and timely transmission of real-time messages, there are also massive amounts of data that need to be processed and transmitted in a timely manner. How to ensure the transmission of real-time messages and how to improve the bandwidth utilization of the network to meet the transmission of more data are urgent problems in the field of industrial control technology. Based on this, the embodiments of the present application propose a message processing method, device and storage medium, which can improve the real-time performance of transmission and improve bandwidth utilization.

[0024] like Figure 1 In the embodiment shown, the present application proposes a device, comprising:

[0025] The allocation module 100 is used to cache the first message to the first task queue or the second task queue according to the message parameters of the first message to be processed; wherein the second task queue is one of a plurality of third task queues having different processing priorities, and the processing priority of the second task queue matches the configuration priority in the message parameters; and the processing priority of the first task queue is greater than the processing priority of any third task queue;

[0026] The scheduling processing module 200 is used to schedule and process the second message of the first task queue in the first time slot corresponding to the first task queue and schedule and process the third message of the third task queue in the second time slot corresponding to each third task queue according to the processing priority in each scheduling cycle.

[0027] It should be noted that, in some embodiments, the device also includes a cache module 300, which is used to cache messages matching the first time slot and the second time slot, that is, the first task queue and the second task queue are in the cache module 300, and the scheduling processing module 200 and the allocation module 100 are both electrically connected to the cache module 300.

[0028] It should be noted that the first message may be transmitted to the device by an external device through a communication link, or may be directly transmitted to the device through a network cable, optical fiber, etc., or may be generated by an upper-layer interactive component of the device.

[0029] It should be noted that the message parameters include at least one of the priority and the message type. For the second time slot, in some embodiments, the second time slot is set in one-to-one correspondence with the message type, that is, the second time slot is in one-to-one correspondence with the configuration priority corresponding to the message type. In other embodiments, the second time slot is set in a binding manner with the message type and the priority. Assuming that the first message A, the first message B, and the first message C are all non-real-time messages, and the first message A, the first message B, and the first message C are all messages of different message types, then illustratively, the first message A, the first message B, and the first message C respectively correspond to a second time slot. In other embodiments, assuming that the first message B and the first message C are messages of the same priority, the first message A is a message of other priorities, and the processing priority of the second time slot matches the priorities of the first message A, the first message B, and the first message C, respectively, then the first message B and the first message C correspond to the same second time slot, and the first message A corresponds to another second time slot. For example, in other embodiments, the second time slot is configured with a processing priority and supported message types. When the first message B is not set with a priority and the message type of the first message B matches the message type of one of the second time slots, the first message B can be cached in the third task queue corresponding to the second time slot.

[0030] It should be noted that when the device is initialized, the processing priority of the second time slot can be set according to the priority or message type supported by the device. In the actual operation process, the processing priority of the second time slot can be changed manually or modified by the configuration file.

[0031] It should be noted that the first message is relative to the second message and the third message. Each first time slot is assigned a first task queue, and each second time slot is assigned a third task queue. The processing priority and the third task queue are changed according to the corresponding second time slot. For the first time slot, it is used to transmit real-time messages. Real-time messages represent those with relatively high real-time requirements and can be any type of message.

[0032] It can be understood by those skilled in the art that Figure 1 The topological structure shown in the figure does not constitute a limitation on the embodiments of the present application, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0033] On the other hand, various embodiments of the message processing method of the present application are proposed.

[0034] Reference Figure 2 In the illustrated embodiment, the message processing method includes:

[0035] Step S100, according to the message parameters of the first message to be processed, cache the first message to the first task queue or the second task queue; wherein the second task queue is one of several third task queues with different processing priorities, and the processing priority of the second task queue matches the configuration priority in the message parameters; the processing priority of the first task queue is greater than the processing priority of any third task queue.

[0036] It should be noted that the message parameters include message type, configuration priority, etc.

[0037] Step S200, in each scheduling cycle, according to the processing priority, the second message of the first task queue is scheduled to be processed in the first time slot corresponding to the first task queue, and the third message of the third task queue is scheduled to be processed in the second time slot corresponding to each third task queue.

[0038] Therefore, by setting the first time slot and multiple second time slots to schedule the first task queue and the third task queue respectively, and matching the processing priority of each second time slot with the configuration priority in the message parameters, in an emergency, the first message configured with the configuration priority can still be scheduled from the first task queue, thereby ensuring the real-time performance of the message, while the first message with the configuration priority can be processed in order and the first message with a higher configuration priority can be processed first. In the case of poor link quality, it can be ensured that the transmission link is occupied by the higher configuration priority and the second message in the first task queue, thereby improving the transmission bandwidth and improving the real-time performance of the first message transmission.

[0039] It should be noted that the scheduling cycle is composed of a first time slot and a plurality of second time slots. The execution duration corresponding to each second time slot may be the same or different (i.e., the transmission bandwidth occupied may be inconsistent or consistent), and the first time slot and the second time slot may also be the same or different. Exemplarily, assuming that the scheduling cycle is 1s, the first time slot is 300ms, and there are 4 second time slots, namely, the second time slot 1 is 200ms, the second time slot 2 is 200ms, the second time slot 3 is 200ms, and the second time slot 4 is 100ms, then in each scheduling cycle, the second message of the first task queue with a duration of 300ms will be processed first, and then the third message of the corresponding duration will be executed respectively according to the processing priority of the second time slot 1, the second time slot 2, the second time slot 3, and the second time slot 4.

[0040] It should be noted that the duration of several second time slots can be adjusted dynamically, so that the transmission of real-time messages can be ensured through the first time slot. By dynamically adjusting the second time slot, other first messages with lower real-time performance than real-time messages can be processed in a timely manner, thereby improving bandwidth utilization.

[0041] It is understandable that the message parameters include a message type, and the method includes: when the message type of the first message is a construction event, matching the configuration priority of the first message to the highest processing priority among a plurality of third task queues.

[0042] It should be noted that the construction event is a message that needs to be processed first, such as an emergency event or an alarm event, and is triggered by a condition. It is set to a higher processing priority in the third task queue, so that the construction event can be processed in time.

[0043] It is understandable that the message processing method also includes: detecting the link quality of a preset transmission link; wherein the transmission link is used to transmit a third message; and adjusting the transmission bandwidth of at least one second time slot in the scheduling period according to the link quality.

[0044] It should be noted that there may be multiple transmission links or one transmission link. When multiple transmission links are provided, the link quality of all transmission links is counted. The link quality may be determined based on the MSE or signal-to-noise ratio SNR of the link. The transmission link may also be used to transmit the second message.

[0045] It should be noted that when the link quality of the transmission link deteriorates, it means that the total available transmission bandwidth decreases. At this time, transmitting a large-capacity third message on the transmission link will cause the loss of the third message. By adjusting the transmission bandwidth of the second time slot, the number of third messages sent to the transmission link can be reduced, thereby reducing the loss of the third message and improving the bandwidth utilization. When the link quality is restored, the corresponding second time slot is restored. Exemplarily, when multiple transmission links are set, the processed third message of the second time slot will be allocated according to the bandwidth ratio of each transmission link, thereby further improving the accuracy of the third message transmitted by each transmission link, thereby improving the effective utilization of the transmission link.

[0046] Understandably, referring to Figure 3 As shown in the flowchart, the message processing method further includes:

[0047] Step S410: Calculate the network transmission rate of the transmission link within a preset first historical time period.

[0048] It should be noted that by counting the network transmission rate in the first historical time period, the current state of the transmission link can be better reflected and the number of adjustments can be reduced. When there are multiple transmission links, the statistics are the network transmission rate states of the multiple transmission links in the first historical time period. Taking the network transmission rate as the average rate as an example, the average transmission rate v of the transmission link in the first historical time period is calculated respectively. n , at this time the network transmission rate is The transmission rate indicates the bandwidth per unit time, which corresponds to the transmission capacity of the link per unit time.

[0049] Step S420: When the network transmission rate meets the preset threshold, the total transmission bandwidth corresponding to the transmission link in one scheduling period is calculated.

[0050] It should be noted that, based on the relationship between the scheduling period and the unit time, the total transmission bandwidth within a scheduling period can be calculated.

[0051] Step S430: readjust the transmission bandwidth of at least one second time slot in the scheduling period according to the total transmission bandwidth.

[0052] It should be noted that when the total transmission bandwidth becomes smaller, the number of third messages processed in the second time slot with a smaller processing priority can be adjusted. In other embodiments, the transmission bandwidth can also be reallocated to all or some of the second time slots through a certain algorithm.

[0053] It is understandable that step S430 includes: dividing the total transmission bandwidth by a preset bandwidth allocation algorithm to obtain the transmission bandwidth corresponding to each second time slot.

[0054] It is understandable that the total transmission bandwidth is divided by a preset bandwidth allocation algorithm to obtain the transmission bandwidth corresponding to each second time slot, including: calculating the average transmission bandwidth according to the number N of multiple second time slots and the total transmission bandwidth; rounding down the average transmission bandwidth to obtain the first transmission bandwidth; calculating the remaining bandwidth according to the total transmission bandwidth and N-1 first transmission bandwidths; and allocating the remaining bandwidth and the first transmission bandwidth to N second time slots according to a preset allocation principle.

[0055] It should be noted that, in some embodiments, when the network transmission rate is lower than the preset threshold value, the transmission bandwidth of all second time slots will be reallocated. The remaining bandwidth can be allocated to the second time slot with the lowest processing priority or the second time slot with the highest processing priority. In other embodiments, when the remaining bandwidth is small, the number of third messages cached by the third task queue corresponding to the second time slot in the historical time period will be counted, and the remaining bandwidth will be allocated to the second time slot corresponding to the third task queue with a smaller cache amount.

[0056] For example, assuming that the total transmission bandwidth is band1=50M, and the number of second time slots N=4, the average total transmission bandwidth av=band1 / 4=12.5M. Then the first transmission bandwidth is 12M; the second transmission total bandwidth is 50-12*3=14M. At this time, the transmission bandwidths of the four second time slots are 12M, 12M, 12M, and 14M.

[0057] It is understandable that when the remaining bandwidth is greater than the first transmission bandwidth, the remaining bandwidth and the first transmission bandwidth are allocated to N second time slots according to a preset allocation principle, including: allocating the remaining bandwidth to the second time slot with the highest processing priority; allocating the first transmission bandwidth to other unallocated second time slots.

[0058] Therefore, through the above method, it can be further ensured that the third message with a high priority can be processed.

[0059] It is understandable that, according to the preset allocation principle, the remaining bandwidth and the first transmission bandwidth are allocated to N second time slots, including: determining the second time slot to which the remaining bandwidth is allocated according to the number of first messages of the third message cached in each second time slot within the preset second historical time period; and allocating the first transmission bandwidth to other unallocated second time slots.

[0060] It should be noted that when the remaining bandwidth is greater than the first transmission bandwidth, the remaining bandwidth is allocated to the second time slot corresponding to the third task queue with the largest number of first messages, and when the remaining bandwidth is less than the first transmission bandwidth, the remaining bandwidth is allocated to the second time slot corresponding to the third task queue with the smallest number of first messages. Exemplarily, there are three second time slots, namely A, B, and C, and the numbers of first messages corresponding to the second time slots A, B, and C are N1, N2, and N3, respectively. Among them, N3 is the largest and N1 is the smallest. When the remaining bandwidth is greater than the first transmission bandwidth, the remaining bandwidth is allocated to the second time slot C corresponding to N3, and the first transmission bandwidth is allocated to the second time slots A and B. When the remaining bandwidth is less than the first transmission bandwidth, the remaining bandwidth is allocated to the second time slot A, and the first transmission bandwidth is allocated to the second time slots B and C.

[0061] Therefore, through the above method, the utilization rate of the transmission link can be further improved.

[0062] It should be noted that in actual applications, one of the above two methods can be selected to dynamically allocate the second time slot according to needs, or the configuration strategy can be adjusted dynamically. For example, during idle time at night, the number of first messages in the second historical time period can be selected first, and during peak hours, more bandwidth can be allocated to high-priority third messages.

[0063] It is understandable that the method also includes: respectively obtaining the number of second messages of the third messages cached in each second time slot within a preset third historical time period and the number of third messages cached at the current moment; and readjusting the processing priority of at least one second time slot according to the number of second messages and the number of third messages corresponding to several second time slots.

[0064] It should be noted that when a second time slot processes a small number of messages for a continuous period of time, that is, the cumulative number of second messages and the number of third messages is less than the preset message threshold or the current number of third messages does not conform to the law of the historical change of the number of second messages, it can be determined that the number of messages processed is small. At this time, the processing priority of the second time slot can be reduced, and the processing of messages with other processing priorities can be given priority, thereby ensuring that all third messages can be processed in time.

[0065] It is understandable that the steps readjust the processing priority of at least one second time slot according to the number of second messages and the number of third messages corresponding to several second time slots, including: obtaining the number of cached messages according to the number of second messages and the number of third messages corresponding to several second time slots; lowering the processing priority of the second time slot corresponding to the number of cached messages that is lower than a preset lower limit threshold value.

[0066] It should be noted that the number of cached messages can be the cumulative value of the number of second messages and the number of third messages, or a smaller value between the two. In other embodiments, weights can be set for the historical number of second messages and the current number of third messages to obtain the number of cached messages corresponding to each second time slot. By comparing the number of cached messages with the lower limit threshold value, the processing priority of the second time slot below the lower limit threshold value can be reduced.

[0067] Understandably, referring to Figure 4 In the illustrated embodiment, the message processing method further includes:

[0068] Step S510: in each scheduling cycle, obtain the third task queue that is not scheduled for processing.

[0069] Step S520: merge the second time slot corresponding to the third task queue that is continuously not scheduled for processing into the second time slot of the adjacent processing priority.

[0070] It should be noted that, in the polling process of the second time slot and the first time slot, there is a second time slot that occupies the scheduling time of the adjacent second time slot. For example, the time slice scheduling implemented by the statistical multiplexing method of the message is not strictly processed according to the duration of the second time slot. Therefore, the remaining time is insufficient to support the adjacent second time slot to process the message of the corresponding second task queue, resulting in at least one second task queue being unable to be executed. Through the fusion method, the scheduling probability of the third message that originally belonged to the third task queue that was continuously unscheduled can be improved. It should be noted that it is possible to determine whether the second time slot has been occupied and the third message of the corresponding second task queue cannot be scheduled by setting a mark or setting the number of times.

[0071] It is understandable that the plurality of second time slots include polling slots.

[0072] It should be noted that the polling slot is used to process the first message that does not match the first time slot and the second time slot. By setting the polling slot, the compatibility of the communication system can be improved, and the reliability of the communication system can be further improved.

[0073] It is understandable that before step S100, the following steps are also included: obtaining a preset processing priority list; allocating an initial processing priority to each second time slot according to the processing priority list; and allocating a third task queue to each second time slot.

[0074] It should be noted that, in some embodiments, the processing priority list corresponds to the configuration priority of the supported first message one by one. In other embodiments, the processing priority list matches the type of the first message.

[0075] It can be understood that referring to Figure 5 In the embodiment shown, the present application also proposes a device, including: a memory 500, a processor 600, and a computer program stored in the memory 500 and executable on the processor 600, and the above-mentioned message processing method when the processor 600 executes the computer program.

[0076] The memory 500, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0077] It should be noted that the device in this embodiment can be used as follows Figure 1 The device of the embodiment shown in the figure, the device in this embodiment and the Figure 2 The message processing methods shown have the same inventive concept, so these embodiments have the same implementation principles and technical effects, which will not be described in detail here.

[0078] The non-transient software program and instructions required to implement the information processing method of the above embodiment are stored in the memory. When executed by the processor, the information processing method of the above embodiment is executed, for example, the above described Figure 2 , Figure 3 , Figure 4 The corresponding method steps or Figure 2 , Figure 3 , Figure 4 The corresponding method sub-steps.

[0079] It can be understood that the present invention also provides a computer-readable storage medium storing computer-executable instructions, and the computer-executable instructions are used to execute the above-mentioned message processing method.

[0080] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0081] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions without violating the spirit of the present invention. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. A message processing method, characterized in that: The method comprises: According to a message parameter of a first message to be processed, the first message is cached in a first task queue or a second task queue; wherein the second task queue is one of a plurality of third task queues with different processing priorities, and the processing priority of the second task queue matches the configuration priority in the message parameter; the processing priority of the first task queue is greater than the processing priority of any of the third task queues; In each scheduling cycle, according to the processing priority, the second message of the first task queue is scheduled to be processed in the first time slot corresponding to the first task queue, and the third message of the third task queue is scheduled to be processed in the second time slot corresponding to each of the third task queues; wherein the scheduling cycle is composed of a first time slot and a plurality of second time slots, each first time slot is allocated with a first task queue, each second time slot is allocated with a third task queue, and the duration of a plurality of second time slots can be dynamically adjusted to ensure the transmission of real-time messages through the first time slot, and to ensure that other first messages with a lower real-time nature than the real-time messages are processed in a timely manner by dynamically adjusting the second time slot; Calculating a network transmission rate of a transmission link within a preset first historical time period; When the network transmission rate meets a preset threshold value, calculating the total transmission bandwidth corresponding to the transmission link in a scheduling period; Re-adjusting the transmission bandwidth of at least one of the second time slots in the scheduling period according to the total transmission bandwidth; In each scheduling cycle, obtaining the third task queue that has not been scheduled for processing; Merging the second time slot corresponding to the third task queue that is continuously not scheduled for processing into the second time slot of the adjacent processing priority; The re-adjusting the transmission bandwidth of at least one of the second time slots in the scheduling period according to the total transmission bandwidth includes: Dividing the total transmission bandwidth by a preset bandwidth allocation algorithm to obtain a transmission bandwidth corresponding to each of the second time slots; The dividing the total transmission bandwidth by a preset bandwidth allocation algorithm to obtain the transmission bandwidth corresponding to each second time slot includes: Calculate an average transmission bandwidth according to the number N of the plurality of second time slots and the total transmission bandwidth; Rounding down the average transmission bandwidth to obtain a first transmission bandwidth; Calculate the remaining bandwidth according to the total transmission bandwidth and N-1 of the first transmission bandwidths; According to a preset allocation principle, the remaining bandwidth and the first transmission bandwidth are allocated to N second time slots.

2. The method according to claim 1, characterized in that: The message parameters include a message type, and the method further includes: When the message type of the first message is a construction event, the configuration priority of the first message is matched to the highest processing priority among the plurality of the third task queues.

3. The method according to claim 1, characterized in that The method further comprises: Detecting the link quality of a preset transmission link; wherein the transmission link is used to transmit the third message; The transmission bandwidth of at least one of the second time slots in the scheduling period is adjusted according to the link quality.

4. The method according to claim 1, characterized in that: When the remaining bandwidth is greater than the first transmission bandwidth, allocating the remaining bandwidth and the first transmission bandwidth to N second time slots according to a preset allocation principle includes: Allocating the remaining bandwidth to a second time slot with the highest processing priority; The first transmission bandwidth is allocated to other unallocated second time slots.

5. The method according to claim 1, characterized in that The allocating the remaining bandwidth and the first transmission bandwidth to N second time slots according to a preset allocation principle includes: Determine the second time slot for the remaining bandwidth allocation according to the number of first messages of the third message cached in each second time slot within a preset second historical time period; The first transmission bandwidth is allocated to other unallocated second time slots.

6. The method according to claim 1, characterized in that The method further comprises: Respectively obtain the number of second messages of the third message cached in each of the second time slots within a preset third historical time period and the number of third messages cached at the current moment; According to the number of the second messages and the number of the third messages corresponding to a number of the second time slots, the processing priority of at least one of the second time slots is readjusted.

7. The method according to claim 6, characterized in that The re-adjusting the processing priority of at least one of the second time slots according to the number of the second messages and the number of the third messages corresponding to the plurality of the second time slots includes: Obtaining a cached message quantity according to the number of the second messages and the number of the third messages corresponding to a number of the second time slots; The processing priority of the second time slot corresponding to the number of cached messages below the preset lower limit threshold is reduced.

8. The method according to claim 1, characterized in that The plurality of said second time slots include polling slots.

9. The method according to claim 1, characterized in that: Before caching the first message in the first task queue or the second task queue, the method further includes: Get the preset processing priority list; Allocating an initial processing priority to each of the second time slots according to the processing priority list; The third task queue is allocated to each of the second time slots.

10. A device, characterized in that: include: An allocation module, configured to cache a first message to be processed into a first task queue or a second task queue according to a message parameter of the first message to be processed; wherein the second task queue is one of a plurality of third task queues having different processing priorities, and the processing priority of the second task queue matches the configuration priority in the message parameter; and the processing priority of the first task queue is greater than the processing priority of any of the third task queues; A scheduling processing module, used for, in each scheduling cycle, scheduling and processing the second message of the first task queue in the first time slot corresponding to the first task queue, and scheduling and processing the third message of the third task queue in the second time slot corresponding to each third task queue according to the processing priority; wherein the scheduling cycle is composed of a first time slot and a plurality of second time slots, each first time slot is allocated with a first task queue, each second time slot is allocated with a third task queue, and the duration of a plurality of second time slots can be dynamically adjusted to ensure the transmission of real-time messages through the first time slot, and to ensure that other first messages with a lower real-time nature than the real-time messages are processed in a timely manner by dynamically adjusting the second time slot; Calculating a network transmission rate of a transmission link within a preset first historical time period; When the network transmission rate meets a preset threshold value, calculating the total transmission bandwidth corresponding to the transmission link in a scheduling period; Re-adjusting the transmission bandwidth of at least one of the second time slots in the scheduling period according to the total transmission bandwidth; In each scheduling cycle, obtaining the third task queue that has not been scheduled for processing; Merging the second time slot corresponding to the third task queue that is continuously not scheduled for processing into the second time slot of the adjacent processing priority; The re-adjusting the transmission bandwidth of at least one of the second time slots in the scheduling period according to the total transmission bandwidth includes: Dividing the total transmission bandwidth by a preset bandwidth allocation algorithm to obtain a transmission bandwidth corresponding to each of the second time slots; The dividing the total transmission bandwidth by a preset bandwidth allocation algorithm to obtain the transmission bandwidth corresponding to each second time slot includes: Calculate an average transmission bandwidth according to the number N of the plurality of second time slots and the total transmission bandwidth; Rounding down the average transmission bandwidth to obtain a first transmission bandwidth; Calculate the remaining bandwidth according to the total transmission bandwidth and N-1 of the first transmission bandwidths; According to a preset allocation principle, the remaining bandwidth and the first transmission bandwidth are allocated to N second time slots.

11. A device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program according to the message processing method as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: Computer executable instructions are stored, and the computer executable instructions are used to execute at least the message processing method as described in any one of claims 1 to 9.