A method, device, system, apparatus and medium for processing message packet loss

By determining the memory space and recording packet loss information, the problem of packet loss not being recorded when the buffer queue is full was solved, thereby improving resource utilization efficiency and server stability.

CN116302607BActive Publication Date: 2025-11-25SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310224977.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-03
Publication Date
2025-11-25
Estimated Expiration
2043-03-03

AI Technical Summary

Technical Problem

In existing technologies, discarding message data packets when the buffer queue is full cannot accurately record packet loss, leading to resource waste and server instability.

Method used

By determining the available space in the memory, it decides whether to discard or store new messages and records packet loss information, including the type and quantity of packet loss, to avoid repeatedly sending the same packet loss information. The delay module prioritizes writing packet loss information.

Benefits of technology

Accurately record packet loss during message transmission to avoid resource waste and enhance server stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116302607B_ABST
    Figure CN116302607B_ABST
Patent Text Reader

Abstract

The application provides a method, device, system, equipment and readable medium for processing message loss, the method comprising: in response to the loss device receiving a new message, judging whether there is loss information to be sent in the loss device; in response to there being no loss information to be sent in the loss device, judging whether the available space of the memory is greater than the message size of the new message; in response to the available space of the memory being less than the message size of the new message, discarding the new message and writing the loss information of the new message into the memory. By using the scheme of the application, resource waste caused by multiple sending of the same loss information can be avoided, the loss of messages in the message transmission process and the number of losses can be accurately recorded, and the stability of the server can be enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computer, and more particularly to a method, device, system, equipment and readable medium for processing message packet loss. BACKGROUND

[0002] A message is information representing a certain state occurring in the process of program execution, and events occurring in the system can be transmitted through the message. The message is triggered by an event, and a message corresponding to the event is generated when the event is reached. The message can be classified into different types according to the importance, such as normal working messages and messages in abnormal situations. Usually, a system contains many components, and these components generate a large amount of message data. When a large number of events occur in the system at a certain moment, a large amount of messages are generated, and the bandwidth of the generated messages can be greater than the output bandwidth of the messages. This state can cause message sending to be blocked, which can affect the performance of the system. The message content that does not affect the normal work of the system can be actively discarded as needed, such as log information generated in the normal work of the system and barrage information in the video stream.

[0003] In the process of message transmission, when message data is waiting to be sent in the buffer queue, a queue management method of "discarding message data when the buffer queue is full" is adopted. That is, the buffer queue continuously receives the message data packets sent by the sending end. When the output rate of the buffer queue is less than the input rate, the data packets cached in the buffer queue will be more and more, and the cache space of the buffer queue will also be less and less, until the buffer queue has no remaining cache space. At this time, if the sending end has message data packets to send to the cache queue, the buffer queue will discard all the data packets sent by the sending end at this time. However, this packet loss method cannot know whether packet loss occurs between the two received messages and the number of packet loss. SUMMARY

[0004] Therefore, the purpose of the embodiments of the present application is to provide a method, device, system, equipment and readable medium for processing message packet loss. By using the technical solution of the present application, resource waste caused by multiple sending of the same packet loss information can be avoided, the occurrence of packet loss and the number of packet loss in the process of message transmission can be accurately recorded, and the stability of the server can be enhanced.

[0005] In order to achieve the above purpose, one aspect of an embodiment of the present application provides a method for processing message packet loss, comprising the following steps:

[0006] In response to the packet loss device receiving a new message, it is judged whether there is packet loss information to be sent in the packet loss device;

[0007] In response to the packet loss device having no packet loss information to be sent, it is judged whether the available space of the storage is greater than the message size of the new message;

[0008] In response to a situation where the available memory space is less than the message size of the new message, the new message is discarded and its loss information is written into memory.

[0009] According to one embodiment of the present invention, it further includes:

[0010] In response to a situation where the available memory space is greater than the message size of the new message, the new message is written to memory.

[0011] According to one embodiment of the present invention, it further includes:

[0012] In response to packet loss information waiting to be sent inside the packet loss device, determine whether the available space in the memory is greater than or equal to the sum of the message size of the new message and the size of the lost packet information;

[0013] In response to a situation where the available memory space is greater than or equal to the sum of the size of the new message and the size of the lost packet information, the lost packet information and the new message are written into memory.

[0014] According to one embodiment of the present invention, it further includes:

[0015] In response to packet loss information waiting to be sent inside the packet loss device, determine whether the available space in the memory is greater than or equal to the sum of the message size of the new message and the size of the lost packet information;

[0016] In response to a situation where the available memory space is less than the sum of the message size of the new message and the size of the packet loss information, it is determined whether the message type of the new message is consistent with the packet loss type of the packet loss information;

[0017] If the message type of the new message is consistent with the packet loss type in the packet loss information, the new message is discarded and the packet loss count in the packet loss information is incremented by 1 and written to the memory.

[0018] According to one embodiment of the present invention, it further includes:

[0019] If the message type of a new message is inconsistent with the packet loss type of the packet loss information, determine whether the available storage space is greater than or equal to the size of the packet loss information.

[0020] In response to a situation where the available memory space is greater than or equal to the size of the lost packet information, the lost packet information is written into the memory, and the lost packet information of the new message is recorded as the new lost packet information to be sent.

[0021] According to one embodiment of the present invention, it further includes:

[0022] In response to the available memory space being less than the size of the lost packet information, the lost packet information and the new message are discarded, and the lost packet information of the new message is recorded as the new lost packet information to be sent.

[0023] According to one embodiment of the present invention, it further includes:

[0024] Mark the various types of packet loss flags in the new packet loss information to be sent.

[0025] According to an embodiment of the present invention, the format of packet loss information includes packet loss information flag, packet loss type, packet loss count and multi-type packet loss flag, wherein the packet loss information flag is used to indicate that the message is packet loss information, the packet loss type is used to record the type of current packet loss, the packet loss count is used to record the number of packets lost under the current packet loss type, and the multi-type packet loss flag is used to indicate that multiple different types of packet loss have occurred.

[0026] Another aspect of the present invention provides an apparatus for processing message packet loss, the apparatus comprising:

[0027] The controller is configured to receive new messages and process them based on the relationship between available memory space and the message size of the new message.

[0028] The memory is configured to store new messages or packet loss information and to provide real-time feedback of available memory space to the controller.

[0029] The memory read module is configured to read messages or packet loss information stored in the memory and output them.

[0030] According to one embodiment of the present invention, the controller includes:

[0031] A comparator configured to compare the size of a newly received message with the available memory space.

[0032] A packet loss information caching unit is provided, with its input connected to a comparator and configured to store the packet loss information output by the comparator.

[0033] A message buffer unit, the input of which is connected to a comparator and configured to store the messages output by the comparator;

[0034] The delay unit has its input connected to the output of the message buffer unit and is configured to delay the delivery of messages output by the message buffer unit.

[0035] The selector has its inputs connected to the packet loss information buffer unit and the delay unit, respectively, and is configured to output the message output by the message buffer unit or the packet loss information output by the packet loss information buffer unit to the memory.

[0036] Another aspect of the embodiments of the present invention also provides a system for handling message packet loss, the system comprising:

[0037] The first judgment module is configured to determine whether there is any packet loss information to be sent inside the packet loss device in response to the packet loss device receiving a new message.

[0038] The second judgment module is configured to determine whether the available space in the memory is greater than the message size of the new message in response to the fact that there is no packet loss information to be sent in the packet loss device.

[0039] The processing module is configured to discard the new message and write the packet loss information of the new message into the memory in response to the available memory space being less than the message size of the new message.

[0040] Another aspect of the embodiments of the present invention also provides a computer device, the computer device comprising:

[0041] At least one processor; and

[0042] The memory stores computer instructions that can be executed by a processor, which, when executed by the processor, implement the steps of any of the methods described above.

[0043] In another aspect, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the above methods.

[0044] The present invention has the following beneficial technical effects: The method for handling message packet loss provided in the embodiments of the present invention, by responding to the packet loss device receiving a new message, determining whether there is packet loss information to be sent inside the packet loss device; responding to the packet loss device not having packet loss information to be sent, determining whether the available space of the memory is greater than the message size of the new message; and responding to the available space of the memory being less than the message size of the new message, discarding the new message and writing the packet loss information of the new message into the memory, can avoid the waste of resources caused by sending the same packet loss information multiple times, can accurately record whether packet loss occurs and the number of packet losses during message transmission, and can enhance the stability of the server. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.

[0046] Figure 1 This is a schematic flowchart illustrating a method for handling message packet loss according to an embodiment of the present invention;

[0047] Figure 2 This is a schematic diagram of an apparatus for processing message packet loss according to an embodiment of the present invention;

[0048] Figure 3 A schematic diagram of a controller according to an embodiment of the present invention;

[0049] Figure 4 This is a schematic diagram illustrating a write-only message to memory according to an embodiment of the present invention;

[0050] Figure 5 This is a schematic diagram illustrating the process of writing packet loss information and then writing the message to the memory according to an embodiment of the present invention.

[0051] Figure 6 This is a schematic diagram illustrating writing packet loss information to memory and recording new packet loss information according to an embodiment of the present invention;

[0052] Figure 7 This is a schematic diagram of a system for handling message packet loss according to an embodiment of the present invention;

[0053] Figure 8 This is a schematic diagram of a computer device according to an embodiment of the present invention;

[0054] Figure 9 This is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to specific examples and the accompanying drawings.

[0056] Based on the above objectives, a first aspect of the embodiments of the present invention provides an embodiment of a method for handling message packet loss. Figure 1 The diagram shown is a schematic flowchart of the method.

[0057] like Figure 1 As shown, the method may include the following steps:

[0058] S1 responds to the packet loss device receiving a new message by determining whether there is any packet loss information to be sent within the device. In addition to the message content, two signals, `size` and `type`, are defined within the message information. `size` represents the message size, and `type` represents the message type. The format of the packet loss information is also defined, including a packet loss information flag, a packet loss type, a packet loss count, and a multi-type packet loss flag. The packet loss information flag indicates that the message is packet loss information, the packet loss type records the current type of packet loss, the packet loss count records the number of packets lost under the current packet loss type, and the multi-type packet loss flag indicates that multiple different types of packet loss have occurred.

[0059] S2 responds to the fact that there is no lost packet information to be sent within the packet loss device, and determines whether the available space in the memory is greater than the message size of the new message. When a new message is received, if there is no lost packet information to be sent within the device, it determines whether the available space in the memory is greater than or equal to the message size of the new message.

[0060] S3 responds when the available memory space is less than the message size of the new message, discarding the new message and writing its packet loss information into memory. If the available memory space is less than the message size of the new message, meaning the memory can no longer store the message, then the new message is discarded, and its packet loss information is directly written into memory. In this way, the message receiver can know that a packet loss event occurred during message transmission and can determine the type and number of packets lost from the packet loss information.

[0061] By using the technical solution of the present invention, resource waste caused by sending the same packet loss information multiple times can be avoided, packet loss can be accurately recorded during message transmission and the number of packets lost, thereby enhancing server stability.

[0062] In a preferred embodiment of the present invention, it further includes:

[0063] If the available memory space is greater than the message size of the new message, the new message is written to memory. If the available memory space is greater than the message size of the new message, meaning the memory can store the new message, then the new message is written to memory directly.

[0064] In a preferred embodiment of the present invention, it further includes:

[0065] In response to packet loss information waiting to be sent inside the packet loss device, determine whether the available space in the memory is greater than or equal to the sum of the message size of the new message and the size of the lost packet information;

[0066] In response to the condition that the available memory space is greater than or equal to the sum of the size of the new message and the size of the lost packet information, the lost packet information and the new message are written into memory. If the packet loss device already has lost packet information to be sent, i.e., both lost packet information and the new message exist simultaneously, it is necessary to determine whether the available memory space is greater than or equal to the sum of the size of the new message and the size of the lost packet information. If the available memory space is greater than or equal to the sum of the size of the new message and the size of the lost packet information, i.e., the memory can store both the new message and the lost packet information simultaneously, then the lost packet information is written into memory first, and then the new message is written into memory.

[0067] In a preferred embodiment of the present invention, writing packet loss information and new messages into the memory includes:

[0068] Write the packet loss information into the memory;

[0069] In response to packet loss information being written to memory, a new message is written to memory.

[0070] In a preferred embodiment of the present invention, it further includes:

[0071] In response to packet loss information waiting to be sent inside the packet loss device, determine whether the available space in the memory is greater than or equal to the sum of the message size of the new message and the size of the lost packet information;

[0072] In response to a situation where the available memory space is less than the sum of the message size of the new message and the size of the packet loss information, it is determined whether the message type of the new message is consistent with the packet loss type of the packet loss information;

[0073] If the message type of the new message matches the packet loss type of the packet loss information, the new message is discarded, and the packet loss count in the packet loss information is incremented by 1 and written to memory. If the available memory space is less than the sum of the message size of the new message and the size of the packet loss information, meaning the memory cannot store the new message and the packet loss information simultaneously, then it is first determined whether the types of the new message and the packet loss information are the same. If they are the same, the new message is discarded, the packet loss count in the original packet loss information is incremented by 1, and the packet loss information is written to memory. In this case, the packet loss information indicates that two packet loss events of the same type have occurred.

[0074] In a preferred embodiment of the present invention, it further includes:

[0075] If the message type of a new message is inconsistent with the packet loss type of the packet loss information, determine whether the available storage space is greater than or equal to the size of the packet loss information.

[0076] In response to a situation where the available memory space is greater than or equal to the size of the lost packet information, the lost packet information is written into memory, and the lost packet information of the new message is recorded as the new lost packet information to be sent. If the message type of the new message is inconsistent with the lost packet type of the lost packet information, it is necessary to determine whether the available memory space is greater than or equal to the size of the lost packet information. If it is greater, it means that the memory can store the lost packet information. In this case, the original lost packet information is written into memory, the new message is discarded, and the lost packet information of the new message is recorded. The lost packet information of the new message will be stored in the next storage.

[0077] In a preferred embodiment of the present invention, it further includes:

[0078] In response to a situation where the available memory space is less than the size of the lost packet information, both the lost packet information and the new message are discarded, and the lost packet information of the new message is recorded as new lost packet information to be sent. If the available memory space is less than the size of the lost packet information, i.e., the memory cannot store the lost packet information, the original lost packet information is discarded, the lost packet information of the new message is recorded, and the multi-type lost packet flag in the lost packet information of the new message is marked to indicate that a multi-type lost packet event has occurred. At the same time, the lost packet count is incremented by 1 to indicate that two lost packet events have occurred.

[0079] In a preferred embodiment of the present invention, it further includes:

[0080] Mark the various types of packet loss flags in the new packet loss information to be sent.

[0081] In a preferred embodiment of the present invention, the format of the packet loss information includes a packet loss information flag, a packet loss type, a packet loss count, and a multi-type packet loss flag, wherein the packet loss information flag is used to indicate that the message is packet loss information, the packet loss type is used to record the type of the current packet loss, the packet loss count is used to record the number of packets lost under the current packet loss type, and the multi-type packet loss flag is used to indicate that multiple different types of packet loss have occurred.

[0082] This invention implements a method for handling message packet loss. It determines whether packet loss is necessary based on the message size and the remaining space in memory. A built-in packet loss information buffer records the type and quantity of packet loss information. If consecutive packet losses of the same type occur, only one packet loss message needs to be written to memory, avoiding multiple transmissions of the same packet loss information. By adding a delay module, packet loss information can be sent before message information, allowing the number of packet losses between two messages to be determined through parsing the final output message. Multiple packet loss flags within the packet loss message can analyze whether other types of packet loss have occurred. For the message receiver, there may be one or more packet loss messages between two normal messages. If it is a single packet loss message, the multiple packet loss flags within it determine whether multiple different types of packet loss have occurred. If not, the packet loss message records the packet loss type and quantity between the two normal messages. If multiple different types of packet loss have occurred, the packet loss message records the latest packet loss type and the quantity of that type of loss. If there are multiple lost packets between two normal messages, then each lost packet message should be parsed using the method described above.

[0083] Based on the above objectives, a second aspect of the embodiments of the present invention provides an apparatus for handling message packet loss, such as... Figure 2 As shown, the device includes:

[0084] The controller is configured to receive new messages and process them based on the relationship between available memory space and the message size. The controller's input signals are the message, its corresponding type and size information, and the remaining memory space. The output is a write-to-memory signal. If the available memory space is greater than the message size, the new message is written directly to memory. If the available memory space is less than the message size, the new message is discarded, and its loss information is written to memory.

[0085] The memory is configured to store new messages or packet loss information and provides real-time feedback of available memory space to the controller. The memory is used to store received messages or packet loss information and requires dedicated read and write interfaces, meaning reads and writes can occur simultaneously (e.g., FIFO, dual-port RAM). The memory write interface supports a rate no lower than the message input rate. The memory needs to output remaining space information to the comparator module. When the remaining memory space is less than the amount of data to be written, packet loss information is generated. The remaining memory space is the actual remaining memory space minus the amount of data cached in the controller.

[0086] The memory read module is configured to read messages or packet loss information stored in the memory and output them. This module reads the data stored in the memory and outputs it to the next level, which is the destination of the message content. The memory read rate is affected by the data receiving capability of the next level. The greater the data receiving capability of the next level, the less packet loss occurs, and vice versa.

[0087] In a preferred embodiment of the present invention, such as Figure 3 As shown, the controller includes:

[0088] A comparator configured to compare the size of a newly received message with the available memory space.

[0089] A packet loss information caching unit is provided, with its input connected to a comparator and configured to store the packet loss information output by the comparator.

[0090] A message buffer unit, the input of which is connected to a comparator and configured to store the messages output by the comparator;

[0091] The delay unit has its input connected to the output of the message buffer unit and is configured to delay the delivery of messages output by the message buffer unit.

[0092] The selector has its inputs connected to the packet loss information buffer unit and the delay unit, respectively, and is configured to output the message output by the message buffer unit or the packet loss information output by the packet loss information buffer unit to the memory.

[0093] When a new message is received, it first enters the comparator. The first case is that there is no data in the packet loss information buffer. In this case, the message size of the received new message is compared with the available memory space. If the available memory space is less than the message size, the new message is discarded, and its packet loss information is written to the packet loss information buffer. If the available memory space is greater than the message size, the new message is written to the message buffer. The second case is that the packet loss information buffer contains packet loss information. In this case, the available memory space is compared with the sum of the new message size and the size of the packet loss information. If the available memory space is greater than or equal to the sum of the new message size and the size of the packet loss information, the packet loss information is written to the packet loss information buffer, and the new message is also written to the message buffer. If the available memory space is less than the sum of the new message size and the size of the packet loss information, it is determined whether the message type of the new message matches the packet loss type in the packet loss information. If the message type matches, the new message is discarded, and the packet loss count in the packet loss information is incremented by 1. If the message type of the new message is inconsistent with the packet loss type of the packet loss information, it is determined whether the available memory space is greater than or equal to the size of the packet loss information. If the available memory space is greater than or equal to the size of the packet loss information, the packet loss information is written into the memory, and the packet loss information of the new message is written into the packet loss information cache unit. If the available memory space is less than the size of the packet loss information, the packet loss information and the new message are discarded, and the packet loss information of the new message is written into the packet loss information cache unit.

[0094] Since message input is not subject to backpressure from memory, and packet loss information needs to be written before message information, a delay module needs to be added to delay message information writing. Packet loss information is then sent to memory ahead of time using this delay, and the delay time is no less than the time it takes to write the packet loss information to memory. When there is no need to write packet loss information to memory, the message writing path is: message buffer unit -> delay unit -> selector -> memory. When both packet loss information and message information need to be written simultaneously, the message writing path is: message buffer unit -> select to write packet loss information -> delay unit (packet loss information written) -> select to write message -> memory. The specific cases are explained below:

