Message forwarding method, computer device, storage medium, program product and chip
By setting up a data queue on the forwarding device and combining it with clock synchronization technology, the transmission of data packets is managed according to the data packet reception deadline and transmission duration. This solves the problem of data packets arriving at the receiving device after a timeout, and achieves timely transmission of data packets and resource optimization.
Patent Information
- Application Number
- CN202210122762.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-09
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2042-02-09
AI Technical Summary
Existing technologies cannot effectively solve the problem of data packets arriving at the receiving device in a timeout during data packet transmission, resulting in wasted resources and untimely transmission.
By setting up a data queue on the forwarding device, the sending deadline is determined based on the data packet reception deadline and transmission duration. Data packets are added to the target data queue and sent sequentially within the target time period. Combined with clock synchronization technology, this ensures that data packets arrive at the receiving device on time.
This ensures that data packets arrive at the receiving device before the reception deadline, reducing resource waste and transmission delay, and improving the efficiency and reliability of data transmission.
Smart Images

Figure CN116614450B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to message forwarding methods, computer equipment, storage media, software products, and chips. Background Technology
[0002] Due to business requirements and other reasons, some data packets in the network need to be transmitted to the receiving device within a limited transmission time. That is, data packets must be received by the receiving device before the specified time; otherwise, they will be discarded. During the transmission of data packets from the sending device to the receiving device, forwarding devices in the network forward the data packets until the data is transmitted to the receiving device. In this process, the forwarding devices receive multiple data packets from different sources. Specifically, the forwarding devices add multiple data packets to a data queue in the order of their arrival times and forward the data packets in the queue in a first-in, first-out (FIFO) manner. This method uses the arrival time of the data packets as the basis for forwarding order and does not consider the time-limited transmission issue, thus easily leading to data packets arriving at the receiving device after a timeout.
[0003] To mitigate the timeout issue, one existing solution involves the sending device calculating the transmission rate of the data packets based on time-limited information (such as a time limit or transmission duration) and sending a bandwidth request message generated from this rate. The network device between the sending and receiving devices receives this request message, determines the bandwidth allocated to the data packets, and writes this bandwidth into a bandwidth message for transmission to the receiving device. The receiving device then sends a message containing bandwidth information to the sending device. The sending device adjusts its transmission rate based on this bandwidth and sends the data packets accordingly, ensuring they are received by the receiving device before the time limit. This method requires one round of communication between the sending and receiving devices, and the sending device needs to calculate and adjust the transmission rate for each data packet, resulting in higher resource consumption and longer transmission time. Furthermore, in this solution, the sending device determines the transmission rate of data packets sequentially based on the order in which the data is received, which still cannot completely solve the time-limited transmission problem, making it highly susceptible to some data packets arriving at the receiving device after a timeout. Summary of the Invention
[0004] In view of this, it is necessary to provide a message forwarding method, computer device, storage medium, program product and chip that can enable data messages that need to be transmitted within a time limit to reach the receiving device in a timely manner.
[0005] The first aspect of this application provides a message forwarding method applied to a message forwarding device in a target network, wherein the target network further includes a sending device and a receiving device, and the message forwarding device, wherein the clock synchronization message forwarding method of the sending device and the receiving device includes:
[0006] The system receives a data packet sent by a sending device. The data packet includes the address information of the receiving device and the receiving device's cutoff time for receiving the data packet. Based on the address information of the receiving device, the system determines the target transmission duration required for the message forwarding device to transmit the data packet to the receiving device. Based on the target transmission duration and the receiving cutoff time, the system determines the sending cutoff time of the data packet at the message forwarding device. The system adds the data packet to a target data queue to which the sending cutoff time belongs. The target data queue corresponds to a target sending time period. The target data queue includes at least one message to be sent, including the data packet. The sending cutoff time of each message to be sent falls within the target sending time period. Within the target sending time period, the system sequentially sends at least one message to be sent from the target data queue.
[0007] Using this scheme, the cutoff time for sending data packets on the forwarding device can be determined based on the information carried in the data packets, and the data packets can be added to the target data queue to which the cutoff time belongs. Thus, within the target sending time period corresponding to the target data queue, at least one packet to be sent, including the data packet, in the target data queue can be sent sequentially.
[0008] In one possible implementation, adding the data packet to the target data queue to which the sending deadline belongs includes:
[0009] Multiple data queues are set up, and each data queue corresponds to a transmission time period; from the transmission time periods corresponding to each data queue, the target transmission time period to which the transmission deadline of the data packet belongs is determined; the data packet is added to the target data queue corresponding to the target transmission time period.
[0010] Using this scheme, each data packet can be stored in a different data queue according to the time limit information (send deadline) of the data packets in the forwarding device, and each data queue corresponds to a send time period.
[0011] In one possible implementation, priority is set for each data queue based on the time elapsed between the sending time period corresponding to each data queue and the current time point.
[0012] The step of sequentially sending at least one pending message, including the data packet, in the target data queue during the target sending time period includes: when the current time point is within the target sending time period, determining that the target data queue has the highest priority, and sequentially sending at least one pending message, including the data packet, in the target data queue.
[0013] Using this scheme, priorities can be set for each data queue. The closer the transmission time period of a data queue is to the current time, the higher its priority. Therefore, when it is within the target transmission time period, the target data queue has the highest priority, and at least one message to be sent in the target data queue can be sent sequentially.
[0014] In one possible implementation, the message forwarding method also includes:
[0015] When there is a timeout period in the corresponding sending time period of each data queue that exceeds the current time, the timeout data queue corresponding to the timeout sending time period is determined; the sending time period corresponding to the timeout data queue is updated to obtain the updated sending time period of the timeout data queue, and the length of the updated sending time period from the current time is the longest among all the sending time periods corresponding to all data queues from the current time; the priority of the timeout data queue is updated, and the updated priority of the timeout data queue is the lowest among all the priorities of the data queues.
[0016] This approach allows for adaptive updates to the data queue's transmission time period and priority as time progresses, enabling the packet forwarding device to assign subsequently received data packets to their respective data queues.
[0017] In one possible implementation, the data packet is sent by the sending device at a target transmission rate, which includes a maximum transmission rate.
[0018] In one possible implementation, the message forwarding method also includes:
[0019] The receiving device is triggered to parse the received data packet to obtain the receiving deadline and first data of the data packet. The first data is a part of the target transmission data, and the target transmission data also includes second data parsed by the receiving device. If the current time point has not reached the receiving deadline, the receiving device is triggered to report the first data and the second data included in the target transmission data. If the current time point has exceeded the receiving deadline, the receiving device is triggered to determine the range information of the first data within the target transmission data and to report the second data and the range information.
[0020] Using this scheme, the receiving device can flexibly process the first data in the received data packet and the target transmission data to which the first data belongs, based on the reception deadline in the received data packet.
[0021] In one possible implementation, determining the target transmission duration required for the packet forwarding device to transmit the data packet to the receiving device based on the address information of the receiving device includes:
[0022] Obtain a preset relationship table, which includes the transmission duration corresponding to the address information of each device in the target network; determine the target transmission duration corresponding to the address information of the receiving device from the preset relationship table, where the target transmission duration is the duration required for the packet forwarding device to transmit the data packet to the receiving device.
[0023] Using this scheme, the target transmission time required for the message forwarding device to transmit data packets to the receiving device can be determined based on the preset relationship table in the message forwarding device.
[0024] In one possible implementation, determining the target transmission duration required for the packet forwarding device to transmit the data packet to the receiving device based on the address information of the receiving device includes:
[0025] Based on the address information of the receiving device, the transmission path between the message forwarding device and the received data is determined, and the transmission path includes at least one intermediate device; a first transmission duration required for the message forwarding device to transmit the data packet to the intermediate device and a second transmission duration required for the intermediate device to transmit the data packet to the receiving device are obtained; and a target transmission duration required for the message forwarding device to transmit the data packet to the receiving device is calculated based on the first transmission duration and the second transmission duration.
[0026] In a second aspect, this application provides a computer device, which includes at least one processor, a memory, and a communication module;
[0027] At least one processor is connected to a memory and a communication module; the memory is used to store instructions, the processor is used to execute instructions, and the communication module is used to communicate with the device under the control of at least one processor; when the instructions are executed by at least one processor, the at least one processor performs the message forwarding method of the first aspect.
[0028] Thirdly, this application provides a computer-readable storage medium storing a program that causes a computer device to execute the message forwarding method of the first aspect.
[0029] Fourthly, this application provides a computer program product including computer-readable instructions that, when executed by one or more processors, implement the message forwarding method of the first aspect.
[0030] Fifthly, this application provides a chip coupled to a memory in a computer device, the chip being used to control the computer device to execute the message forwarding method implementing the first aspect.
[0031] Understandably, the computer equipment provided in the second aspect, the computer-readable storage medium provided in the third aspect, the computer program product provided in the fourth aspect, and the chip provided in the fifth aspect correspond to the method provided in the first aspect. Therefore, the beneficial effects or various implementation methods that can be achieved can be referred to above, and will not be repeated here. Attached Figure Description
[0032] Figure 1 A schematic diagram illustrating an application scenario of the message forwarding method provided in this application embodiment;
[0033] Figure 2 A flowchart illustrating the message forwarding method provided in this application embodiment;
[0034] Figure 3 An interactive schematic diagram of the message forwarding method provided in the embodiments of this application;
[0035] Figure 4 A comparative schematic diagram of a message forwarding method provided in the embodiments of this application;
[0036] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0037] It should be noted that in this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects, not to describe a specific order or sequence.
[0038] This application proposes a message forwarding method applicable to message forwarding devices in a target network. The target network may include multiple devices, including sending devices and receiving devices. Sending devices may include devices that transmit data, and receiving devices may include devices that receive data. The sending and receiving devices can be computer devices, such as personal computers, smartphones, smart wearable devices, smart home devices, and smart TVs. The devices may also include message forwarding devices, which can forward data packets transmitted in the target network. These message forwarding devices can be network devices, such as computer devices, switches, routers, hubs, and bridges. The multiple devices in the target network can be connected via wired or wireless means.
[0039] The target network of this application involves clock synchronization of multiple devices. The clock synchronization method can include setting up a high-precision clock synchronization chip on each device, or it can be based on a clock synchronization protocol, such as Precision Time Protocol (PTP), Network Time Protocol (NTP), etc. The specific method can be flexibly selected according to the actual application scenario, and no restrictions are imposed here.
[0040] The message forwarding device can receive data packets sent by the sending device. The data packets include the address information of the receiving device and the receiving device's cutoff time for receiving the data packets. Based on the address information of the receiving device, the device determines the target transmission duration required for the message forwarding device to transmit the data packets to the receiving device. Based on the target transmission duration and the receiving cutoff time, the device determines the sending cutoff time for the data packets. The device adds the data packets to the target data queue to which the sending cutoff time belongs. The target data queue corresponds to a target sending time period. The target data queue includes at least one message to be sent, and the sending cutoff time of each message to be sent is within the target sending time period. Within the target sending time period, at least one message to be sent, including the data packets, is sent sequentially from the target data queue.
[0041] The message forwarding method of this application allows the message forwarding device to determine the target transmission time required for transmitting the data message from the message forwarding device to the receiving device based on the address information of the receiving device carried in the data message. Then, combined with the receiving device's cutoff time for receiving the data message carried in the data message, the message forwarding device determines the cutoff time for sending the data message on the message forwarding device. This ensures that the message forwarding device can send the data message before the cutoff time, thereby guaranteeing that the data message is received by the receiving device before the cutoff time.
[0042] The message forwarding method of this application will be described in detail below with reference to the embodiments.
[0043] See Figure 1 , Figure 1 This diagram illustrates an application scenario of the message forwarding method of this application. The message forwarding method can be applied to a target network including a sending device, a message forwarding device, and a receiving device. The sending device, message forwarding device, and receiving device can synchronize their clocks based on hardware and / or protocols. Data packets sent by the sending device can carry time-limited information, such as a limited transmission duration or a receiving deadline (limited time point) at the receiving device. The message forwarding device can determine the sending deadline of the data packet based on the time-limited information and send the data packet before the deadline. The receiving device can receive the data packet and, based on the time-limited information carried in the data packet, determine whether the data packet has timed out. If it has timed out, the data packet is discarded; otherwise, the data included in the data packet is reported. Thus, time-limited transmission of data packets in the target network can be achieved through the time-limited information carried in the data packet.
[0044] See Figure 2 , Figure 2 This is a flowchart illustrating a message forwarding method applied to a message forwarding device, specifically including:
[0045] 101. Receive data packets sent by the sending device. The data packets include the address information of the receiving device and the receiving device's cutoff time for receiving the data packets.
[0046] The transmitting device can divide the data to be transmitted into at least one data packet according to the data to be transmitted and its time limit information. Each data packet carries the time limit information and the address information of the receiving device of the data to be transmitted. The time limit information may include the time limit for transmitting the data to be transmitted, or the time limit for the arrival of the data to be transmitted (i.e., the receiving device's cut-off time for receiving). The time limit for transmission and the time limit for arrival are essentially the same. For example, if the time limit for transmitting data 1 is 200 microseconds, that is, data 1 will be transmitted within 200 microseconds. If the current time is 100 microseconds, then the time limit for arrival is 300 microseconds.
[0047] The sending device can send data packets, and the packet forwarding device can receive the data packets, parse the data packets, and determine the address information of the receiving device and the receiving device's deadline for receiving the data packets.
[0048] When sending data packets, the sending device can send packets based on a target sending rate, which may include the maximum sending rate, thereby completing the data packet sending process faster and reducing the time spent sending data packets. Compared with the existing technology of calculating and adjusting the sending rate for each data packet, this application can significantly reduce the time spent sending data packets and simplify the data packet sending process.
[0049] The target transmission rate can also include a pre-set default value. The target transmission rate can also be calculated from feedback information returned by devices including message forwarding devices / receiving devices in the target network. In practical applications, the target transmission rate can be flexibly determined according to the application scenario.
[0050] 102. Based on the address information of the receiving device, determine the target transmission duration required for the message forwarding device to transmit data packets to the receiving device.
[0051] In some embodiments, the packet forwarding device can obtain a preset relationship table. This table may include the transmission duration corresponding to the address information of each device in the target network. The transmission duration may include the time required for the packet forwarding device to transmit a data packet to the device. Therefore, the target transmission duration corresponding to the address information of the receiving device can be determined from the preset relationship table. This target transmission duration is the time required for the packet forwarding device to transmit a data packet to the receiving device. For example, the transmission duration 1 corresponding to the address information of the receiving device for data packet 1 can be found in the transmission duration table stored by the switch. Transmission duration 1 is the time required for the switch to transmit the data packet to the receiving device.
[0052] In some embodiments, the packet forwarding device can determine the transmission path of the data packet from the packet forwarding device to the receiving device based on the address information of the receiving device. The transmission path may include a path in the target network that transmits the data packet from the data forwarding device to the receiving device, and the transmission path may include at least one intermediate device in the target network.
[0053] Devices in the target network can periodically broadcast the transmission duration required for themselves to transmit data packets with other devices in the target network. The packet forwarding device stores the first transmission duration required for data transmission between the packet forwarding device and the intermediate device, and the second transmission duration required for data transmission between the intermediate device and the receiving device. Based on the first and second transmission durations, the packet forwarding device can determine the target transmission duration required for the packet forwarding device to transmit data packets to the receiving device. For example, the packet forwarding device can add the first transmission duration, the second transmission duration, and a preset duration to obtain the target transmission duration.
[0054] 103. Determine the cutoff time for sending data packets at the packet forwarding device based on the target transmission duration and the reception deadline.
[0055] The target transmission duration can be the minimum transmission duration, maximum transmission duration, or average transmission duration required to transmit data packets from the message forwarding device to the receiving device. Specifically, it can be flexibly selected according to the actual scenario. For example, if the target transmission duration is the maximum transmission duration, the data packets can arrive at the receiving device as early as possible.
[0056] The process of determining the sending deadline based on the target transmission duration and the receiving deadline can be, for example, by subtracting the target transmission duration from the receiving deadline to obtain the sending deadline of the data packet at the packet forwarding device.
[0057] 104. Add the data packet to the target data queue to which the sending deadline belongs. The target data queue corresponds to a target sending time period. The target data queue includes at least one packet to be sent. The sending deadline of each packet to be sent is within the target sending time period.
[0058] 105. During the target transmission time period, sequentially transmit at least one pending message, including data packets, from the target data queue.
[0059] The message forwarding method of this application allows the message forwarding device to determine the target transmission time required for transmitting the data message from the message forwarding device to the receiving device based on the address information of the receiving device carried in the data message. Then, combined with the receiving device's cutoff time for receiving the data message carried in the data message, the message forwarding device determines the cutoff time for sending the data message on the message forwarding device. This ensures that the message forwarding device can send the data message before the cutoff time, thereby guaranteeing that the data message is received by the receiving device before the cutoff time.
[0060] The message forwarding method of this application will be further described below with reference to embodiments. In the embodiments, the sending device can be a sending end, the receiving device can be a receiving end, the forwarding device can be a receiving end, and the message forwarding device can be a forwarding device.
[0061] The message forwarding method of this application may include the following steps:
[0062] 201. Synchronize the clocks of all devices within the target network.
[0063] 202. The sending end obtains the data submitted by the application and the data transmission time limit.
[0064] For example, see Figure 3The application submits data to the sending end, along with the data's time limit information DL0. The time limit information DL0 can be a limit of 200 microseconds for transmission duration.
[0065] 203. The sending end divides the data into packets to obtain at least one data packet. The data packet includes part or all of the data, as well as the address information of the receiving end and the receiving deadline. The receiving deadline is obtained by the sending end from the current time plus the limited transmission duration.
[0066] For example, see Figure 3 The sending end divides the data submitted by the application into packets to obtain multiple data packets, and adds time limit information DL1 to each data packet. The time limit information DL1 can be the receiving device's cutoff time for receiving the data packet, which is 300 microseconds. 300 microseconds is obtained by adding 200 microseconds to the current time, which is 100 microseconds.
[0067] 204. The forwarding device receives and parses the data packets transmitted by the sender, determines the receiving device of the data packets, and the receiving device's cutoff time for receiving the data packets.
[0068] 205. The forwarding device calculates the data packet's sending deadline at the forwarding device based on the stored path transmission time from the forwarding device to the receiving device and the receiving deadline.
[0069] For example, see Figure 3 The forwarding device can calculate or determine the time limit information DL2 of the data packet on the forwarding device based on the time limit information DL1. DL2 can be the data packet's sending deadline of 200 microseconds on the forwarding device. 200 microseconds is obtained by subtracting the transmission time of 100 microseconds from the receiving deadline of 300 microseconds.
[0070] The transmission paths from the forwarding device to different devices are different, so the transmission time will also be different. Correspondingly, the cutoff time for sending data packets to different devices will also be different. For example, if the forwarding device receives data packet 1 and data packet 2 at the same time, where data packet 1 is a data packet to receiving device 1 and data packet 2 is a data packet to receiving device 2, and the cutoff time for receiving both data packet 1 and data packet 2 is 100 microseconds, the minimum transmission time from the forwarding device to receiving device 1 is 20 microseconds, and the minimum transmission time from the forwarding device to receiving device 2 is 30 microseconds, then the cutoff time for sending data packet 1 at the forwarding device can be calculated to be 80 microseconds, and the cutoff time for sending data packet 2 at the forwarding device is 70 microseconds.
[0071] 206. The forwarding device determines and adds the data packet to the target data queue based on the data packet's sending deadline. The target data queue corresponds to a target sending time period, and the sending deadline is within that target sending time period.
[0072] For example, see Figure 3 The forwarding device is configured with queue 1, queue 2 and queue 3, and each of the three queues corresponds to a transmission time period. The forwarding device determines the transmission time period to which the data packet's time limit information DL2 belongs, corresponding to queue 2, and adds the data packet to queue 2.
[0073] 207. When the target transmission time period is reached, the forwarding device sequentially transmits the pending messages in the target data queue, including data packets.
[0074] For example, referring to Table 1, the forwarding device can perform queue scheduling and data packet forwarding based on the sending time period corresponding to each data queue and the current time, and send the data packets in the corresponding queue in sequence during the sending time period.
[0075] The forwarding device is equipped with multiple data queues, each corresponding to a transmission time period. All transmission time periods are consecutive to each other, and the duration of the transmission time period can be set arbitrarily. The duration of the transmission time periods of different data queues can be the same or different. For example, the duration of the transmission time period can be 2 microseconds, and all transmission time periods have the same duration.
[0076] Based on the distance of each sent time period from the current time point, priorities can be set for each data queue. For example, the sent time period closer to the current time point has a higher priority. As time passes, the priorities of each sent time period can be dynamically updated. Furthermore, for data queues with sent time periods that have expired, the corresponding sent time periods can also be updated.
[0077] For example, see Table 1, which shows the priority of different queues and their corresponding sending time periods at different times.
[0078] Table 1
[0079] time Queue 1 (Pr / DL) Queue 2 (Pr / DL) Queue 3 (Pr / DL) Queue 4 (Pr / DL) 0us 0 / <5us 1 / <10us 2 / <15us 3 / <20us 5us 3 / <25us 0 / <10us 1 / <15us 2 / <20us 10us 2 / <25us 3 / <30us 0 / <15us 1 / <20us 15us 1 / <25us 2 / <30us 3 / <35us 0 / <20us 20us 0 / <25us 1 / <30us 2 / <35us 3 / <40us
[0080] Table 1 shows the changes in priority (Pr) and transmission time period (DL) of each queue as the time (time point) changes. From the first row of Table 1, at time 0us, queue 1 has priority 0 (highest), so data packets with a transmission deadline less than 5us in the data forwarding device enter queue 1; queue 2 has priority 1, and data packets with a transmission deadline greater than 5us but less than 10us can enter queue 2; queue 3 has priority 2, and data packets with a transmission deadline greater than 10us but less than 15us can enter queue 3; queue 4 has priority 3, and data packets with a transmission deadline greater than 15us but less than 20us can enter queue 4.
[0081] Then, when the time reaches 5us, the sending timeout period of queue 1 expires. At this point, the priority of queue 1 becomes 3 (lowest), and the sending timeout period of queue 1 is updated to 20-25us. After the priority of queue 1 becomes the lowest, the priorities of queues 2, 3, and 4 increase accordingly, but their respective sending timeout periods remain unchanged.
[0082] As time progresses, each queue will time out in turn, and the priority and time period of each queue will change accordingly.
[0083] 208. The receiving end receives and parses the data packet, and determines whether to discard or submit the data in the data packet to the application based on the data packet's reception deadline time period.
[0084] For example, see Figure 3 The receiving end can parse the data packet and process it based on the parsed reception deadline. If the current time has exceeded the reception deadline, it can discard the data packet, as well as other data packets carrying different parts of the same data. Alternatively, it can report other parts of the data, as well as range information for some data in the data packet.
[0085] The data forwarding method of this application can, to a greater extent, enable data packets requiring time-limited transmission to complete data transmission within a specified time period. (Refer to...) Figure 4 , Figure 4 The horizontal axis represents the number of concurrent data blocks, and the vertical axis represents the number of timeout data blocks. Figure 4 As can be seen, when forwarding packets using existing technology (FIFO), the number of timeout data blocks gradually increases with the increase in the number of concurrent data blocks. However, when forwarding packets using the scheme (Deadline) of this application, the number of timeout data blocks remains at a low level as the number of concurrent data blocks increases, effectively ensuring the effectiveness of data transmission within the network.
[0086] refer to Figure 5 This is a schematic diagram of the hardware structure of the computer device 100 provided in an embodiment of this application. Figure 5 As shown, computer device 100 may include a screen 1001, a processor 1002, a memory 1003, and a communication bus 1004. The memory 1003 stores one or more computer programs 1005. The one or more computer programs 1005 are configured to be executed by the processor 1002. The one or more computer programs 1005 include instructions that can be used to implement all or part of the steps of a message forwarding method in computer device 100.
[0087] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the computer device 100. In other embodiments, the computer device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. For example, the computer device 100 may also include a camera.
[0088] Processor 1002 may include one or more processing units, such as application processors (APs), modems, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0089] The processor 1002 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 1002 is a cache memory. This memory can store instructions or data that the processor 1002 has just used or that are used repeatedly. If the processor 1002 needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces the waiting time of the processor 1002, and thus improves the efficiency of the system.
[0090] In some embodiments, the processor 1002 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM interface, and / or a USB interface, etc.
[0091] In some embodiments, memory 1003 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0092] This embodiment also provides a computer storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the aforementioned method steps to implement the message forwarding method in the above embodiment.
[0093] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the message forwarding method in the above embodiment.
[0094] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute the message forwarding methods in the above method embodiments.
[0095] In this embodiment, the computer device, computer storage medium, computer program product or chip are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.
[0096] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0097] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are illustrative. For instance, the division of modules or units is a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0098] The unit described as a separate component may or may not be physically separate. The component shown as a unit can be one physical unit or multiple physical units, that is, it can be located in one place or distributed in multiple different places. Some or all of the units can be selected to achieve the purpose of the solution in this embodiment according to actual needs.
[0099] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0100] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0101] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be covered within the scope of protection of this application.
Claims
1. A message forwarding method, applied to a message forwarding device in a target network, the target network further comprising a sending device and a receiving device, wherein the message forwarding device, the sending device, and the receiving device are clock-synchronized, characterized in that... The method includes: The receiving device receives a data packet sent by the sending device. The data packet includes the address information of the receiving device and the receiving device's cutoff time for receiving the data packet. Based on the address information of the receiving device, the target transmission duration required for the message forwarding device to transmit the data packet to the receiving device is determined; Based on the target transmission duration and the reception deadline, the data packet's sending deadline at the packet forwarding device is determined; The data packet is added to the target data queue to which the sending deadline belongs. The target data queue corresponds to a target sending time period. The target data queue includes at least one message to be sent, including the data packet. The sending deadline of each message to be sent is within the target sending time period. During the target transmission time period, at least one message to be sent from the target data queue is transmitted sequentially.
2. The method according to claim 1, characterized in that, Adding the data packet to the target data queue to which the sending deadline belongs includes: Multiple data queues are set up, and each data queue corresponds to a time period for sending data. From the sending time periods corresponding to each data queue, determine the target sending time period to which the sending deadline of the data packet belongs; Add the data packet to the target data queue corresponding to the time period sent by the target.
3. The method according to claim 2, characterized in that, The method further includes: Set a priority for each data queue based on the time elapsed between the sending time period corresponding to each data queue and the current time. The step of sequentially sending at least one pending message, including the data packet, from the target data queue during the target transmission time period includes: When the current time point falls within the target transmission time period, the target data queue is determined to have the highest priority, and at least one pending message, including the data packet, is transmitted sequentially from the target data queue.
4. The method according to claim 3, characterized in that, The method further includes: When there is a timeout period in the corresponding sending time period of each data queue that exceeds the current time point, the timeout data queue corresponding to the timeout sending time period is determined. Update the sending time period corresponding to the timeout data queue to obtain the updated sending time period of the timeout data queue. The duration of the updated sending time period from the current time point is the longest duration of the sending time period corresponding to all data queues from the current time point. Update the priority of the timeout data queue, and the updated priority of the timeout data queue is the lowest among all data queues.
5. The method according to claim 1, characterized in that, The data packet is sent by the sending device at a target sending rate, which includes the maximum sending rate.
6. The method according to claim 1, characterized in that, The method further includes: The receiving device is triggered to parse the received data packet to obtain the receiving deadline and first data of the data packet. The first data is a part of the target transmission data, and the target transmission data also includes the second data obtained by the receiving device. If the current time point has not reached the receiving deadline, the receiving device is triggered to report the first data and the second data included in the target transmission data; If the current time exceeds the receiving deadline, the receiving device is triggered to determine the range information of the first data within the target transmission data, and to report the second data and the range information.
7. The method according to claim 1, characterized in that, The step of determining the target transmission duration required for the packet forwarding device to transmit the data packet to the receiving device based on the address information of the receiving device includes: Obtain a preset relationship table, which includes the transmission duration corresponding to the address information of each device in the target network; From the preset relationship table, the target transmission duration corresponding to the address information of the receiving device is determined. The target transmission duration is the duration required for the message forwarding device to transmit the data packet to the receiving device.
8. The method according to claim 1, characterized in that, The step of determining the target transmission duration required for the packet forwarding device to transmit the data packet to the receiving device based on the address information of the receiving device includes: Based on the address information of the receiving device, the transmission path between the message forwarding device and the received data is determined, and the transmission path includes at least one intermediate device; The first transmission time required for the message forwarding device to transmit the data packet to the intermediate device, and the second transmission time required for the intermediate device to transmit the data packet to the receiving device are obtained. Based on the first transmission duration and the second transmission duration, calculate the target transmission duration required for the message forwarding device to transmit the data packet to the receiving device.
9. A computer device, characterized in that, The computer device includes at least one processor, memory, and communication module; The at least one processor is connected to the memory and the communication module; The memory is used to store instructions, the processor is used to execute the instructions, and the communication module is used to communicate with the device under the control of the at least one processor; When the instruction is executed by the at least one processor, it causes the at least one processor to perform the method as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program that causes a computer device to perform the method as described in any one of claims 1 to 8.
11. A computer program product, characterized in that, The computer program product includes computer-readable instructions that, when executed by one or more processors, implement the method as described in any one of claims 1 to 8.
12. A chip coupled to a memory in a computer device, characterized in that, The chip is used to control the computer device to perform the method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Network congestion control method, equipment and system
CN108809858A
Message scheduling method, first network equipment and computer readable storage medium
CN110166380A