CN114117287A - Message resending method and device - Google Patents

Message resending method and device Download PDF

Info

Publication number
CN114117287A
CN114117287A CN202010862426.3A CN202010862426A CN114117287A CN 114117287 A CN114117287 A CN 114117287A CN 202010862426 A CN202010862426 A CN 202010862426A CN 114117287 A CN114117287 A CN 114117287A
Authority
CN
China
Prior art keywords
message
retry
sending
level
resending
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010862426.3A
Other languages
Chinese (zh)
Inventor
黄嵩
陈周天瑜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN202010862426.3A priority Critical patent/CN114117287A/en
Publication of CN114117287A publication Critical patent/CN114117287A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Communication Control (AREA)

Abstract

The invention discloses a method and a device for resending a message, wherein the sending level of the message is calculated according to the important level, retry times and delay time of the message; inserting the message into a retry message tree according to the calculated transmission level of the message; regularly taking out the message with the highest sending grade in the retry message tree for resending; and adjusting the retry message tree according to the resending condition of the message with the highest sending grade. The invention comprehensively considers the important level, the retry times and the delay time of each message, dynamically calculates the sending level of each message, dynamically feeds back and adjusts the retransmission strategy of each message according to the sending level, preferentially selects the message with the highest sending level for retransmission, avoids the message with lower sending level from occupying the sending resources for a long time, ensures the timely sending of the important message, improves the user experience and simultaneously improves the rationality of the system resource allocation.

Description