[0095] 1. Upon receiving a message, if there is no packet loss information to be sent internally, check if the available storage space is greater than or equal to the new message size. If so, choose to write the received message into storage. Figure 4 As shown.

[0096] 2. Upon receiving a message, if there is already packet loss information to be sent internally, determine if the available memory space is greater than or equal to the new message size plus the packet loss information size. If so, first write the packet loss information into memory, and then write the received message into memory. Figure 5 As shown.

[0097] 3. If the available memory space is less than the size of the new message plus the size of the lost packet information, then:

[0098] 3.1) If the type of the message received is consistent with the type of the packet loss information recorded, the packet loss count is incremented by 1, and the message is not written to the memory.

[0099] 3.2) If the type of the currently received message is inconsistent with the type of the recorded packet loss information, continue to check whether the available space in the memory is greater than or equal to the size of the packet loss information. If so, write the original packet loss information to the corresponding memory and record the new packet loss information; otherwise, discard the original packet loss information, record the packet loss information of the new message, record the new packet loss count, and mark multiple types of packet loss, such as... Figure 6 As shown.

[0100] In a preferred embodiment of the present invention, the comparator is further configured as follows:

[0101] Compare the size of the new message received with the available memory space;

[0102] In response to a situation where the available memory space is less than the message size of the new message, the new message is discarded and its packet loss information is written into the packet loss information cache unit.

[0103] In a preferred embodiment of the present invention, the comparator is further configured as follows:

[0104] Compare the size of the new message received with the available memory space;

[0105] In response to a situation where the available memory space is greater than the message size of the new message, the new message is written to the message buffer unit.

[0106] In a preferred embodiment of the present invention, the comparator is further configured as follows:

[0107] In response to the fact that packet loss information is stored in the packet loss information buffer unit, the available memory space is compared with the sum of the message size of the new message and the size of the packet loss information;

[0108] In response to a situation where the available memory space is greater than or equal to the sum of the message size of the new message and the size of the lost packet information, the lost packet information is written into the lost packet information cache unit, and the new message is written into the message cache unit.

[0109] In a preferred embodiment of the present invention, the comparator is further configured as follows:

[0110] In response to a situation where the available memory space is less than the sum of the message size of the new message and the size of the packet loss information, it is determined whether the message type of the new message is consistent with the packet loss type of the packet loss information;

[0111] If the message type of the new message matches the packet loss type in the packet loss information, discard the new message and increment the packet loss count in the packet loss information by 1.

[0112] In a preferred embodiment of the present invention, the comparator is further configured as follows:

[0113] If the message type of a new message is inconsistent with the packet loss type of the packet loss information, determine whether the available storage space is greater than or equal to the size of the packet loss information.

[0114] In response to the available memory space being greater than or equal to the size of the lost packet information, the lost packet information is written into the memory, and the lost packet information of the new message is written into the lost packet information cache unit.

[0115] In a preferred embodiment of the present invention, the comparator is further configured as follows:

[0116] In response to the available memory space being less than the size of the lost packet information, the lost packet information and the new message are discarded, and the lost packet information of the new message is written into the lost packet information buffer unit. The lost packet count in the new lost packet information is 2.

[0117] It should be noted that those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. The embodiments of the computer program described above can achieve the same or similar effects as any of the corresponding foregoing method embodiments.

[0118] Furthermore, the method disclosed in the embodiments of the present invention can also be implemented as a computer program executed by a CPU, which may be stored in a computer-readable storage medium. When the computer program is executed by the CPU, it performs the functions defined in the method disclosed in the embodiments of the present invention.

[0119] Based on the above objectives, a third aspect of the embodiments of the present invention proposes a system for handling message packet loss, such as... Figure 7 As shown, system 200 includes:

[0120] The first judgment module is configured to determine whether there is any packet loss information to be sent inside the packet loss device in response to the packet loss device receiving a new message.

[0121] The second judgment module is configured to determine whether the available space in the memory is greater than the message size of the new message in response to the fact that there is no packet loss information to be sent in the packet loss device.

[0122] The processing module is configured to discard the new message and write the packet loss information of the new message into the memory in response to the available memory space being less than the message size of the new message.

[0123] In view of the above objectives, a fourth aspect of the present invention provides a computer device. Figure 8 The diagram shown is a schematic representation of an embodiment of the computer device provided by the present invention. Figure 8 As shown, embodiments of the present invention include the following apparatus: at least one processor 21; and a memory 22, the memory 22 storing computer instructions 23 that can be executed on the processor, the instructions implementing the above method when executed by the processor.

[0124] In view of the above objectives, a fifth aspect of the present invention provides a computer-readable storage medium. Figure 9 The diagram shown is a schematic representation of an embodiment of the computer-readable storage medium provided by the present invention. Figure 9 As shown, the computer-readable storage medium 31 stores a computer program 32 that, when executed by a processor, performs the methods described above.

[0125] Furthermore, the method disclosed in the embodiments of the present invention can also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. When the computer program is executed by the processor, it performs the functions defined in the method disclosed in the embodiments of the present invention.

[0126] Furthermore, the above-described method steps and system units can also be implemented using a controller and a computer-readable storage medium for storing a computer program that enables the controller to perform the functions of the above-described steps or units.

[0127] Those skilled in the art will also understand that the various exemplary logic blocks, modules, circuits, and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability between hardware and software, the functionality of various illustrative components, blocks, modules, circuits, and steps has been generally described. Whether this functionality is implemented as software or as hardware depends on the specific application and the design constraints imposed on the system as a whole. Those skilled in the art can implement the functionality in various ways for each specific application, but such implementation decisions should not be construed as departing from the scope of the embodiments disclosed herein.

[0128] In one or more exemplary designs, functionality may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, functionality may be stored as one or more instructions or code on or transmitted via a computer-readable medium. Computer-readable media include computer storage media and communication media, including any medium that facilitates the transfer of a computer program from one location to another. Storage media may be any available medium accessible to a general-purpose or special-purpose computer. By way of example, and not limitation, computer-readable media may include RAM, ROM, EEPROM, CD-ROM or other optical disc storage devices, disk storage devices or other magnetic storage devices, or any other medium that may be used to carry or store the required program code in the form of instructions or data structures and is accessible to a general-purpose or special-purpose computer or a general-purpose or special-purpose processor. Furthermore, any connection may be appropriately referred to as computer-readable media. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the aforementioned coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are all included in the definition of media. As used herein, disks and optical discs include compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.

[0129] The above are exemplary embodiments disclosed in this invention. However, it should be noted that various changes and modifications can be made without departing from the scope of the embodiments of this invention as defined by the claims. The functions, steps, and / or actions of the methods according to the disclosed embodiments described herein do not need to be performed in any particular order. Furthermore, although the elements disclosed in the embodiments of this invention may be described or claimed individually, they may be understood as multiple unless explicitly limited to a singular number.

[0130] It should be understood that, as used herein, the singular form “a” is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, “and / or” refers to any and all possible combinations of one or more of the associated listed items.

[0131] The embodiment numbers disclosed in the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0132] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0133] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the invention (including the claims) is limited to these examples. Within the framework of the invention, technical features of the above embodiments or different embodiments can be combined, and many other variations of different aspects of the invention exist, which are not provided in the details for the sake of brevity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.

Claims

1. A method for handling message packet loss, characterized in that, Includes the following steps: In response to the packet loss device receiving a new message, determine whether there is any packet loss information to be sent inside the packet loss device; In response to the absence of lost packet information to be sent within the packet loss device, it is determined whether the available space in the memory is greater than the message size of the new message; In response to a situation where the available memory space is less than the message size of the new message, the new message is discarded and the packet loss information of the new message is stored; In response to a message size where available memory space is greater than or equal to the new message size, the new message is stored. The new message stored is delayed in transmission so that the lost packet information stored is written into the memory before the new message is stored and is read and output before the new message, wherein the delay time is not less than the time it takes to write the lost packet information into the memory.

2. The method according to claim 1, characterized in that, Also includes: In response to packet loss information waiting to be sent inside the packet loss device, determine whether the available space in the memory is greater than or equal to the sum of the message size of the new message and the size of the lost packet information; In response to a situation where the available memory space is greater than or equal to the sum of the size of the new message and the size of the lost packet information, the lost packet information and the new message are stored.

3. The method according to claim 1, characterized in that, Also includes: In response to packet loss information waiting to be sent inside the packet loss device, determine whether the available space in the memory is greater than or equal to the sum of the message size of the new message and the size of the lost packet information; In response to a situation where the available memory space is less than the sum of the message size of the new message and the size of the packet loss information, it is determined whether the message type of the new message is consistent with the packet loss type of the packet loss information; If the message type of the new message is consistent with the packet loss type in the packet loss information, the new message is discarded and the packet loss count in the packet loss information is incremented by 1 and written to the memory.

4. The method according to claim 3, characterized in that, Also includes: If the message type of a new message is inconsistent with the packet loss type of the packet loss information, determine whether the available storage space is greater than or equal to the size of the packet loss information. In response to a situation where the available memory space is greater than or equal to the size of the lost packet information, the lost packet information is written into the memory, and the lost packet information of the new message is recorded as the new lost packet information to be sent.

5. The method according to claim 4, characterized in that, Also includes: In response to the available memory space being less than the size of the lost packet information, the lost packet information and the new message are discarded, and the lost packet information of the new message is recorded as the new lost packet information to be sent.

6. The method according to claim 5, characterized in that, Also includes: Mark the various types of packet loss flags in the new packet loss information to be sent.

7. The method according to claim 1, characterized in that, The format of packet loss information includes packet loss information flag, packet loss type, packet loss count, and multi-type packet loss flag. The packet loss information flag is used to indicate that the message is packet loss information, the packet loss type is used to record the type of current packet loss, the packet loss count is used to record the number of packets lost under the current packet loss type, and the multi-type packet loss flag is used to indicate that multiple different types of packet loss have occurred.

8. An apparatus for handling message packet loss, characterized in that, The device includes: A controller configured to receive new messages and process the received new messages based on the relationship between available memory space and the message size of the new message; The memory is configured to store new messages or packet loss information and to provide real-time feedback of available memory space to the controller. A memory read module is configured to read out messages or packet loss information stored in the memory and output them. The controller includes: A comparator configured to compare the message size of a newly received message with the available memory space; A packet loss information caching unit, wherein the input of the packet loss information caching unit is connected to the comparator and configured to store the packet loss information output by the comparator; A message caching unit, the input of which is connected to the comparator and configured to store messages output by the comparator; A delay unit, the input of which is connected to the output of the message buffer unit and configured to delay the transmission of messages output by the message buffer unit, wherein the delay time is not less than the time for writing packet loss information into the memory; The selector has its input terminals connected to the packet loss information buffer unit and the delay unit, respectively, and is configured to output the message output by the message buffer unit or the packet loss information output by the packet loss information buffer unit to the memory.

9. A system for handling message packet loss, characterized in that, The system includes: The first judgment module is configured to determine whether there is packet loss information to be sent inside the packet loss device in response to the packet loss device receiving a new message; The second judgment module is configured to determine whether the available space in the memory is greater than the message size of the new message in response to the fact that there is no packet loss information to be sent in the packet loss device. The processing module is configured to, in response to a memory space available being less than the message size of the new message, discard the new message and store the packet loss information of the new message; in response to a memory space available being greater than or equal to the message size of the new message, store the new message; and delay the transmission of the stored new message so that the stored packet loss information is written into the memory before the stored new message and is read and output before the new message, wherein the delay time is not less than the time for writing the packet loss information into the memory.

10. A computer device, characterized in that, include: At least one processor; as well as A memory storing computer instructions executable on the processor, which, when executed by the processor, implement the steps of the method according to any one of claims 1-7.

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

Citation Information

Patent Citations

  • Feedback method and feedback access layer equipment

    CN108092748A

  • Packet loss processing method and device, equipment and machine readable storage medium

    CN112073256A