Message transmission control method and device, electronic equipment and storage medium

By grouping messages by length and setting a discard control value, the problem of low probability of long messages obtaining tokens in the token bucket is solved, enabling efficient transmission of long messages and improving user experience.

CN121357104APending Publication Date: 2026-01-16CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511510357.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2026-01-16

AI Technical Summary

Technical Problem

In rate-limited scenarios, when messages of mixed lengths are used, the probability of long messages obtaining a token is much lower than that of short messages, resulting in too many long messages being discarded, which affects the business experience.

Method used

By dividing messages into different sets according to their length, calculating the token offset value for each set, and setting a drop control value for the target message set, the probability of dropping messages of different lengths is controlled, thereby increasing the chance of long messages obtaining tokens.

Benefits of technology

It effectively reduces the long message drop rate, improves the long message transmission success rate, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121357104A_ABST
    Figure CN121357104A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a message transmission control method and device, electronic equipment and a storage medium so as to reduce the long message discarding rate. The method comprises the following steps: for each message set, determining a token offset value corresponding to the message set according to the number of messages in the message set; wherein the token deviation value is positively correlated with the probability that the token is acquired by the corresponding message set; the messages in each message set belong to the same message length range, and different message sets correspond to different message length ranges; setting a discarding control value in a first preset value range for each message in the target message set; the target message set is a message set of which the corresponding token deviation value exceeds a first preset threshold value; the probability that the discarding control value exceeds a second preset threshold value is positively correlated with the corresponding token deviation value; and for each message in the target message set, carrying out transmission control on the message according to a comparison result of the discarding control value of the message and a second preset threshold value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network security technology, and in particular to a control method, apparatus, electronic device and storage medium for message transmission. Background Technology

[0002] In the field of data communication, the token bucket is a commonly used network traffic control and shaping mechanism used to manage network traffic transmission rates and ensure that the transmission rate meets preset bandwidth limits. A preset number of tokens are added to the token bucket at a fixed rate. Each token authorizes its holder to send a fixed-size data unit (e.g., 1 byte). For example, when a data packet of length n bytes is ready to be sent, if there are n tokens in the token bucket, the packet is allowed to be sent, and n tokens are deducted from the token bucket. If there are fewer than n tokens in the token bucket, the data packet is delayed, dropped, or queued. Therefore, by using tokens as virtual credentials, long-term average bandwidth and short-term burst traffic can be balanced, enabling flexible control of network traffic.

[0003] However, in rate-limited scenarios and when network traffic consists of mixed-length packets, the probability of long packets obtaining a token is much lower than that of short packets when accessing the token bucket because the remaining available tokens in the token bucket are always scarce. This leads to the problem of excessive long packet dropping, resulting in high latency and increased packet loss rate for long packet-related services (such as video playback and file transfer), and a reduced user experience for users of long packet-related services.

[0004] Therefore, how to effectively reduce the long message discard rate is an urgent problem to be solved. Summary of the Invention

[0005] This application provides a message transmission control method, apparatus, electronic device, and storage medium to reduce the long message drop rate.

[0006] In a first aspect, embodiments of this application provide a message transmission control method, including: For each message set, a token offset value corresponding to the message set is determined based on the number of messages in the message set; wherein, the token offset value is positively correlated with the probability of obtaining a token for the corresponding message set; the messages in each message set belong to the same message length range, and the message length ranges corresponding to different message sets are different; A drop control value within a first preset numerical range is set for each message in the target message set; the target message set is the set of messages whose corresponding token offset values ​​exceed a first preset threshold; the probability that the drop control value exceeds a second preset threshold is positively correlated with the corresponding token offset value; the first preset threshold and the second preset threshold may be the same or different; For each message in the target message set, transmission control is performed on the message based on the comparison result between the message's drop control value and the second preset threshold.

[0007] Secondly, embodiments of this application provide a message transmission control device, including: The determining unit is used to determine the token offset value corresponding to each message set based on the number of messages in the message set; wherein the token offset value is positively correlated with the probability of obtaining a token for the corresponding message set; the messages in each message set belong to the same message length range, and the message length ranges corresponding to different message sets are different; The first setting unit is used to set a drop control value within a first preset numerical range for each message in the target message set; the target message set is the message set whose corresponding token offset value exceeds the first preset threshold; the probability that the drop control value exceeds the second preset threshold is positively correlated with the corresponding token offset value; the first preset threshold and the second preset threshold may be the same or different. A transmission control unit is used to control the transmission of each message in the target message set based on a comparison between the message's drop control value and a second preset threshold.

[0008] In some embodiments, the determining unit is specifically used for: Determine the first ratio of the initial number of messages in the message set to the initial total number of messages in each message set when the token bucket process is started; Determine a second ratio of the current number of messages in the message set to the current total number of messages in each message set; The difference between the second ratio and the first ratio is used as the token offset value.

[0009] In some embodiments, the first setting unit is specifically used for: Generate a random number within a second preset value range; the token offset value is within the second preset value range; If the random number does not exceed the token offset value, then random sampling is performed within the third preset value range, and the sampling result is used as the discard control value; the third preset value range is the range of values ​​that exceed the second preset threshold within the first preset value range; If the random number exceeds the token offset value, random sampling is performed within the fourth preset value range, and the sampling result is used as the discard control value; the fourth preset value range is the value range within the first preset value range that does not exceed the second preset threshold.

[0010] In some embodiments, before the determining unit determines the token offset value corresponding to each message set based on the number of messages in the message set, the apparatus further includes: The partitioning unit is used to partition each message to be transmitted according to multiple preset message length ranges each time the preset discard conditions are met, to obtain multiple message sets and start the token bucket process. The preset discard conditions include at least one of the following: The probability of a message in at least one message set obtaining the token is reduced to a third preset threshold. The average transmission rate of the total messages in each message set exceeds a preset bandwidth threshold.

[0011] In some embodiments, the transmission control unit is specifically used for: If the message's discard control value exceeds the second preset threshold, the message will be discarded. If the message's discard control value does not exceed the second preset threshold, then a token is issued for the message.

[0012] In some embodiments, the apparatus further includes: The second setting unit is used to set a drop control value less than the second preset threshold for each message in other message sets besides the target message set, so that each message in the other message sets can obtain a token.

[0013] Thirdly, embodiments of this application provide an electronic device, including: Memory, used to store program instructions; The processor is used to call the program instructions stored in the memory and execute the above-mentioned message transmission control method according to the obtained program instructions.

[0014] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the aforementioned message transmission control method.

[0015] Fifthly, embodiments of this application provide a computer program product, including a computer program stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the electronic device to perform the aforementioned message transmission control method.

[0016] This application provides a message transmission control method, apparatus, electronic device, and storage medium. By dividing messages into message sets according to their length and counting the number of messages in each message set, the token deviation value of messages with different length ranges can be effectively counted. By setting a discard control value for target message sets whose token offset exceeds a first preset threshold, the discarding of messages of different lengths can be controlled. By discarding some short messages in advance, the probability of other long messages obtaining tokens in the token bucket can be increased, effectively avoiding the problem of excessive discarding of long messages. Attached Figure Description

[0017] Figure 1 This is a schematic diagram illustrating an application scenario of a message transmission control method provided in an embodiment of this application. Figure 2 A flowchart illustrating an implementation of a message transmission control method provided in this application embodiment; Figure 3 A schematic diagram illustrating a speed limit provided for an embodiment of this application; Figure 4 A flowchart illustrating the implementation of another message transmission control method provided in this application embodiment; Figure 5 This is a schematic diagram of the structure of an electronic device for a message transmission control method according to an embodiment of this application; Figure 6 This is a schematic diagram of the hardware structure of an electronic device using an embodiment of this application; Figure 7 This is a schematic diagram of the hardware structure of a computing device according to an embodiment of this application. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] The following describes some of the concepts involved in the embodiments of this application.

[0020] 1. Token: In the field of data communication, a token is a virtual authorization credential that represents permission to use network bandwidth. Each token typically authorizes its holder to send a fixed-size data unit (e.g., a 1-byte numeric unit). Tokens are often used as a control mechanism to regulate the rate at which data packets are injected into the network.

[0021] 2. Token Bucket: A classic algorithm based on a token mechanism used for network traffic shaping and rate limiting. Its function is to ensure that the transmission behavior of data streams conforms to predefined bandwidth specifications, mainly including the token bucket injection rate and bucket capacity.

[0022] 3. Discard control value: In this embodiment, it is a controlled random number. The probability that the discard control value is greater than the second preset threshold is related to the token offset value. Therefore, for each target message set, when the token offset value is different, the probability that the discard control value of the message is greater than the second preset threshold is also different. This is so that a token can be issued to the message or the message can be discarded according to the relationship between the discard control value and the second preset threshold.

[0023] It should be noted that the application scenarios described in the following embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0024] The following is a brief introduction to the application scenarios to which the technical solutions of the embodiments of this application are applicable. It should be noted that the application scenarios described below are only for illustrating the embodiments of this application and are not intended to limit the scope. In specific implementation, the technical solutions provided by the embodiments of this application can be flexibly applied according to actual needs.

[0025] like Figure 1 The diagram illustrates an application scenario of a message transmission control method provided in this application embodiment. The application scenario diagram includes a message set partitioning module 110, a message set quantity statistics module 120, a message discarding policy module 130, and a message acquisition token module 140.

[0026] Specifically, the message set division module 110 divides the message into multiple message sets according to the message length. For each message set, the message set count module 120 determines the token offset value corresponding to the message set based on the number of messages in the message set. The message discarding policy module 130 sets a discarding control value within a first preset value range for each message in the target message set. For each message in the target message set, the message acquisition token module 140 performs transmission control on the message based on the comparison result between the message discarding control value and the second preset threshold.

[0027] In one optional implementation, the message set partitioning module 110, the message set quantity statistics module 120, the message discarding policy module 130, and the message acquisition token module 140 can communicate with each other through a communication network.

[0028] In one alternative implementation, the communication network is a wired network or a wireless network.

[0029] Figure 2 A flowchart of a message transmission control method provided in an embodiment of this application is shown, such as... Figure 2 As shown, the method may include the following steps S201~S203: S201: For each message set, determine the token offset value corresponding to the message set based on the number of messages in the message set.

[0030] Among them, the token offset value is positively correlated with the probability of obtaining a token in the corresponding message set; the messages in each message set belong to the same message length range, and the message length ranges corresponding to different message sets are different.

[0031] The message transmission control method provided in this application is essentially a message discarding method for messages of different lengths. Therefore, it is necessary to first classify the messages according to their length.

[0032] In one optional implementation, before determining the token offset, this embodiment of the application first classifies the message using the following method: Each time the preset discard conditions are met, the packets to be transmitted are partitioned according to multiple preset packet length ranges to obtain multiple packet sets and start the token bucket process.

[0033] The preset discarding conditions in this application embodiment include at least one of the following: Condition 1: The probability of a message in at least one message set obtaining a token is reduced to the third preset threshold.

[0034] Specifically, since the probability of a long message obtaining a token is much lower than that of a short message, in order to utilize the message transmission control method provided in this application embodiment when a long message fails to obtain a token, this application embodiment can set a preset discard condition to reduce the probability of a message in at least one message set obtaining a token to a third preset threshold. In practice, it is often the message set with a larger message length range that has a lower probability of obtaining a token.

[0035] The third preset threshold can be set in advance according to actual needs, for example, it can be 50%, 60%, etc.

[0036] Condition 2: The average transmission rate of the total number of messages in each message set exceeds the preset bandwidth threshold.

[0037] Specifically, the preset bandwidth threshold can be set as needed, for example, it can be 80Mbps, 100Mbps, etc.

[0038] In addition, the control method for message transmission can also be executed periodically in the embodiments of this application, for example, every 2 hours, 1 day, etc.

[0039] Specifically, after the above-mentioned preset discarding conditions are met, this application embodiment defines a method for classifying and counting messages according to multiple preset message length ranges. For example, messages can be divided according to the number of bytes, resulting in message sets corresponding to the five message length ranges of [64,128], [129,256], [257,512], [513,1024], and [>1024].

[0040] In the above embodiments, this application defines a method for classifying messages according to message length, so as to facilitate subsequent partitioning, statistics and summarization of message counts in the initial stage and other stages of the token bucket process.

[0041] After dividing the message set, this embodiment of the application can determine the token offset value of the message set by counting the number of messages in the message set, specifically using the following implementation method: Determine a first ratio of the initial number of messages in the message set to the initial total number of messages in each message set when starting the token bucket process; determine a second ratio of the current number of messages in the message set to the current total number of messages in each message set; and use the difference between the second ratio and the first ratio as the token offset value.

[0042] Specifically, in this embodiment, the number of messages in the initial and current stages of the token bucket initiation process is statistically analyzed and summarized by region. By statistically analyzing the number of messages based on message sets, the token offset value for acquiring tokens in different message sets can be effectively calculated.

[0043] As shown in Formula 1 below: (Formula 1) Among them, S N S represents the number of packets in the initial set N of the token bucket process, indicating the initial number of packets. total This indicates the initial total number of messages in the initial stage of initiating the token bucket process. The first ratio, This indicates the current number of messages in message set N. This indicates the current total number of messages in each message set. This is the second ratio. This represents the token offset value between the initial stage and the current stage of the message set N.

[0044] It should be noted that the current stage can be any moment after the token bucket process is started, or it can be the moment after a message obtains a token.

[0045] S202: Set a drop control value within a first preset range for each message in the target message set.

[0046] The target message set is the set of messages whose corresponding token offset values ​​exceed the first preset threshold.

[0047] In the embodiments of this application, The value range is from -1 to 1, therefore, the first preset threshold can be set to 0. >0 indicates that the relative probability of a message in message set N successfully obtaining a token is relatively high; A value less than 0 indicates that the relative probability of a message in message set N successfully obtaining a token is low. This embodiment of the application requires discarding messages from the message set with a relatively high probability of obtaining a token; therefore, [the following is omitted as the original text is incomplete and cannot be translated]. The set of messages with a value greater than 0 is designated as the target message set, and the subsequent message discarding process is performed on the target message set.

[0048] In this embodiment of the application, the first preset numerical range can be related to... The value ranges are the same. The probability of discarding a control value exceeding the second preset threshold is positively correlated with the corresponding token offset value; the first preset threshold may be the same as or different from the second preset threshold.

[0049] In subsequent steps, the second preset threshold and the first preset threshold are the same, and both are 0, as an example.

[0050] In one optional implementation, when setting a drop control value within a first preset numerical range for each packet in the target packet set, the specific implementation method is as follows: Generate a random number within a second preset value range; if the random number does not exceed the token offset value, randomly sample within a third preset value range and use the sampled result as the discard control value; if the random number exceeds the token offset value, randomly sample within a fourth preset value range and use the sampled result as the discard control value.

[0051] The third preset value range is the range of values ​​that exceed the second preset threshold within the first preset value range; the fourth preset value range is the range of values ​​that do not exceed the second preset threshold within the first preset value range; the token offset value is within the second preset value range.

[0052] In this embodiment of the application, the second preset value range may be the same as the first preset value range. For example, the second preset value range may be -1 to 1, the third preset value range may be (0,1], and the fourth preset value range may be [-1,0].

[0053] Assuming the token offset is 0.6, if the generated random number is 0.4, then random sampling will be performed in (0,1], and the sampling result will be used as the discard control value. Therefore, this discard control value will necessarily exceed the second preset threshold. If the generated random number is 0.8, then random sampling will be performed in [-1,0], and the sampling result will be used as the discard control value. Therefore, this discard control value will necessarily not exceed the second preset threshold.

[0054] Using this method to set the discard control value makes it possible to... When the value is greater than 0, the probability of setting the discard control value to be greater than 0 is equal to... value.

[0055] In one optional implementation, for message sets other than the target message set, the following implementation method is used to set the drop control value: For message sets other than the target message set, set a drop control value less than the second preset threshold for each message in the other message set, so that each message in the other message set can obtain a token.

[0056] Specifically, other message sets If the value is ≤0, a drop control value less than 0 is set for each message in the other message set. In subsequent steps, a token will be issued to the message with a drop control value less than 0.

[0057] S203: For each message in the target message set, perform transmission control on the message based on the comparison result between the message's drop control value and the second preset threshold.

[0058] Specifically, if the message's discard control value exceeds the second preset threshold, the message will be discarded; if the message's discard control value does not exceed the second preset threshold, a token will be issued to the message.

[0059] In the steps described above, for packets in other packet sets with a low probability of obtaining a token, a drop control value less than 0 is set, and these packets will then obtain a token. For packets in the target packet set with a high probability of obtaining a token, a drop control value is set based on the token offset value of the target packet set, thus reducing the proportion of packets in the target packet set with a higher probability of obtaining a token that will subsequently obtain a token.

[0060] The specific implementation method is as follows: (1) such as Figure 3 As shown, a certain service is set to a lower speed limit, such as 100Kbps, for specific reasons.

[0061] (2) To ensure that services with different message lengths can obtain the corresponding bandwidth proportionally, the token bucket process is enabled.

[0062] (3) Based on the classic bytes, five message length ranges are preset, namely [64,128], [129,256], [257,512], [513,1024], and [>1024]. When starting the token bucket process, the initial message count and the total initial message count of each message set are counted.

[0063] (4) After starting the token bucket process, calculate the token offset value for each message set. Messages located in partition [64,128] are shorter and more likely to successfully acquire tokens, resulting in a larger token offset value for message set [64,128], assumed to be 0.8. Other message sets, such as message set [>1024], have smaller token offset values, less than 0.

[0064] (5) Set a drop control value less than 0 for other message sets. The probability that the drop control value set for message set [64,128] exceeds the second preset threshold is 0.8. Therefore, the messages in this message set are randomly dropped and cannot enter the token acquisition process.

[0065] In the above embodiments, this application employs a method for discarding messages of different lengths to control the discarding of messages of varying lengths. The existing token bucket process is improved by combining a token offset value and a pseudo-random number (i.e., the discard control value in this application embodiment). This method randomly discards some short messages in advance, increasing the probability of long messages obtaining tokens in the token bucket and effectively avoiding the problem of excessive long message discarding.

[0066] like Figure 4 The diagram shown is an implementation flowchart of another message transmission control method provided in this application embodiment.

[0067] S401: Start; S402: Determine whether the token offset value exceeds the first preset threshold; Figure 4 In the middle, the first preset threshold is 0, if If the value is greater than 0, then execute S403; otherwise, execute S406.

[0068] S403: Set the discard control value according to the token offset value; S404: Determine whether the discard control value exceeds the second preset threshold; Figure 4 In this process, the second preset threshold is 0. If the discard control value is greater than 0, then S408 is executed; otherwise, S405 is executed.

[0069] S405: Issues a token for the message; S406: Determine if the message has acquired a sufficient number of tokens; If the message receives a sufficient number of tokens, proceed to step S407; otherwise, proceed to step S408. S407: Transmit message; S408: Discard message; S409: End.

[0070] Based on the same inventive concept, this application also provides a message transmission control device, such as... Figure 5 As shown, the control device 5000 for message transmission includes: The determining unit 5001 is used to determine the token offset value corresponding to each message set based on the number of messages in the message set; wherein, the token offset value is positively correlated with the probability of obtaining a token for the corresponding message set; the messages in each message set belong to the same message length range, and the message length ranges corresponding to different message sets are different; The first setting unit 5002 is used to set a drop control value within a first preset numerical range for each message in the target message set; the target message set is the message set whose corresponding token offset value exceeds the first preset threshold; the probability of the drop control value exceeding the second preset threshold is positively correlated with the corresponding token offset value; the first preset threshold and the second preset threshold may be the same or different. The transmission control unit 5003 is used to control the transmission of each message in the target message set based on the comparison result between the message's discard control value and a second preset threshold.

[0071] In some embodiments, the determining unit 5001 is specifically used for: Determine the first ratio of the initial number of messages in the message set when starting the token bucket process to the initial total number of messages in each message set; Determine the second ratio of the current number of messages in a message set to the current total number of messages in each message set; The difference between the second ratio and the first ratio is used as the token offset value.

[0072] In some embodiments, the first setting unit 5002 is specifically used for: Generate a random number within the second preset value range; the token offset value is within the second preset value range; If the random number does not exceed the token offset value, random sampling will be performed within the third preset value range, and the sampling result will be used as the discard control value; the third preset value range is the value range that exceeds the second preset threshold within the first preset value range. If the random number exceeds the token offset value, random sampling will be performed within the fourth preset value range, and the sampling result will be used as the discard control value; the fourth preset value range is the value range within the first preset value range that does not exceed the second preset threshold.

[0073] In some embodiments, before the determining unit 5001 determines the token offset value corresponding to each message set based on the number of messages in the message set, the apparatus further includes: Partitioning unit 5004 is used to partition each message to be transmitted according to multiple preset message length ranges each time the preset discard conditions are met, to obtain multiple message sets and start the token bucket process. The preset discard conditions include at least one of the following: The probability of a message in at least one message set obtaining a token is reduced to a third preset threshold. The average transmission rate of all messages in each message set exceeds the preset bandwidth threshold.

[0074] In some embodiments, the transmission control unit 5003 is specifically used for: If the message dropping control value exceeds the second preset threshold, the message will be dropped. If the message drop control value does not exceed the second preset threshold, a token is issued to the message.

[0075] In some embodiments, the apparatus further includes: The second setting unit 5005 is used to set a drop control value less than a second preset threshold for each message in other message sets besides the target message set, so that each message in other message sets can obtain a token.

[0076] Based on the same inventive concept, this application also provides an electronic device. In this embodiment, the structure of the electronic device can be as follows: Figure 6 As shown, it includes a memory 601, a communication module 603, and one or more processors 602.

[0077] The memory 601 is used to store computer programs executed by the processor 602. The memory 601 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and programs required to run instant messaging functions, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0078] Memory 601 may be volatile memory, such as random-access memory (RAM); memory 601 may also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 601 may be any other medium capable of carrying or storing a desired computer program having the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 601 may be a combination of the above-described memories.

[0079] Processor 602 may include one or more central processing units (CPUs) or digital processing units, etc. Processor 602 is used to implement the above-described message transmission control method when calling the computer program stored in memory 601.

[0080] The communication module 603 is used to communicate with terminal devices and other servers.

[0081] This application embodiment does not limit the specific connection medium between the memory 601, communication module 603, and processor 602 described above. This application embodiment... Figure 6 The memory 601 and the processor 602 are connected via a bus 604, and the bus 604 is in Figure 6 The diagram uses thick lines to describe the connections between other components; these are for illustrative purposes only and should not be considered limiting. The 604 bus can be divided into address bus, data bus, control bus, etc. For ease of description, Figure 6 It is described using only a thick line, but does not indicate that there is only one bus or one type of bus.

[0082] The memory 601 stores a computer storage medium containing computer-executable instructions for implementing the message transmission control method of this application embodiment. The processor 602 executes the aforementioned message transmission control method. Based on the same inventive concept, this application embodiment provides a computer-readable storage medium, the computer program product including: computer program code, which, when run on a computer, causes the computer to execute any of the message transmission control methods discussed above. Since the principle by which the above-described computer-readable storage medium solves the problem is similar to that of the message transmission control method, the implementation of the above-described computer-readable storage medium can be referred to the implementation of the method, and repeated details will not be elaborated further.

[0083] The following reference Figure 7 To describe a computing device 700 according to this embodiment of the present application. Figure 7 The computing device 700 is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0084] like Figure 7 The computing device 700 is manifested in the form of a general-purpose computing device. The components of the computing device 700 may include, but are not limited to: at least one processing unit 701, at least one storage unit 702, and a bus 703 connecting different system components (including storage unit 702 and processing unit 701).

[0085] Bus 703 represents one or more of several bus architectures, including a memory bus or memory controller, peripheral bus, processor, or a local bus using any of the various bus architectures.

[0086] Storage unit 702 may include a readable medium in the form of volatile memory, such as random access memory (RAM) 721 and / or cache memory 722, and may further include read-only memory (ROM) 723.

[0087] Storage unit 702 may also include a program / utility 725 having a set (at least one) of program modules 724, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0088] The computing device 700 can also communicate with one or more external devices 704 (e.g., keyboard, pointing device, etc.), and with one or more devices that enable a user to interact with the computing device 700, and / or with any device that enables the computing device 700 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via the input / output (I / O) interface 705. Furthermore, the computing device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via a network adapter 707. Figure 7 As shown, network adapter 707 communicates with other modules used in computing device 700 via bus 703. It should be understood that, although not shown in the figures, other hardware and / or software modules may be used in conjunction with computing device 700, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0089] This application also provides a computer program product. The methods in this application can be implemented, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software, they can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the processes or functions described in this application are executed, in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, network equipment, user equipment, core network equipment, OAM, or other programmable devices.

[0090] A computer-readable storage medium can be an implementation of a computer program product. In other words, this application also provides a computer-readable storage medium that includes a computer program, which, when executed by a processor, implements any of the message transmission control methods described above.

[0091] The computer program or instructions may be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program or instructions may be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; or an optical medium, such as a digital video optical disc; or a semiconductor medium, such as a solid-state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.

[0092] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0093] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0094] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0095] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0096] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A control method for message transmission, characterized in that, The method includes: For each message set, a token offset value corresponding to the message set is determined based on the number of messages in the message set; wherein, the token offset value is positively correlated with the probability of obtaining a token for the corresponding message set; the messages in each message set belong to the same message length range, and the message length ranges corresponding to different message sets are different; A drop control value within a first preset numerical range is set for each message in the target message set; the target message set is the set of messages whose corresponding token offset values ​​exceed a first preset threshold; the probability that the drop control value exceeds a second preset threshold is positively correlated with the corresponding token offset value; the first preset threshold and the second preset threshold may be the same or different; For each message in the target message set, transmission control is performed on the message based on the comparison result between the message's drop control value and the second preset threshold.

2. The method as described in claim 1, characterized in that, The step of determining the token offset value corresponding to the message set based on the number of messages in the message set includes: Determine the first ratio of the initial number of messages in the message set to the initial total number of messages in each message set when the token bucket process is started; Determine a second ratio of the current number of messages in the message set to the current total number of messages in each message set; The difference between the second ratio and the first ratio is used as the token offset value.

3. The method as described in claim 1, characterized in that, The step of setting a drop control value within a first preset numerical range for each packet in the target packet set includes: Generate a random number within a second preset value range; the token offset value is within the second preset value range; If the random number does not exceed the token offset value, then random sampling is performed within the third preset value range, and the sampling result is used as the discard control value; the third preset value range is the range of values ​​that exceed the second preset threshold within the first preset value range; If the random number exceeds the token offset value, random sampling is performed within the fourth preset value range, and the sampling result is used as the discard control value; the fourth preset value range is the value range within the first preset value range that does not exceed the second preset threshold.

4. The method as described in claim 1, characterized in that, Before determining the token offset value corresponding to each message set based on the number of messages in the message set, the method further includes: Each time the preset discard condition is met, the packets to be transmitted are partitioned according to multiple preset packet length ranges to obtain multiple packet sets and start the token bucket process. The preset discard conditions include at least one of the following: The probability of a message in at least one message set obtaining the token is reduced to a third preset threshold. The average transmission rate of the total messages in each message set exceeds a preset bandwidth threshold.

5. The method as described in claim 1, characterized in that, The step of controlling the transmission of the message based on the comparison result between the message's discard control value and the second preset threshold includes: If the message's discard control value exceeds the second preset threshold, the message will be discarded. If the message's discard control value does not exceed the second preset threshold, then a token is issued for the message.

6. The method as described in claim 1, characterized in that, The method further includes: For message sets other than the target message set, a drop control value less than the second preset threshold is set for each message in the other message set, so that each message in the other message set obtains a token.

7. A control device for message transmission, characterized in that, include: The determining unit is used to determine the token offset value corresponding to each message set based on the number of messages in the message set; wherein the token offset value is positively correlated with the probability of obtaining a token for the corresponding message set; the messages in each message set belong to the same message length range, and the message length ranges corresponding to different message sets are different; The first setting unit is used to set a drop control value within a first preset numerical range for each message in the target message set; the target message set is the message set whose corresponding token offset value exceeds the first preset threshold; the probability that the drop control value exceeds the second preset threshold is positively correlated with the corresponding token offset value; the first preset threshold and the second preset threshold may be the same or different. A transmission control unit is used to control the transmission of each message in the target message set based on a comparison between the message's drop control value and a second preset threshold.

8. An electronic device, characterized in that, include: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.

10. A computer program product, characterized in that, The method includes a computer program stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the electronic device to perform the steps of the method according to any one of claims 1 to 6.