Message resending method and device
Technical Field
The application belongs to the technical field of mobile communication, and particularly relates to a message resending method and a message resending device.
Background
Broadcast push is a common message mode in the internet, and a user (client) subscribes related messages to a message push service, and then the message push service matches the messages taken out from a message queue with subscription conditions of the user and sends the matched messages to a specific user. However, in the process of sending the message, the message sending may fail due to the influence of the network environment or the factors such as message damage. In this case, a retransmission mechanism is usually adopted, i.e. when the message transmission is unsuccessful, multiple transmission attempts can be made, so as to solve the problem of unsuccessful message transmission.
The message retransmission mechanism in the prior art is simple in implementation principle, and generally stores a message failed to be sent into a retry queue if the message is failed to be sent, and then periodically calls the message in the retransmission queue to send the message to a user by a message push service until the message is successfully sent, deletes the message from the buffer queue, and then continuously calls the next message.
However, in the existing message retransmission method, when the message push service sends the message in the retry queue to the user, the important level of the broadcast message is not distinguished, and all messages are retransmitted in the same mode, which easily causes that the important message cannot be sent in time, and reduces the user experience. Meanwhile, due to the influence of reasons such as message damage, a certain message may never be sent to a specific user, and at this time, if the current retry method is adopted, the message push service will continuously try to send the message, thereby causing waste of system resources.
Disclosure of Invention
The purpose of the present application is to provide a method and an apparatus for retransmitting a message, which dynamically feedback and adjust the retransmission policy of each message, ensure that important messages are transmitted in time, and reasonably allocate resources.
In order to achieve the purpose, the technical scheme adopted by the application is as follows:
a message resending method, each message carries a preset importance level, the message resending method comprises the following steps:
calculating the sending grade of the message according to the important grade, the retry times and the delay time of the message;
inserting the message into a retry message tree according to the calculated transmission level of the message;
regularly taking out the message with the highest sending grade in the retry message tree for resending;
and adjusting the retry message tree according to the resending condition of the message with the highest sending grade.
Several alternatives are provided below, but not as an additional limitation to the above general solution, but merely as a further addition or preference, each alternative being combinable individually for the above general solution or among several alternatives without technical or logical contradictions.
Preferably, the threshold of the number of retries is set according to the importance level of the message, wherein the threshold of the number of retries is positively correlated with the importance level of the message.
Preferably, before calculating the sending level of the message according to the importance level of the message, the retry number, and the delay time, the method further includes:
judging whether the retry times of the message exceed a retry time threshold, and if the retry times of the message exceed the retry time threshold, storing the message into a dead message queue; otherwise, the sending grade of the message is calculated according to the important grade, the retry times and the delay time of the message.
Preferably, the calculating the sending level of the message according to the importance level of the message, the retry number and the delay time includes:
sending rank (importance rank a)1) - (number of retries A)2) - (time delay A)3)
Or:
transmission grade is a1Importance level/(number of retries A)2+ delay time A3)
In the formula, A1、A2、A3Is a weight coefficient, and A1+A2+A3=1,A1>A2>A3
Preferably, the adjusting the retry message tree according to the resending condition of the message with the highest rank includes:
if the message with the highest grade fails to be retransmitted, the retry times and the delay time of the message are updated, and after the retry times are judged not to exceed the retry times threshold value, the transmission grade is recalculated and inserted into a retry message tree.
The present application further provides a message resending device, each message carries a preset importance level, the message resending device includes:
the level calculation module is used for calculating the sending level of the message according to the important level, the retry times and the delay time of the message;
a message writing module for inserting the message into a retry message tree according to the calculated sending level of the message;
the resending module is used for regularly taking out the message with the highest sending grade in the retry message tree for resending;
and the dynamic adjusting module is used for adjusting the retry message tree according to the resending condition of the message with the highest sending grade.
Preferably, the threshold of the number of retries is set according to the importance level of the message, wherein the threshold of the number of retries is positively correlated with the importance level of the message.
Preferably, before the sending level of the message is calculated according to the importance level, the retry number and the delay time of the message, the level calculating module further performs the following operations:
judging whether the retry times of the message exceed a retry time threshold, and if the retry times of the message exceed the retry time threshold, storing the message into a dead message queue; otherwise, the sending grade of the message is calculated according to the important grade, the retry times and the delay time of the message.
Preferably, the level calculating module calculates a sending level of the message according to the importance level of the message, the retry number, and the delay time, and performs the following operations:
sending rank (importance rank a)1) - (number of retries A)2) - (time delay A)3)
Or:
transmission grade is a1Importance level/(number of retries A)2+ delay time A3)
In the formula, A1、A2、A3Is a weight coefficient, and A1+A2+A3=1,A1>A2>A3
Preferably, the dynamic adjustment module adjusts the retry message tree according to the resending condition of the message with the highest rank, and executes the following operations:
if the message with the highest grade fails to be retransmitted, the retry times and the delay time of the message are updated, and after the retry times are judged not to exceed the retry times threshold value, the transmission grade is recalculated and inserted into a retry message tree.
According to the message resending method and the message resending device, the important level, the retry times and the delay time of each message are comprehensively considered, the sending level of each message is dynamically calculated, the resending strategy of each message is dynamically fed back and adjusted according to the sending level, the message with the highest sending level is preferentially selected for resending, the message with the lower sending level is prevented from occupying sending resources for a long time, the important message is guaranteed to be sent in time, the user experience is improved, and meanwhile the rationality of system resource allocation is improved.
Drawings
Fig. 1 is a flow chart of an embodiment of broadcast push of the present application;
FIG. 2 is a flow chart of a message resending method of the present application;
fig. 3 is a flowchart of a broadcast push operation in embodiment 1 of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
In one embodiment, a message resending method is provided for dynamically adjusting a resending strategy of each message with failed sending. The message resending method has a better resending effect aiming at each message mode, can ensure that the message is sent in time and does not waste sending resources.
The message mode mentioned in this embodiment may be a work queue mode, a wildcard mode, a routing mode, a simple mode, etc. Since broadcast push is a relatively common message mode, the present embodiment takes broadcast push as an example to describe the message resending method in detail.
As shown in fig. 1, a background service module, a push service, and a client (user) are generally involved in a broadcast push process, and specifically, a work flow of the broadcast push is as follows:
1) the client first subscribes to the push service for the type of message required by itself and then establishes a long connection with the push service.
2) The message queue stores the broadcast messages sent by the background service module, the push service takes out the broadcast messages from the message queue, matches the broadcast messages with the rules subscribed by the users, and sends the messages to the users who match successfully.
3) If the message sending fails, the push service needs to perform message resending operation.
In the prior art, a retransmission queue and a deadlock queue are generally used for a message retransmission operation, but because retransmission queue-based message retransmission is low in timeliness and poor in user experience, the embodiment provides a message retransmission method as shown in fig. 2, which specifically includes the following steps:
and S1, calculating the sending level of the message according to the importance level, the retry times and the delay time of the message.
Each message in the message queue carries a preset importance level, and the preset importance level of each message can be set according to the user requirements to meet the requirements of the user on the message, and certainly, can also be set uniformly according to the message type. It is easy to understand how to set the importance level of the message is not an important point for the improvement of the present application, and can be implemented according to the existing rules.
During the process of sending the messages in the message queue, the phenomenon of message sending failure can occur due to various reasons. The message transmission failure may be caused by various reasons, such as the message itself is damaged, or the message transmission failure is caused by the network packet loss. After the message transmission fails, a message retransmission mechanism is provided in many systems to retransmit the message with failed transmission, so that the message can be successfully transmitted to the receiving end, and the condition of message transmission failure is avoided.
In this embodiment, for each message that needs to be retransmitted, the retry number of the message is first determined, and whether the message needs to be retransmitted is determined according to the retry number, so as to avoid that the damaged message occupies transmission resources for a long time. In the embodiment, it is considered that the first transmission failure of the message means that the message has been transmitted once, so that the retry number of the message is set to be 1 when the first transmission failure of the message is set, and then the retry number is increased by 1 every time the transmission failure of the message occurs.
It is easy to understand that the way of accumulating the retry number can be adjusted according to the actual requirement, for example, it can also be set that when the first transmission of the message fails, the retry number of the message is recorded as 0, and then every time the transmission of the message fails, the retry number is added by 1, and regardless of the first transmission of the message, the retry number is accumulated only by the retransmission number.
When the retry times of the messages are judged, the retry times are measured according to a retry time threshold value, and the retry time threshold value limits the resending times of each message. A uniform threshold for the number of retries may be set for each message, or a different threshold for the number of retries may be set for each message.
In this embodiment, in order to ensure the sending success rate of the important message, the retry number threshold of each message is set according to the importance level of each message. It is easy to understand that, when the retry number threshold is set according to the importance level, the retry number threshold can be positively correlated with the importance level of the message, that is, the higher the importance level of the message is, the larger the retry number threshold is, so as to ensure that the important message has enough resending times; the retry number threshold can be inversely related to the importance level of the message, that is, the higher the importance level of the message is, the smaller the retry number threshold is, whether the important message can be successfully sent or not can be locked as soon as possible, so that remedial measures can be taken in time.
In this embodiment, the threshold of the retry number is set to be positively correlated with the importance level of the message. For example, the importance level of the message is classified into 1-10 levels, wherein 10 levels represent the highest importance level of the message, and correspondingly, 1 level represents the lowest importance level of the message. The threshold number of retries for a message with a level of importance of 10 may be set to 10N (e.g., 1000), and the threshold number of retries with a level of importance of 1 may be set to N (e.g., 100).
In one embodiment, before calculating the sending level of the message, it is necessary to determine whether the retry number of the message exceeds a retry number threshold, and if the retry number exceeds the retry number threshold, store the message in a dead credit queue; otherwise, the sending grade of the message is calculated according to the important grade, the retry times and the delay time of the message.
After setting the corresponding threshold value of the retry times, judging whether the retry times of the message which fails to be sent exceeds the threshold value of the retry times, if the retry times of the message exceeds the threshold value of the retry times, the message is considered to be damaged, and the message which fails to be sent is irrelevant to an environment network, so that the message is stored in a dead message queue. The message put into the deadlock queue is not sent again, so as to avoid occupying the sending resource. And the emptying time of the deadlock queue can be further set, and the messages in the deadlock queue are cleared regularly to save the storage space.
If the retry number does not exceed the retry number threshold after the determination, the sending level of the message needs to be calculated, and a preferred calculation method provided in this embodiment is as follows:
sending rank (importance rank a)1) - (number of retries A)2) - (time delay A)3)
In the formula, A1、A2、A3Is a weight coefficient, and A1+A2+A3=1,A1>A2>A3
The transmission level in this embodiment comprehensively considers cancellationThe importance level, the retry times and the delay time of the messages ensure that the messages with high importance level can be sent in time, and a weight coefficient is set to adapt to more application environments. For example, in this embodiment, a value scheme is provided as a1=0.7、A2=0.2、A3=0.1。
Before each message is retransmitted, the current transmission level is determined according to the transmission level calculation formula so as to realize dynamic feedback adjustment of the retransmission strategy of each message. It should be noted that the sending level is mainly used to ensure that important messages with low probability of damage can be sent again in priority, so that the calculation formula of the sending level can be further deformed on the premise of ensuring the priority principle.
For example, in another embodiment, the calculation formula for the transmission level provided may be:
transmission grade is a1Importance level/(number of retries A)2+ delay time A3)
In the formula, A1、A2、A3Is a weight coefficient, and A1+A2+A3=1,A1>A2>A3
When the number of retries is more, the probability of indicating the message is more damaged, the sending level in this embodiment still ensures that the important message with low probability of damage can be sent again in priority, and the sending level has no negative value, so that the comparison of positive and negative values can be avoided.
Therefore, when the sending level is calculated according to the importance level, the retry times and the delay time of the message, the selectivity is high, and even the priority principle can be changed according to the actual requirement, for example, the priority principle is changed to ensure that the message with less retry times is sent again preferentially, the weight coefficient A can be increased2Satisfy A2>A1>A3Or satisfy A2>A3>A1Etc.; if the priority rule is changed to ensure that the message with long delay time is sent preferentially to avoid the message from delaying too long, the weight coefficient A can be increased3Satisfy A3>A1>A2Or satisfy A3>A2>A1And the like.
In the above embodiment, the delay time is increased according to the increase of the number of retries, and according to the preferred transmission level calculation method in the present application, it is possible to transmit the latest message in time, and to exhibit the timeliness of message transmission.
The preferred delay time calculation method provided in this embodiment is as follows:
delay time (ms value of current time-ms value of first message transmission time)/1000/3600.
Where the millisecond value of the current time is understood to be the one to which the read current time of the system is translated and the millisecond value of the time the message was first sent is understood to be the one to which the time recorded when the message was first sent is translated.
According to the delay time calculation formula, it can be seen that if the retry times are more, the difference between the current time and the first message sending time is larger, so that the delay time is larger, the sending level of the message is dynamically adjusted to be reduced, and the message with the newer first sending time is preferentially resent, so that the message sending has higher timeliness.
It will be readily appreciated that the delay time may also be determined in other ways, such as directly set to a corresponding multiple of the number of retries, or in direct proportion to the number of retries.
S2, inserting the message into the retry message tree according to the calculated sending level of the message.
The retry message tree in this embodiment is understood as a tree-like message storage structure, which is an important non-linear data structure. When the messages are inserted into the retry message tree according to the sending level, the messages can be sorted in a descending order according to the sending level, or sorted in an ascending order according to the sending level, or a sorting method of the size of a left sub-tree and a right sub-tree such as a binary tree is adopted, or even a self-defined sorting method is adopted. Namely, on the premise of ensuring that the message with the highest sending grade can be taken out for resending when the message is resent, the specific message sequencing method is not strictly limited.
Since the time spent in querying/adding/deleting a tree is proportional to the height of the tree and not to the capacity of the tree. Therefore, in order to save the search time, the retry message Tree of this embodiment employs a Balanced Binary Tree (Balanced Binary Tree) which has the following properties: the absolute value of the height difference of the left subtree and the right subtree of the empty tree is not more than 1, and the left subtree and the right subtree are both balanced binary trees.
The balanced binary tree in this embodiment may be a red-black tree, an AVL tree, a crime tree, a Treap, a stretch tree, or the like. The AVL tree is preferably used to achieve the fastest adjustment speed on the premise of balance adjustment.
It should be noted that, the present application focuses on using the balanced binary tree to store the message, and the process of inserting or extracting the balanced binary tree for the message and the process of rotating and adjusting the balance of the balanced binary tree are not taken as the improvement focus of the present application, and are not described herein again.
When a message is inserted into the retry message tree, the whole content of the message can be inserted into the retry message tree so as to be convenient for the message to use; addresses corresponding to messages can also be inserted into the retry message tree to improve the speed of inserting and extracting the retry message tree.
For the insertion operation of the balanced binary tree, if the node identical to the node to be inserted already exists in the balanced binary tree, the situation that the node cannot be inserted occurs. In order to avoid data loss under such a situation, the embodiment sets a unique identifier for each message, and performs an insertion action according to the size of the unique identifier when the transmission levels of the two messages are the same, thereby ensuring that all messages failed to be transmitted can be inserted into the balanced binary tree.
The unique identifier of each message may be a generated unique numerical value, or a number of sent messages, or a hash value of the message, etc., and is not limited herein.
According to the method and the device, quick and convenient searching is realized by using the balanced binary tree, but the message can be directly put into an array or a data block under the conditions that the message sending amount is not large or the requirement on the message sending efficiency is not high, or under other conditions, the data can be inserted or taken out for resending by adopting a sorting mode from large to small or from large to small according to the sending grade.
And S3, periodically extracting the message with the highest transmission level in the retry message tree and retransmitting the message.
When the resending is executed, the retry message tree is searched to find the message with the highest sending level for resending. For the balanced binary tree adopted in this embodiment, the left subtree and the right subtree of each node are distributed according to a specific principle, for example, the distribution principle may be: if the left sub-tree is not empty, the values of all nodes on the left sub-tree are smaller than the value of the root node; if the right subtree is not empty, the values of all nodes on the right subtree are all larger than the value of the root node; the method can also be as follows: if the left sub-tree is not empty, the values of all nodes on the left sub-tree are all larger than the value of the root node; if the right subtree is not empty, the values of all nodes on the right subtree are smaller than the value of the root node.
Therefore, when the message with the highest sending level in the retry message tree is taken out, only the message of the leaf node at the bottommost layer in the left sub-tree or the right sub-tree needs to be taken out, and the message taking efficiency is obviously improved.
In addition, in this embodiment, after the message is fetched, the node where the message is located is deleted, that is, after the message is fetched from the retry message tree, the message tree does not have the fetched message, so that the message is tracked, and confusion caused by the fact that the message exists in multiple places at the same time is avoided.
And S4, adjusting the retry message tree according to the resending condition of the message with the highest sending level.
For a retransmitted message, if the retransmission of the message with the highest rank fails, the retry number and the delay time of the message are updated, and after the retry number is judged not to exceed the retry number threshold, the transmission rank is recalculated and inserted into a retry message tree. Therefore, the dynamic calculation of the sending grade of each message is realized, the retransmission strategy of each message is dynamically fed back and adjusted, the timely sending of important messages is ensured, and the waste of resources can be avoided.
And if the retry times exceed the retry times threshold value, storing the message into a deadlock queue and not occupying resources for the message any more. If the highest ranked message is successfully resent, the message is not reinserted into the retry message tree.
Whether the corresponding feedback is returned after the message is successfully sent or not, and the returned object of the feedback and the like are not taken as the improvement key points of the application, and the corresponding setting is only required according to the actual logic of the message sending.
The message retransmission method comprehensively considers the important level and the retry times of the message, if the retry times are the same, the message with higher important level is sent, and the important message is preferentially ensured to arrive at the client side quickly in time; if the importance levels are the same, the message with less retry times is preferentially sent, the continuous resending of the same message is avoided, and the sending resources of the system are reasonably distributed. Meanwhile, if a message with a higher importance level is damaged or the message cannot be sent due to reasons such as the fact that the client cannot recognize the message and the like, the message cannot be sent successfully after repeated attempts, and the sending level of the message is continuously reduced.
Example 1
The following describes the work flow of broadcast push in conjunction with the message resending method of the present application by way of example. As shown in fig. 3, the specific work flow is:
1) first the client (user) subscribes to the push service for the type of message it needs and then establishes a long connection with the push service.
2) The message queue stores the broadcast messages sent by the background service module, the push service takes out the broadcast messages from the message queue, matches the broadcast messages with the user subscription messages, and sends the messages to the users who are successfully matched.
3) Judging whether the message is successfully sent or not, and if the message is successfully sent, finishing the sending of the message; if the message transmission fails, the retry number of the message is added by 1.
4) Judging whether the retry times of the message exceed a threshold value, if the retry times of the message exceed the threshold value, putting the message into a deadlock queue, and setting a preset time to clear the deadlock message at regular time.
5) If the number of retries of the message does not exceed the threshold, the transmission level of the message is calculated, and the transmission level of the message is obtained (importance level A of the message)1) - (number of retries of message a)2) - (time delay of message A)3) Or transmission grade ═ a1Importance level/(number of retries A)2+ delay time A3)。
6) The message is inserted into the AVL tree according to the calculated transmission rank.
7) And the timing task takes the message with the highest transmission grade from the AVL tree, transmits the message and executes the step 3 again.
The broadcast push method of the embodiment dynamically adjusts the resending strategy for each message, thereby avoiding the waste of occupation of sending resources and obviously improving the user experience.
In another embodiment, the present application further provides a message resending device, where each message carries a preset importance level, and the message resending device of this embodiment includes:
the level calculation module is used for calculating the sending level of the message according to the important level, the retry times and the delay time of the message;
a message writing module for inserting the message into a retry message tree according to the calculated sending level of the message;
the resending module is used for regularly taking out the message with the highest sending grade in the retry message tree for resending;
and the dynamic adjusting module is used for adjusting the retry message tree according to the resending condition of the message with the highest sending grade.
For specific limitations of the message resending device in the present application, refer to the above limitations on the message resending method, which are not described herein again. The respective modules in the above message resending device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
Corresponding to the above message resending method, in an implementation manner of this embodiment, the retry number threshold is set according to the importance level of the message, where the retry number threshold is positively correlated with the importance level of the message.
In an implementation manner of this embodiment, before calculating the sending level of the message according to the importance level of the message, the retry number, and the delay time, the level calculating module further performs the following operations:
judging whether the retry times of the message exceed a retry time threshold, and if the retry times of the message exceed the retry time threshold, storing the message into a dead message queue; otherwise, the sending grade of the message is calculated according to the important grade, the retry times and the delay time of the message.
In one embodiment, the level calculation module calculates the sending level of the message according to the importance level of the message, the retry times and the delay time, and performs the following operations:
sending rank (importance rank a)1) - (number of retries A)2) - (time delay A)3)
Or:
transmission grade is a1Importance level/(number of retries A)2+ delay time A3)
In the formula, A1、A2、A3Is a weight coefficient, and A1+A2+A3=1,A1>A2>A3
In an embodiment, the dynamic adjustment module adjusts the retry message tree according to the resending condition of the message with the highest rank, and performs the following operations:
if the message with the highest grade fails to be retransmitted, the retry times and the delay time of the message are updated, and after the retry times are judged not to exceed the retry times threshold value, the transmission grade is recalculated and inserted into a retry message tree.
The message resending device can execute the method provided by the embodiment of the application, and has the corresponding functional modules and the beneficial effects of the execution method.
It should be understood that, although the steps in the flowchart are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in the figures may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A message resending method is characterized in that each message carries a preset importance level, and the message resending method comprises the following steps:
calculating the sending grade of the message according to the important grade, the retry times and the delay time of the message;
inserting the message into a retry message tree according to the calculated transmission level of the message;
regularly taking out the message with the highest sending grade in the retry message tree for resending;
and adjusting the retry message tree according to the resending condition of the message with the highest sending grade.
2. The message resending method according to claim 1, wherein the threshold of the number of retries is set correspondingly according to the importance level of the message, wherein the threshold of the number of retries is positively correlated with the importance level of the message.
3. The message resending method according to claim 1, wherein before calculating the sending level of the message according to the importance level of the message, the retry number and the delay time, further comprising:
judging whether the retry times of the message exceed a retry time threshold, and if the retry times of the message exceed the retry time threshold, storing the message into a dead message queue; otherwise, the sending grade of the message is calculated according to the important grade, the retry times and the delay time of the message.
4. The method for resending a message according to claim 1, wherein said calculating a sending level of a message based on an importance level of the message, a number of retries, and a delay time comprises:
sending rank (importance rank a)1) - (number of retries A)2) - (time delay A)3)
Or:
transmission grade is a1Importance level/(number of retries A)2+ delay time A3)
In the formula, A1、A2、A3Is a weight coefficient, and A1+A2+A3=1,A1>A2>A3
5. The method for resending a message according to claim 1, wherein said adjusting a retry message tree according to the resending condition of the message with the highest rank comprises:
if the message with the highest grade fails to be retransmitted, the retry times and the delay time of the message are updated, and after the retry times are judged not to exceed the retry times threshold value, the transmission grade is recalculated and inserted into a retry message tree.
6. A message resending device, each message carrying a preset importance level, the message resending device comprising:
the level calculation module is used for calculating the sending level of the message according to the important level, the retry times and the delay time of the message;
a message writing module for inserting the message into a retry message tree according to the calculated sending level of the message;
the resending module is used for regularly taking out the message with the highest sending grade in the retry message tree for resending;
and the dynamic adjusting module is used for adjusting the retry message tree according to the resending condition of the message with the highest sending grade.
7. The message resending device as claimed in claim 6, wherein the threshold of the number of retries is set correspondingly according to the importance level of the message, wherein the threshold of the number of retries is positively correlated with the importance level of the message.
8. The message resending device as claimed in claim 6, wherein before calculating the sending level of the message according to the importance level, the retry number and the delay time of the message, the level calculation module further performs the following operations:
judging whether the retry times of the message exceed a retry time threshold, and if the retry times of the message exceed the retry time threshold, storing the message into a dead message queue; otherwise, the sending grade of the message is calculated according to the important grade, the retry times and the delay time of the message.
9. The message resending device as claimed in claim 6, wherein said level calculation module calculates the sending level of the message according to the importance level of the message, the retry number and the delay time, and performs the following operations:
sending rank (importance rank a)1) - (number of retries A)2) - (time delay A)3)
Or:
transmission grade is a1Importance level/(number of retries A)2+ delay time A3)
In the formula, A1、A2、A3Is a weight coefficient, and A1+A2+A3=1,A1>A2>A3
10. The message resending device as claimed in claim 6, wherein the dynamic adjustment module adjusts the retry message tree according to the resending condition of the message with the highest rank, and performs the following operations:
if the message with the highest grade fails to be retransmitted, the retry times and the delay time of the message are updated, and after the retry times are judged not to exceed the retry times threshold value, the transmission grade is recalculated and inserted into a retry message tree.
CN202010862426.3A 2020-08-25 2020-08-25 Message resending method and device Pending CN114117287A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010862426.3A CN114117287A (en) 2020-08-25 2020-08-25 Message resending method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010862426.3A CN114117287A (en) 2020-08-25 2020-08-25 Message resending method and device

