Message sending method and device, equipment and medium

By obtaining the current bandwidth determined by the detection engine and the historical bandwidth prediction of the prediction engine before data transmission, combining the transmission priority dynamic allocation of bandwidth resources and message sending strategy, the problem of lack of traffic control in UDP transmission in SOME/IP protocol is solved, and the effect of reducing packet loss and improving system stability is achieved.

CN120151301APending Publication Date: 2025-06-13IMOTION AUTOMOTIVE TECH (SUZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510428454.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-07
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

When using the UDP transmission method of SOME/IP protocol, the lack of traffic control function leads to large-scale packet loss problems in restricted environments or low-bandwidth chip environments, seriously affecting system stability.

Method used

By obtaining the current bandwidth determined by the detection engine before data transmission, and combining the prediction engine to predict the historical bandwidth, determining transmission priority, dynamically allocating bandwidth resources and message sending strategies, to achieve traffic control.

Benefits of technology

It effectively reduces packet loss problems, improves system stability, and ensures that key services can be transmitted in a timely manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120151301A_ABST
    Figure CN120151301A_ABST
Patent Text Reader

Abstract

The invention discloses a message sending method and device, equipment and a medium, relates to the technical field of data transmission, is applied to a first system-on-chip, and comprises the following steps: before a data message generated by a local application program is transmitted to a target application program in a second system-on-chip, sending the data message to the target application program; obtaining the current bandwidth of the target transmission path determined by the preset detection engine based on the round-trip delay and the packet loss rate of the detection packet; the target transmission path is a transmission path between the local application program and the target application program; obtaining a prediction result of a preset prediction engine on the bandwidth of the target transmission path in the future time period based on the current bandwidth and the historical bandwidth, and obtaining a predicted bandwidth; and determining a transmission priority according to the service type of the data message, and allocating a bandwidth resource and a message sending strategy for the data message according to the current bandwidth, the predicted bandwidth and the transmission priority, so as to control the transmission of the data message based on the bandwidth resource and the message sending strategy. Flow control is carried out in the data transmission process, and the system stability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data transmission, and particularly to a method, device, equipment and medium for sending messages. Background Art

[0002] SOME / IP (Scalable service-Oriented MiddlewarE over IP, a middleware communication protocol based on IP) is a middleware communication protocol designed specifically for modern automotive electronic architectures. It has a service-oriented architecture that allows different ECUs to communicate and interact as service providers and consumers through well-defined interfaces. SOME / IP supports two transmission modes, UDP (User Datagram Protocol) and TCP (Transmission Control Protocol). Since TCP often increases bandwidth consumption, and UDP, as a connectionless transmission method, is characterized by low transmission latency, UDP is often used for transmission in actual production environments, such as audio and video signals.

[0003] However, when using SOME / IP as a communication middleware, although the UDP transmission mode it supports has low latency, it lacks a flow control function. This causes VSOMEIP (an open-source framework implementing SOME / IP) to transmit data as much as possible when using UDP for data transmission, without considering the impact on bandwidth. Then, in a restricted environment or a low-bandwidth chip environment, a large-scale packet loss problem will be caused, seriously affecting the system stability.

[0004] In summary, how to perform flow control during data transmission to reduce packet loss problems and improve system stability is a problem to be solved currently. Summary of the Invention

[0005] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for sending messages, which can perform flow control during data transmission to reduce packet loss problems and improve system stability. The specific solutions are as follows:

[0006] In a first aspect, the present application discloses a method for sending messages, which is applied to a first system-on-chip and includes:

[0007] Before transmitting the data message generated by the local application to the target application in the second system-on-chip, obtain the current bandwidth of the target transmission path determined by the preset detection engine based on the round-trip delay and packet loss rate of the detection packet; wherein, the target transmission path is the transmission path between the local application and the target application;

[0008] Obtain the prediction result of the preset prediction engine on the bandwidth of the target transmission path in the future time period based on the current bandwidth and the historical bandwidth of the target transmission path, so as to obtain the predicted bandwidth;

[0009] Determine the transmission priority according to the service type of the data packet, and allocate bandwidth resources and packet sending strategies for the data packet according to the current bandwidth, the predicted bandwidth and the transmission priority, so as to control the transmission of the data packet based on the bandwidth resources and the packet sending strategy.

[0010] Optionally, the obtaining the current bandwidth of the target transmission path determined by the preset detection engine based on the round-trip delay and packet loss rate of the detection packet includes:

[0011] Use the preset detection engine to send detection packets to the second system-on-chip through the target transmission path based on a preset sending frequency, so as to obtain the round-trip delay and packet loss rate of the detection packets on the target transmission path; the header of the detection packet includes a sending timestamp and a sequence number;

[0012] Calculate the reference bandwidth based on the round-trip delay and the size of the detection packet, and adjust the reference bandwidth based on the packet loss rate to obtain the current bandwidth of the target transmission path.

[0013] Optionally, the adjusting the reference bandwidth based on the packet loss rate to obtain the current bandwidth of the target transmission path includes:

[0014] If the packet loss rate is not greater than the first preset threshold, directly use the reference bandwidth as the current bandwidth of the target transmission path;

[0015] If the packet loss rate is greater than the first preset threshold and not greater than the second preset threshold, use the attenuation model constructed based on the packet loss rate to perform attenuation processing on the reference bandwidth to obtain the current bandwidth of the target transmission path;

[0016] If the packet loss rate is greater than the second preset threshold, perform attenuation processing on the reference bandwidth based on a preset proportionality coefficient to obtain the current bandwidth of the target transmission path.

[0017] Optionally, the packet sending method further includes:

[0018] Statistical volatility of the detection packet; wherein, the volatility is the ratio of the standard deviation to the mean of the round-trip delays within a continuous first preset number of times;

[0019] If the volatility is less than the first preset volatility threshold, reduce the preset sending frequency;

[0020] If the volatility is greater than a second preset volatility threshold or the packet loss rate is greater than a preset packet loss rate threshold, increase the preset transmission frequency.

[0021] Optionally, the allocating bandwidth resources and packet sending policies for the data packet according to the current bandwidth, the predicted bandwidth, and the transmission priority includes:

[0022] If it is determined based on the transmission priority that the data packet is a data packet corresponding to a preset high-priority service, allocate bandwidth resources corresponding to the bandwidth requirements of the data packet and a first packet sending policy; wherein, the first packet sending policy is used to stipulate that the original data packet is transmitted at a preset maximum rate;

[0023] If it is determined based on the transmission priority that the data packet is a data packet corresponding to a preset low-priority service, obtain the remaining bandwidth resources, and allocate the remaining bandwidth resources to the data packet, and then determine whether the predicted bandwidth is greater than the current bandwidth; the remaining bandwidth resources are the remaining bandwidth resources after allocating the corresponding bandwidth resources for the rest of the preset high-priority services;

[0024] If the predicted bandwidth is greater than the current bandwidth, obtain a second packet sending policy; the second packet sending policy is a policy for combining and sending a plurality of data packets;

[0025] If the predicted bandwidth is not greater than the current bandwidth, obtain a third packet sending policy; the third packet sending policy is a policy for splitting and sending a single data packet.

[0026] Optionally, the packet sending method further includes:

[0027] If the current packet loss rate exceeds the second preset threshold, stop sending data packets corresponding to the preset low-priority service;

[0028] Or, if the probe packet is lost for a second preset number of consecutive times, stop sending data packets corresponding to the preset low-priority service.

[0029] Optionally, the preset prediction engine is constructed based on a triple exponential smoothing model;

[0030] Correspondingly, the obtaining the prediction result of the bandwidth of the target transmission path in a future time period by the preset prediction engine based on the current bandwidth and the historical bandwidth of the target transmission path includes:

[0031] Input the current bandwidth and the historical bandwidth of the target transmission path into the triple exponential smoothing model to construct a level component, a trend component, and a seasonal component;

[0032] Determine the prediction result of the bandwidth of the target transmission path within a future time period based on the horizontal component, the trend component, and the seasonal component.

[0033] In a second aspect, the present application discloses a message sending device, which is applied to a first system on a chip and includes:

[0034] A detection module, configured to obtain the current bandwidth of a target transmission path determined by a preset detection engine based on the round-trip delay and packet loss rate of a detection packet before transmitting a data packet generated by a local application to a target application in a second system on a chip; wherein, the target transmission path is the transmission path between the local application and the target application;

[0035] A prediction module, configured to obtain a prediction result of the bandwidth of the target transmission path within a future time period by a preset prediction engine based on the current bandwidth and the historical bandwidth of the target transmission path, so as to obtain a predicted bandwidth;

[0036] A transmission module, configured to determine a transmission priority according to the service type of the data packet, and allocate bandwidth resources and a message sending strategy for the data packet according to the current bandwidth, the predicted bandwidth, and the transmission priority, so as to control the transmission of the data packet based on the bandwidth resources and the message sending strategy.

[0037] In a third aspect, the present application discloses an electronic device, including:

[0038] A memory, configured to store a computer program;

[0039] A processor, configured to execute the computer program to implement the steps of the message sending method disclosed above.

[0040] In a fourth aspect, the present application discloses a computer-readable storage medium, configured to store a computer program; wherein, when the computer program is executed by a processor, the steps of the message sending method disclosed above are implemented.

[0041] It can be seen that before the first system-on-chip in this application transmits the data packet generated by the local application to the target application in the second system-on-chip, it obtains the current bandwidth of the target transmission path determined by the preset detection engine based on the round-trip delay and packet loss rate of the detection packet; wherein, the target transmission path is the transmission path between the local application and the target application; obtains the prediction result of the bandwidth of the target transmission path in the future time period by the preset prediction engine based on the current bandwidth and the historical bandwidth of the target transmission path to obtain the predicted bandwidth; determines the transmission priority according to the service type of the data packet, and allocates bandwidth resources and packet sending policies for the data packet according to the current bandwidth, the predicted bandwidth and the transmission priority, so as to control the transmission of the data packet based on the bandwidth resources and the packet sending policies.

[0042] Beneficial effects: Before the local application in the first system-on-chip generates a data packet to be transmitted and transmits the data packet to the target application in the second system-on-chip, it is necessary to use the preset detection engine to send a detection packet, so as to determine the current bandwidth of the target transmission path based on the round-trip delay and packet loss rate of the detection packet. The target transmission path refers to the transmission path between the local application and the target application. In addition, this application also needs to use the preset prediction engine to predict the bandwidth of the target transmission path in the future time period based on the current bandwidth and the historical bandwidth of the target transmission path to obtain the predicted bandwidth. Moreover, this application also needs to determine the transmission priority according to the service type of the data packet. Finally, referring to multiple factors such as the current bandwidth, the predicted bandwidth and the transmission priority, bandwidth resources and packet sending policies are allocated for the data packet to control the transmission of the data packet based on the bandwidth resources and the packet sending policies. By combining the real-time dynamic detection of the current bandwidth with the learning of the historical bandwidth, this application can quickly respond to network changes, and this application will also determine the transmission priority of the data packet, so as to allocate bandwidth resources and packet sending policies according to the transmission priority, with the aim of ensuring that some key services can be transmitted in time. In this way, by combining the current bandwidth, the predicted bandwidth and the transmission priority, traffic control can be carried out during data transmission to reduce packet loss problems and improve system stability. Description of the Drawings

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0044] Figure 1 It is a flowchart of a packet sending method disclosed in this application;

[0045] Figure 2 A schematic diagram of a message sending framework disclosed in this application;

[0046] Figure 3 A flowchart of a specific message sending method disclosed in this application;

[0047] Figure 4 A schematic diagram of the structure of a message sending device disclosed in this application;

[0048] Figure 5 A structural diagram of an electronic device disclosed in this application. Detailed implementation manners

[0049] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0050] Currently, when using SOME / IP as a communication middleware, although the UDP transmission method it supports has low latency, it lacks a flow control function. This causes VSOMEIP to transmit data as much as possible when using UDP to transmit data, without considering the impact of bandwidth. Then, in a restricted environment or a low-bandwidth chip environment, a large-scale packet loss problem will be caused, seriously affecting the system stability. For this reason, the embodiments of the present application disclose a message sending method, device, equipment and medium, which can perform flow control during data transmission to reduce the packet loss problem and improve the system stability.

[0051] See Figure 1 and Figure 2 As shown, the embodiments of the present application disclose a message sending method, which is applied to the first system-on-chip. The method includes:

[0052] Step S11: Before transmitting the data message generated by the local application program to the target application program in the second system-on-chip, obtain the current bandwidth of the target transmission path determined by the preset detection engine based on the round-trip delay and packet loss rate of the detection packet; wherein, the target transmission path is the transmission path between the local application program and the target application program.

[0053] In this embodiment, it should be noted first that in an automotive electronic system, multiple systems on a chip undertake different functions. For example, one system on a chip is responsible for power system control, and another system on a chip is responsible for in-vehicle entertainment system. They need to work together and perform data interaction through internally integrated communication interfaces, network controllers, and corresponding communication protocols (such as Ethernet, CAN bus, etc.). For example, during vehicle driving, the system on a chip corresponding to the power system needs to transmit data such as vehicle speed and engine status to the system on a chip corresponding to the entertainment system, so that the entertainment system can adjust the display content or audio playback mode. Further, the application program involved in this application specifically refers to an application program developed based on the VSOMEIP framework. It can be understood that VSOMEIP is an open-source implementation of the SOME / IP protocol, providing SOME / IP core functions, including service discovery, message transmission, and serialization, etc. Based on the VSOMEIP protocol, different application programs (Apps) run on the system on a chip and use the UDP protocol to transmit data.

[0054] Taking the first system on a chip as an example, the local application program in the first system on a chip will execute corresponding service processing logic to generate a data packet to be transmitted. Before transmitting the data packet to the target application program in the second system on a chip, the data packet needs to be passed to the local routing management. The routing management module is responsible for transmitting the packet from the first system on a chip to the second system on a chip where the target application program is located. Similarly, the packet generated by the target application program will also be sent through the routing management of its corresponding system on a chip. Specifically, a preset detection engine is set in the routing management. Before sending the data packet, the preset detection engine will be started to send detection packets, so as to determine the current bandwidth of the target transmission path based on the round-trip delay and packet loss rate of the detection packets. The target transmission path refers to the transmission path between the local application program and the target application program.

[0055] Step S12: Obtain the prediction result of the preset prediction engine on the bandwidth of the target transmission path in a future time period based on the current bandwidth and the historical bandwidth of the target transmission path, so as to obtain the predicted bandwidth.

[0056] In this embodiment, a preset prediction engine is also set in the routing management. That is to say, in addition to using the preset detection engine to detect the real-time current bandwidth, it is also necessary to use the preset prediction engine to predict the bandwidth of the target transmission path in a future time period based on the current bandwidth and the historical bandwidth of the target transmission path, so as to obtain the predicted bandwidth.

[0057] In the specific implementation manner, the preset prediction engine is constructed based on a triple exponential smoothing model; correspondingly, the obtaining of the prediction result of the bandwidth of the target transmission path in a future time period by the preset prediction engine based on the current bandwidth and the historical bandwidth of the target transmission path includes: inputting the current bandwidth and the historical bandwidth of the target transmission path into the triple exponential smoothing model to construct a level component, a trend component, and a seasonal component; determining the prediction result of the bandwidth of the target transmission path in the future time period based on the level component, the trend component, and the seasonal component.

[0058] That is, in this embodiment, a triple exponential smoothing model is specifically used to predict the bandwidth of the target transmission path in a future time period. The triple exponential smoothing model is a lightweight time series prediction model, suitable for data with trends and periodicity. It models through three components: Level component: Represents the baseline value of the data, determined by using the average of the previous several observations; Trend component: Represents the change trend of the data, usually estimated by the linear trend of the previous several observations; Seasonal component: Represents the periodic change of the data, which needs to be determined according to the period length p of the data. In the specific implementation manner, the bandwidth values within the last 30 seconds can be stored, that is, including the historical bandwidth and the current bandwidth. These data are usually stored in a sliding window with a granularity of seconds, and this application supports dynamic adjustment of the window size. For example, when the network fluctuates greatly, it can be extended to 60 seconds. Therefore, in this embodiment, the level component can use the average value in the initial stage as the initial value. For example, the average value within 30s or 60s after power-on or a manually agreed time value can be taken as the initial value of the level component; the trend component can be estimated by the linear trend of the previous several times, such as calculated by using the simple difference method, or the trends at the 10s, 20s, and 30s time points within a period of time after power-on can be taken as the initial value; the seasonal component generally takes the average value of the same time point within several periods as the initial value. If the period is set to 30s, then the average value of the tenth second in the first 30s and the tenth second in the second 30s is calculated as the initial value.

[0059] In addition, in addition to predicting the bandwidth of the future time period, the same method can also be used to predict the round-trip delay and packet loss rate of the future time period.

[0060] When using the triple exponential smoothing model for prediction, the involved formulas are as follows:

[0061] Level component: ;

[0062] Trend component: ;

[0063] Seasonal component: ;

[0064] Predicted value: ;

[0065] where L t is the horizontal component at the current time, is the horizontal component at the previous time; T t is the trend component at the current time, is the trend component at the previous time; S t is the seasonal component at the current time, is the seasonal component before the cycle length p; is the smoothing coefficient; k is the future time step representing the prediction, represents the bandwidth prediction value at the k-th future time point.

[0066] Furthermore, before prediction, the preset prediction engine will also perform feature extraction on the data to better capture the trends and periodicities of bandwidth changes. The extracted features include mean, variance, trend slope, and periodicity features. Among them, the mean and variance can be used to evaluate the stability of historical data and assist in model initialization, such as the selection of smoothing coefficients α, β, γ. For example, when the variance is large, the value of α may be reduced to rely more on historical data; the trend slope is directly related to the trend component T and can reflect the short-term bandwidth change trend, which is used to dynamically adjust the model's sensitivity to trends, such as the adaptive optimization of the β value; the periodicity feature can determine the cycle length p of the seasonal component and calibrate the seasonal factor through historical periodic patterns, such as the bandwidth fluctuations at fixed daily periods.

[0067] And, an online learning method can be adopted to update the model parameters every 5 minutes, and the smoothing coefficient is automatically optimized by minimizing the prediction error (such as the mean absolute error). In addition, when the deviation between the predicted bandwidth and the detected value of the corresponding real-time bandwidth exceeds a preset threshold, such as 30%, it indicates that the prediction accuracy of the current model is low. Therefore, the detected real-time bandwidth is used as the standard, and model recalibration is triggered to reduce the error of model prediction.

[0068] Step S13: Determine the transmission priority according to the service type of the data packet, and allocate bandwidth resources and packet sending strategies for the data packet according to the current bandwidth, the predicted bandwidth, and the transmission priority, so as to control the transmission of the data packet based on the bandwidth resources and the packet sending strategy.

[0069] In this embodiment, a priority scheduler is further provided in the routing management. The priority scheduler can determine the transmission priority of data packets according to the service type of the data packets and mark corresponding priority tags for them. For example, real-time control instructions related to brake control and vehicle steering have a higher priority, while log upload, entertainment system data, etc. have a relatively lower priority. It should be noted that the probe packets will also be marked as low priority to ensure that they do not affect the transmission of real-time service data. In addition, a memory pool and a fragmentation processor are further provided in the routing management. The memory pool is used to temporarily store the packet data to be sent to ensure effective management of the data stream when the bandwidth is limited. The fragmentation processor performs fragmentation or merging processing on the packets according to the bandwidth prediction result and the instructions of the priority scheduler to optimize the bandwidth utilization rate and reduce packet loss.

[0070] That is to say, the present application finally allocates bandwidth resources and packet sending strategies for data packets with reference to multiple factors such as the current bandwidth, predicted bandwidth, and transmission priority, so as to control the transmission of data packets in the memory pool based on the bandwidth resources and packet sending strategies. That is, by combining the real-time dynamic detection of the current bandwidth with the learning of historical bandwidth, the present application can quickly respond to network changes, and the present application will also determine the transmission priority of data packets, so as to allocate bandwidth resources and packet sending strategies according to the transmission priority, the purpose of which is to ensure that some key services can be transmitted in a timely manner. In this way, by combining the current bandwidth, predicted bandwidth, and transmission priority, traffic control can be performed during data transmission to reduce the packet loss problem and improve system stability.

[0071] It can be seen that before the local application in the first on-chip system generates a data packet to be transmitted and transmits the data packet to the target application in the second on-chip system, it is necessary to use a preset detection engine to send a detection packet, so as to determine the current bandwidth of the target transmission path based on the round-trip delay and packet loss rate of the detection packet. The target transmission path refers to the transmission path between the local application and the target application. In addition, this application also needs to use a preset prediction engine to predict the bandwidth of the target transmission path in a future time period based on the current bandwidth and the historical bandwidth of the target transmission path, so as to obtain a predicted bandwidth. Moreover, this application also needs to determine the transmission priority according to the service type of the data packet. Finally, with reference to multiple factors such as the current bandwidth, the predicted bandwidth, and the transmission priority, bandwidth resources and packet sending strategies are allocated for the data packet, so as to control the transmission of the data packet based on the bandwidth resources and the packet sending strategies. By combining the real-time dynamic detection of the current bandwidth with the learning of the historical bandwidth, this application can quickly respond to network changes. In addition, this application will also determine the transmission priority of the data packet, so as to allocate bandwidth resources and packet sending strategies according to the transmission priority, with the aim of ensuring that some key services can be transmitted in a timely manner. In this way, by combining the current bandwidth, the predicted bandwidth, and the transmission priority, traffic control can be performed during data transmission to reduce packet loss problems and improve system stability.

[0072] See Figure 3 As shown, the embodiment of the present application discloses a specific packet sending method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically, it includes:

[0073] Step S21: Before transmitting the data packet generated by the local application to the target application in the second on-chip system, use the preset detection engine to send a detection packet to the second on-chip system through the target transmission path based on a preset sending frequency, so as to obtain the round-trip delay and packet loss rate of the detection packet on the target transmission path; the header of the detection packet includes a sending timestamp and a sequence number; the target transmission path is the transmission path between the local application and the target application.

[0074] In this embodiment, the preset detection engine sends probe packets to the second system-on-chip through the target transmission path based on the preset sending frequency, so as to obtain the round-trip time (RTT) and packet loss rate of the probe packets on the target transmission path. Among them, the probe packet is also a data packet based on the UDP protocol, with a fixed 10-byte payload, and the header includes a sending timestamp and a sequence number. The target transmission path refers to the transmission path between the local application and the target application, and this target transmission path is pre-allocated for data transmission between the local application and the target application. It should be noted that the number of target transmission paths can be 1 or multiple. When there are multiple (multi-network card environment), the bandwidth of each transmission path needs to be independently counted, that is, probe packets are sent separately on each path.

[0075] Furthermore, the above method further includes: counting the volatility of the probe packets; where the volatility is the ratio of the standard deviation to the mean of the round-trip delays within a continuous first preset number of times; if the volatility is less than the first preset volatility threshold, then reduce the preset sending frequency; if the volatility is greater than the second preset volatility threshold or the packet loss rate is greater than the preset packet loss rate threshold, then increase the preset sending frequency.

[0076] That is, the present application can realize the adaptive change of the preset sending frequency. Specifically, the volatility of the probe packets can be counted. The volatility refers to the ratio of the standard deviation to the mean of the round-trip delays within a continuous first preset number of times. If the volatility is less than the first preset volatility threshold, then reduce the preset sending frequency. If the volatility is greater than the second preset volatility threshold or the packet loss rate is greater than the preset packet loss rate threshold, then increase the preset sending frequency. For example, assume that the initial value of the preset sending frequency is 1 time per second and it is dynamically adjusted according to network stability: if the volatility calculated based on the round-trip delays within 3 consecutive times is less than 10%, then reduce the sending frequency to 1 time per 2 seconds; if the packet loss rate is greater than 2% or the volatility is greater than 20%, then increase the sending frequency to 5 times per second.

[0077] Step S22: Calculate the reference bandwidth based on the round-trip delay and the size of the probe packet, and adjust the reference bandwidth based on the packet loss rate to obtain the current bandwidth of the target transmission path.

[0078] In this embodiment, the reference bandwidth is calculated based on the round-trip delay and the size of the probe packet, and its specific calculation formula is:

[0079] Bandwidth = Probe packet size × Sliding window size / Round-trip delay;

[0080] Among them, the sliding window refers to the sliding window used in subsequent prediction by the triple exponential smoothing model. By combining the maximum effective throughput within the sliding window, the upper limit of the instantaneous bandwidth can be estimated, that is, the value of the reference bandwidth can be obtained. Further, the present application adjusts the reference bandwidth based on the packet loss rate to obtain the current bandwidth of the target transmission path.

[0081] In the specific implementation manner, the above adjustment of the reference bandwidth based on the packet loss rate to obtain the current bandwidth of the target transmission path includes: if the packet loss rate is not greater than the first preset threshold, directly use the reference bandwidth as the current bandwidth of the target transmission path; if the packet loss rate is greater than the first preset threshold and not greater than the second preset threshold, use the attenuation model constructed based on the packet loss rate to perform attenuation processing on the reference bandwidth to obtain the current bandwidth of the target transmission path; if the packet loss rate is greater than the second preset threshold, perform attenuation processing on the reference bandwidth based on a preset proportionality coefficient to obtain the current bandwidth of the target transmission path.

[0082] That is, in the first specific implementation manner, when the packet loss rate is not greater than the first preset threshold, the reference bandwidth value is trusted, that is, the reference bandwidth is directly used as the current bandwidth of the target transmission path. For example, assuming that the first preset threshold is 1%, then when the packet loss rate is less than or equal to 1%, the reference bandwidth is directly used as the current bandwidth.

[0083] In the second specific implementation manner, when the packet loss rate is greater than the first preset threshold and not greater than the second preset threshold, use the attenuation model constructed based on the packet loss rate to perform attenuation processing on the reference bandwidth to obtain the current bandwidth of the target transmission path. For example, assuming that the first preset threshold is 1% and the second preset threshold is 5%, then when the packet loss rate is greater than 1% and less than 5%, the following formula is used to perform attenuation processing on the reference bandwidth to obtain the current bandwidth:

[0084] Current bandwidth = reference bandwidth × (1 - packet loss rate).

[0085] In the third specific implementation manner, when the packet loss rate is greater than the second preset threshold, it indicates that the network may already be in a congested state or the bandwidth resources are severely insufficient. At this time, the bandwidth protection mode is triggered, and the reference bandwidth is attenuated based on a preset proportionality coefficient to obtain the current bandwidth of the target transmission path. Usually, the proportionality coefficient is 50%, that is, only 50% of the reference bandwidth is allowed to be used currently, so as to prevent excessive bandwidth occupation from causing the network to completely collapse.

[0086] Step S23: Obtain the prediction result of the bandwidth of the target transmission path in the future time period based on the current bandwidth and the historical bandwidth of the target transmission path by the preset prediction engine to obtain the predicted bandwidth.

[0087] Step S24: Determine the transmission priority according to the service type of the data packet, and allocate bandwidth resources and packet sending policies for the data packet according to the current bandwidth, the predicted bandwidth, and the transmission priority, so as to control the transmission of the data packet based on the bandwidth resources and the packet sending policies.

[0088] In a specific implementation manner, the above-mentioned allocation of bandwidth resources and packet sending policies for the data packet according to the current bandwidth, the predicted bandwidth, and the transmission priority includes: if it is determined based on the transmission priority that the data packet is a data packet corresponding to a preset high-priority service, then allocate bandwidth resources corresponding to the corresponding bandwidth requirements and a first packet sending policy for the data packet; wherein, the first packet sending policy is used to stipulate that the original data packet is transmitted at a preset maximum rate; if it is determined based on the transmission priority that the data packet is a data packet corresponding to a preset low-priority service, then obtain the remaining bandwidth resources, and allocate the remaining bandwidth resources to the data packet, and then determine whether the predicted bandwidth is greater than the current bandwidth; the remaining bandwidth resources are the remaining bandwidth resources after allocating the corresponding bandwidth resources for the rest of the preset high-priority services; if the predicted bandwidth is greater than the current bandwidth, then obtain a second packet sending policy; the second packet sending policy is a policy for combining and sending several data packets; if the predicted bandwidth is not greater than the current bandwidth, then obtain a third packet sending policy; the third packet sending policy is a policy for splitting and sending a single data packet.

[0089] That is, in a specific implementation manner, if it is determined based on the transmission priority that the data packet is a data packet corresponding to a preset high-priority service, for example, the data packet is related to a real-time control instruction, then allocate bandwidth resources corresponding to the corresponding bandwidth requirements and a first packet sending policy for the data packet, and the first packet sending policy is used to stipulate that the original data packet is transmitted at a preset maximum rate. It can be understood that the preset high-priority service will preferentially occupy the bandwidth to ensure that its data can be sent at the maximum rate.

[0090] In another specific embodiment, if a data packet is determined to be a data packet corresponding to a preset low-priority service based on the transmission priority, for example, the data packet is uploaded log data or entertainment system data, then the remaining bandwidth resources are obtained and allocated to the data packet. The remaining bandwidth resources refer to the remaining bandwidth resources after the corresponding bandwidth resources are allocated for the rest of the preset high-priority services. That is to say, the bandwidth resources will first satisfy the preset high-priority services, and the low-priority services can use the remaining bandwidth resources after the high-priority services are allocated. Further, it is also necessary to determine whether the predicted bandwidth is greater than the current bandwidth. If the predicted bandwidth is greater than the current bandwidth, it means that the bandwidth will increase in a future period of time. Therefore, a second packet sending strategy is obtained. The second packet sending strategy is a strategy for combining and sending several data packets, that is, combining small packets to be sent into large packets (such as combining from 1KB to 4KB), so as to reduce the protocol header overhead. If the predicted bandwidth is not greater than the current bandwidth, it means that the bandwidth will decrease in a future period of time. Therefore, a third packet sending strategy is obtained. The third packet sending strategy is a strategy for splitting and sending a single data packet, that is, if the predicted bandwidth decreases, the data packet is fragmented into smaller packets in advance (such as fragmenting from 4KB to 512B) to avoid sudden packet loss.

[0091] Further, the above method further includes: if the current packet loss rate exceeds the second preset threshold, stop sending the data packet corresponding to the preset low-priority service; or, if the probe packet is lost for a second preset number of consecutive times, stop sending the data packet corresponding to the preset low-priority service.

[0092] That is, in a specific embodiment, when the packet loss rate exceeds the second preset threshold (such as 5%), stop sending the data packet corresponding to the preset low-priority service to give priority to ensuring the integrity of the high-priority service. At the same time, combined with the aforementioned situation that when the packet loss rate is greater than the second preset threshold, only 50% of the reference bandwidth is allowed to be used, it can be known that currently only 50% of the reference bandwidth is allowed to be used by the preset high-priority service.

[0093] In another specific embodiment, if the probe packet is lost for a second preset number of consecutive times, for example, the probe packet is lost continuously for 2 times, the data packet corresponding to the preset low-priority service will also be stopped from being sent, and the network congestion state will be marked.

[0094] Among them, for a more specific processing process of the above step S23, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.

[0095] It can be seen that by combining the dynamic detection of the current bandwidth with the learning and prediction of the historical bandwidth, the present application can respond to network changes more quickly. In addition, for data packets corresponding to preset low-priority services, the packet splitting strategy or packet combining and sending strategy can be adaptively adjusted according to the change of the predicted bandwidth to improve the bandwidth utilization rate. Moreover, by dividing the transmission priorities, it can ensure that critical services are not affected by low bandwidth. In this way, by applying traffic control to the VSOMEIP implementation, VSOMEIP can adaptively control data transmission, ensure data reliability, and achieve lighter and lower-overhead bandwidth monitoring and traffic control.

[0096] See Figure 4 As shown, an embodiment of the present application discloses a message sending device applied to a first system on a chip. The device includes:

[0097] A detection module 11, configured to obtain the current bandwidth of a target transmission path determined by a preset detection engine based on the round-trip delay and packet loss rate of a detection packet before transmitting a data packet generated by a local application to a target application in a second system on a chip; wherein, the target transmission path is the transmission path between the local application and the target application;

[0098] A prediction module 12, configured to obtain a prediction result of the bandwidth of the target transmission path in a future time period by a preset prediction engine based on the current bandwidth and the historical bandwidth of the target transmission path to obtain a predicted bandwidth;

[0099] A transmission module 13, configured to determine a transmission priority according to the service type of the data packet, and allocate bandwidth resources and a message sending strategy for the data packet according to the current bandwidth, the predicted bandwidth, and the transmission priority, so as to control the transmission of the data packet based on the bandwidth resources and the message sending strategy.

[0100] It can be seen that before the local application in the first on-chip system generates a data packet to be transmitted and transmits the data packet to the target application in the second on-chip system, it is necessary to use a preset detection engine to send a detection packet, so as to determine the current bandwidth of the target transmission path based on the round-trip delay and packet loss rate of the detection packet. The target transmission path refers to the transmission path between the local application and the target application. In addition, this application also needs to use a preset prediction engine to predict the bandwidth of the target transmission path in a future time period based on the current bandwidth and the historical bandwidth of the target transmission path, so as to obtain the predicted bandwidth. Moreover, this application also needs to determine the transmission priority according to the service type of the data packet. Finally, with reference to multiple factors such as the current bandwidth, the predicted bandwidth, and the transmission priority, bandwidth resources and packet sending strategies are allocated for the data packet, so as to control the transmission of the data packet based on the bandwidth resources and the packet sending strategies. By combining the real-time dynamic detection of the current bandwidth with the learning of the historical bandwidth, this application can quickly respond to network changes, and this application will also determine the transmission priority of the data packet, so as to allocate bandwidth resources and packet sending strategies according to the transmission priority. The purpose is to ensure that some key services can be transmitted in a timely manner. In this way, by combining the current bandwidth, the predicted bandwidth, and the transmission priority, traffic control can be performed during data transmission to reduce packet loss problems and improve system stability.

[0101] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of this application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the packet sending method executed by the electronic device disclosed in any of the foregoing embodiments.

[0102] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of this application, and no specific limitation is made here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitation is made here.

[0103] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for the rendering and drawing of the content to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.

[0104] In addition, the memory 22, as a carrier for resource storage, may be a read-only memory, a random access memory, a disk, or an optical disc, etc. The resources stored thereon include an operating system 221, a computer program 222, data 223, etc., and the storage method may be temporary storage or permanent storage.

[0105] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 222 on the electronic device 20, so as to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21. It may be Windows, Unix, Linux, etc. In addition to the computer program capable of implementing the message sending method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks. The data 223 may include not only the data transmitted by external devices received by the electronic device, but also the data collected by its own input / output interface 25, etc.

[0106] Furthermore, the embodiments of the present application also disclose a computer-readable storage medium. When the computer program stored in the storage medium is loaded and executed by a processor, the steps of the message sending method disclosed in any of the foregoing embodiments are implemented.

[0107] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method section.

[0108] Those skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0109] The steps of the methods or algorithms described in combination with the embodiments disclosed in this article can be directly implemented by hardware, software modules executed by a processor, or a combination of the two. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, compact disc read-only memory (CD-ROM), or any other form of storage medium well-known in the technical field.

[0110] Finally, it should also be noted that in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. Without further limitations, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.

[0111] The above has introduced in detail a message sending method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A message sending method, characterized in that: Applied to the first system-on-chip, including: Before transmitting a data message generated by a local application to a target application in a second system on chip, obtaining a current bandwidth of a target transmission path determined by a preset detection engine based on a round-trip delay and a packet loss rate of a detection packet; wherein the target transmission path is a transmission path between the local application and the target application; Obtaining a prediction result of a preset prediction engine on the bandwidth of the target transmission path in a future time period based on the current bandwidth and the historical bandwidth of the target transmission path, so as to obtain a predicted bandwidth; The transmission priority is determined according to the service type of the data message, and bandwidth resources and a message sending strategy are allocated to the data message according to the current bandwidth, the predicted bandwidth and the transmission priority, so as to control the transmission of the data message based on the bandwidth resources and the message sending strategy.

2. The message sending method according to claim 1, characterized in that: The obtaining of the current bandwidth of the target transmission path determined by the preset detection engine based on the round-trip delay and packet loss rate of the detection packet includes: Using the preset detection engine to send a detection packet to the second system-on-chip through a target transmission path based on a preset transmission frequency, so as to obtain a round-trip delay and a packet loss rate of the detection packet on the target transmission path; the header of the detection packet includes a transmission timestamp and a sequence number; A reference bandwidth is calculated based on the round-trip delay and the size of the detection packet, and the reference bandwidth is adjusted based on the packet loss rate to obtain a current bandwidth of the target transmission path.

3. The message sending method according to claim 2, characterized in that: The adjusting the reference bandwidth based on the packet loss rate to obtain the current bandwidth of the target transmission path includes: If the packet loss rate is not greater than a first preset threshold, directly using the reference bandwidth as the current bandwidth of the target transmission path; If the packet loss rate is greater than the first preset threshold and not greater than the second preset threshold, attenuating the reference bandwidth using an attenuation model constructed based on the packet loss rate to obtain a current bandwidth of the target transmission path; If the packet loss rate is greater than the second preset threshold, the reference bandwidth is attenuated based on a preset proportional coefficient to obtain the current bandwidth of the target transmission path.

4. The message sending method according to claim 2, characterized in that: Also includes: Counting the fluctuation rate of the detection packet; wherein the fluctuation rate is the ratio of the standard deviation and the mean value corresponding to the round-trip delay within a first preset number of consecutive times; If the fluctuation rate is less than a first preset fluctuation threshold, reducing the preset sending frequency; If the fluctuation rate is greater than a second preset fluctuation threshold or the packet loss rate is greater than a preset packet loss rate threshold, the preset sending frequency is increased.

5. The message sending method according to claim 3, characterized in that: The allocating bandwidth resources and a message sending strategy for the data message according to the current bandwidth, the predicted bandwidth and the transmission priority includes: If the data message is determined to be a data message corresponding to a preset high priority service based on the transmission priority, bandwidth resources corresponding to the bandwidth requirement and a first message sending strategy are allocated to the data message; wherein the first message sending strategy is used to specify that the original data message is transmitted at a preset maximum rate; If the data packet is determined to be a data packet corresponding to a preset low-priority service based on the transmission priority, then obtaining remaining bandwidth resources, allocating the remaining bandwidth resources to the data packet, and then determining whether the predicted bandwidth is greater than the current bandwidth; the remaining bandwidth resources are the remaining bandwidth resources after allocating corresponding bandwidth resources to the remaining preset high-priority services; If the predicted bandwidth is greater than the current bandwidth, a second message sending strategy is obtained; the second message sending strategy is a strategy for merging and sending a plurality of data packets; If the predicted bandwidth is not greater than the current bandwidth, a third message sending strategy is obtained; the third message sending strategy is a strategy for sending a single data packet in packets.

6. The message sending method according to claim 5, characterized in that: Also includes: If the current packet loss rate exceeds the second preset threshold, stop sending the data message corresponding to the preset low priority service; Or, if the detection packet is lost for a second preset number of times in succession, the sending of the data message corresponding to the preset low priority service is stopped.

7. The message sending method according to any one of claims 1 to 6, characterized in that: The preset prediction engine is constructed based on a cubic exponential smoothing model; Accordingly, the obtaining of the prediction result of the preset prediction engine on the bandwidth of the target transmission path in the future time period based on the current bandwidth and the historical bandwidth of the target transmission path includes: Inputting the current bandwidth and the historical bandwidth of the target transmission path into the triple exponential smoothing model to construct a horizontal component, a trend component and a seasonal component; A prediction result of the bandwidth of the target transmission path in a future time period is determined based on the horizontal component, the trend component, and the season component.

8. A message sending device, characterized in that: Applied to the first system-on-chip, including: A detection module, used for obtaining a current bandwidth of a target transmission path determined by a preset detection engine based on a round-trip delay and a packet loss rate of a detection packet before transmitting a data message generated by a local application to a target application in a second system on chip; wherein the target transmission path is a transmission path between the local application and the target application; A prediction module, used to obtain a prediction result of a preset prediction engine on the bandwidth of the target transmission path in a future time period based on the current bandwidth and the historical bandwidth of the target transmission path, so as to obtain a predicted bandwidth; A transmission module is used to determine a transmission priority according to the service type of the data message, and allocate bandwidth resources and a message sending strategy to the data message according to the current bandwidth, the predicted bandwidth and the transmission priority, so as to control the transmission of the data message based on the bandwidth resources and the message sending strategy.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the message sending method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the steps of the message sending method according to any one of claims 1 to 7 are implemented.