Publications (1)

Publication Number Publication Date
CN114117287A true CN114117287A (en) 2022-03-01

Family

ID=80374007

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010862426.3A Pending CN114117287A (en) 2020-08-25 2020-08-25 Message resending method and device

Country Status (1)

Country Link
CN (1) CN114117287A (en)

Similar Documents

Publication Publication Date Title
WO2019148568A1 (en) Method and system for sending request for acquiring data resource
EP3528440A1 (en) Path selection method and system, network acceleration node, and network acceleration system
CN106790340B (en) Link scheduling method and device
WO2023050901A1 (en) Load balancing method and apparatus, device, computer storage medium and program
US7924721B2 (en) Communication apparatus, transmission control method, and transmission control program
CN109962760B (en) Service scheduling method suitable for wireless TDMA ad hoc network
CN106230997B (en) Resource scheduling method and device
US20070086367A1 (en) Down-link data transmission and receiving system and method of ARQ in wireless communication system
CN110460534B (en) Method, device, equipment and storage medium for reporting request message
CN103634224A (en) Method and system for transmitting data in network
CN111030945B (en) Disaster recovery method, disaster recovery gateway, storage medium, device and system
CN102891809B (en) Multi-core network device message presses interface order-preserving method and system
CN113225196B (en) Service level configuration method and device
CN102479159A (en) Caching method and equipment of multi-process HARQ (Hybrid Automatic Repeat Request) data
CN108449270A (en) Buffer memory management method priority-based in opportunistic network
CN112104568B (en) Data transmission control method and gateway
US10469328B2 (en) Opportunistic forwarding method of using delay tolerant network for content-based information centric network and apparatus for performing the method
CN109525376A (en) Fast retransmission method, apparatus and terminal device
US20160286434A1 (en) Method and Device for Controlling Processing Load of a Network Node
CN111629074B (en) Session sequencing method and device of gateway equipment
CN114117287A (en) Message resending method and device
CN1210919C (en) Data flow control method in data insertion equipment
US8271634B2 (en) Buffer system for managing service measurement requests
US9185059B1 (en) Management of journaling destinations
CN114968507B (en) Image processing task scheduling method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination