CN115766606A - Data transmission method and device, vehicle-mounted terminal and storage medium - Google Patents

Data transmission method and device, vehicle-mounted terminal and storage medium Download PDF

Info

Publication number
CN115766606A
CN115766606A CN202211374868.9A CN202211374868A CN115766606A CN 115766606 A CN115766606 A CN 115766606A CN 202211374868 A CN202211374868 A CN 202211374868A CN 115766606 A CN115766606 A CN 115766606A
Authority
CN
China
Prior art keywords
window
size
data
data transmission
transmitted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211374868.9A
Other languages
Chinese (zh)
Inventor
袁鹏虎
杨振
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Great Wall Motor Co Ltd
Original Assignee
Great Wall Motor Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Great Wall Motor Co Ltd filed Critical Great Wall Motor Co Ltd
Priority to CN202211374868.9A priority Critical patent/CN115766606A/en
Publication of CN115766606A publication Critical patent/CN115766606A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application is applicable to the technical field of data processing, and provides a data transmission method, a data transmission device, a vehicle-mounted terminal and a computer readable storage medium, wherein the method comprises the following steps: acquiring data to be transmitted and the available cache capacity of a gateway controller used in the transmission process of the data to be transmitted; according to the available buffer capacity, adjusting the window size of a data transmission window of the gateway controller; and controlling the gateway controller to adopt the data transmission window with the adjusted window size to transmit the data to be transmitted. Compared with the prior art that the window size of the data transmission window for data transmission is fixed, the window size of the data transmission window can be adjusted in real time according to the available cache capacity of the gateway controller used in the transmission process, and therefore the flexibility and the practicability of data transmission are improved.

Description

Data transmission method and device, vehicle-mounted terminal and storage medium
Technical Field
The present application belongs to the field of data processing technologies, and in particular, to a data transmission method, an apparatus, a vehicle-mounted terminal, and a computer-readable storage medium.
Background
With the rapid development of automobile intelligence, the functions that an automobile can realize are more and more complex, so that the larger the software inside an automobile Domain Controller Unit (DCU) is, which is the core of the automobile intelligence, the more the software inside the DCU is, the more the automobile Domain Controller Unit (DCU) is developed from the first hundred million level to the present giga level, and the software inside the DCU generally needs to be updated and upgraded to realize more functions.
At present, when an automobile domain controller updates or upgrades software, a data packet of the software needs to be refreshed, specifically, the data packet is firstly transmitted to a DoIP cache region of a gateway controller, and after the data packet is received by the gateway controller, the data packet is transmitted to an Electronic Control Unit (ECU) of a vehicle for refreshing data. However, during data transmission, the data receiving window and the data sending window of the gateway controller are usually fixed due to the fact that the data packets are too large, so that the flexibility and the practicability of data transmission are low.
Disclosure of Invention
The embodiment of the application provides a data transmission method, a data transmission device, a vehicle-mounted terminal and a computer readable storage medium, and improves the flexibility and the practicability of data transmission.
In a first aspect, an embodiment of the present application provides a data transmission method, including:
acquiring data to be transmitted and the usable cache capacity of a gateway controller used in the transmission process of the data to be transmitted;
according to the available buffer capacity, adjusting the window size of a data transmission window of the gateway controller;
and controlling the gateway controller to adopt the data transmission window with the adjusted window size to transmit the data to be transmitted.
Optionally, the data transmission window includes a receiving window and a sending window; the window size comprises a first size of the receive window and a second size of the transmit window; the adjusting the window size of the data transmission window of the gateway controller according to the available buffer capacity includes:
acquiring a first cache capacity corresponding to the receiving window and a second cache capacity corresponding to the sending window;
calculating the sum of the first cache capacity and the second cache capacity to obtain a target cache capacity;
if the difference value between the available cache capacity and the target cache capacity is larger than a first threshold value, respectively adjusting the first size and the second size according to a first adjustment strategy;
if the difference value between the available cache capacity and the target cache capacity is smaller than a second threshold value, respectively adjusting the first size and the second size according to a second adjustment strategy; the first threshold is greater than the second threshold;
if the difference between the available cache capacity and the target cache capacity is between the first threshold and the second threshold, adjusting the first size and the second size according to the first adjustment strategy, or adjusting the first size and the second size according to the second adjustment strategy.
Optionally, the adjusting the first size and the second size according to a first adjustment policy respectively includes:
determining the reference transmission quantity of the data to be transmitted in the data transmission service, wherein the reference transmission quantity is the single data transmission quantity corresponding to the data transmission service;
and adjusting the first size and the second size according to the reference transmission amount.
Optionally, the adjusting the first size and the second size according to the reference transmission amount includes:
determining the size of a target window according to the reference transmission quantity;
adjusting both the first size and the second size to the target window size.
Optionally, the adjusting the first size and the second size according to a second adjustment policy respectively includes:
when the receiving window is detected to be in a working state, increasing the first size based on the second cache capacity, and decreasing the second size based on the second cache capacity;
and when the sending window is detected to be in a working state, increasing the second size based on the first cache capacity, and decreasing the first size based on the first cache capacity.
Optionally, the data transmission window after the window size is adjusted includes an adjusted receiving window and an adjusted sending window; the controlling the gateway controller to transmit the data to be transmitted by adopting the data transmission window with the adjusted window size comprises the following steps:
if the data volume of the data to be transmitted is larger than a third threshold value, dividing the data to be transmitted into a plurality of data packets;
sequentially transmitting the plurality of data packets to the adjusted receiving window;
when detecting that the plurality of data packets have been successfully transmitted to the adjusted receive window, transmitting the plurality of data packets to an electronic control unit of a vehicle through the adjusted transmit window.
Optionally, after the transmitting the plurality of data packets to the electronic control unit of the vehicle through the adjusted sending window, the method further includes:
and controlling the electronic control unit to carry out data flash on the data to be transmitted, which are obtained by restoring the plurality of data packets.
In a second aspect, an embodiment of the present application provides a data transmission apparatus, including:
the first obtaining unit is used for obtaining the data to be transmitted and the available buffer capacity of the gateway controller used in the transmission process of the data to be transmitted.
A first adjusting unit, configured to adjust a window size of a data transmission window of the gateway controller according to the available buffer capacity.
And the first control unit is used for controlling the gateway controller to adopt the data transmission window with the adjusted window size to transmit the data to be transmitted.
In a third aspect, an embodiment of the present application provides a vehicle-mounted terminal, including: a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the data transmission method according to any one of the first aspect when executing the computer program.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the data transmission method according to any one of the foregoing first aspects.
In a fifth aspect, the present application provides a computer program product, when the computer program product runs on a vehicle-mounted terminal, the vehicle-mounted terminal may execute the data transmission method according to any one of the first aspect.
Compared with the prior art, the embodiment of the application has the beneficial effects that:
according to the data transmission method provided by the embodiment of the application, the data to be transmitted and the usable cache capacity of the gateway controller used in the transmission process of the data to be transmitted are obtained; according to the available buffer capacity, adjusting the window size of a data transmission window of the gateway controller; and controlling the gateway controller to adopt the data transmission window with the adjusted window size to transmit the data to be transmitted. Compared with the prior art that the window size of the data transmission window for data transmission is fixed, the window size of the data transmission window can be adjusted in real time according to the available cache capacity of the gateway controller used in the transmission process, and therefore the flexibility and the practicability of data transmission are improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a flowchart illustrating an implementation of a data transmission method according to an embodiment of the present application;
fig. 2 is a flowchart illustrating an implementation of a data transmission method according to another embodiment of the present application;
fig. 3 is a flowchart illustrating an implementation of a data transmission method according to still another embodiment of the present application;
fig. 4 is a flowchart illustrating an implementation of a data transmission method according to another embodiment of the present application;
fig. 5 is a flowchart illustrating an implementation of a data transmission method according to another embodiment of the present application;
fig. 6 is a schematic structural diagram of a data transmission device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a vehicle-mounted terminal according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless otherwise specifically stated.
In practical applications, with the rapid development of automobile intelligence, the functions that an automobile can implement are more and more complex, and therefore, the larger the software inside an automobile Domain Controller (DCU), which is the core of automobile intelligence, is, the larger the software inside the DCU is, the more the software is developed from the initial tera level to the present giga level, and the software inside the DCU needs to be updated and upgraded to implement more functions.
When the automobile domain controller updates or upgrades the software, the data packet of the software needs to be refreshed, that is, the data packet is firstly transmitted to a DoIP cache region of a gateway Controller (CEM), and the gateway controller transmits the data packet to an Electronic Control Unit (ECU) of the vehicle for data refreshing after receiving the data packet.
However, the time consumed in transferring the data packet from the CEM is long, and is limited by the receiving window of the CEM, and the data received by the receiving window is processed before the receiving window is full, and the receiving of the data can be started again after the processing is finished. Similarly, when the CEM transmits data to the ECU of the vehicle through the sending window, after the sending window limited by the CEM sends a TCP message every 4 frames, the sending window needs to release the buffer and wait for the TCP protocol stack of the task period to recall the data, and then continue to send the data.
Based on the above, the application provides a data transmission method, which comprises the steps of obtaining data to be transmitted and the available buffer capacity of a gateway controller used in the transmission process of the data to be transmitted; according to the available buffer capacity, adjusting the window size of a data transmission window of the gateway controller; and controlling the gateway controller to adopt the data transmission window with the adjusted window size to transmit the data to be transmitted. The data transmission method can flexibly adjust the window size of the data transmission window of the gateway controller according to the available cache capacity of the gateway controller, so that the flexibility and the practicability of data transmission are improved.
Referring to fig. 1, fig. 1 is a flowchart illustrating an implementation of a data transmission method according to an embodiment of the present disclosure. In the embodiment of the application, the main execution body of the data transmission method is a vehicle-mounted terminal.
As shown in fig. 1, a data transmission method provided in an embodiment of the present application may include S101 to S103, which are detailed as follows:
in S101, data to be transmitted and the available buffer capacity of the gateway controller used in the transmission process of the data to be transmitted are obtained.
In the embodiment of the application, when the car domain controller of the vehicle needs to update or upgrade software, a data packet of the software generally needs to be sent to an Electronic Control Unit (ECU) of the vehicle for data flashing, so that at this time, the vehicle-mounted terminal may obtain data to be transmitted and available buffer capacity of a gateway controller used in a transmission process of the data to be transmitted.
In S102, a window size of a data transmission window of the gateway controller is adjusted according to the available buffer capacity.
In practical applications, the window size of the data transmission window of the gateway controller is determined according to the buffer capacity allocated to the data transmission window by the gateway controller.
Based on this, in the embodiment of the present application, the vehicle-mounted terminal may adjust the buffer capacity of the data transmission window of the gateway controller according to the available buffer capacity of the gateway controller, that is, dynamically adjust the window size of the data transmission window.
It should be noted that, the data transmission window includes a receiving window and a sending window, and therefore, the window size of the data transmission window includes a first size of the receiving window and a second size of the sending window, and based on this, in an embodiment of the present application, to improve the data transmission efficiency, the in-vehicle terminal may specifically adjust the window size of the data transmission window of the gateway controller through S201 to S205 shown in fig. 2, which is detailed as follows:
in S201, a first buffer capacity corresponding to the receiving window and a second buffer capacity corresponding to the sending window are obtained.
In S202, a sum of the first cache capacity and the second cache capacity is calculated to obtain a target cache capacity.
In this embodiment, after obtaining the target cache capacity, the vehicle-mounted terminal may calculate a difference between the available cache capacity and the target cache capacity, and compare the difference with the first threshold and the second threshold, respectively. The first threshold and the second threshold may be determined according to actual needs, which are not limited herein, and the first threshold is greater than the second threshold.
In some possible embodiments, the first threshold and the second threshold may be determined according to a reference transmission amount in the data transmission service. For example, the first threshold may be a first preset multiple of the reference transmission amount, and the second threshold may be a second preset multiple of the reference transmission amount. The first preset multiple may be 2 times, the second preset multiple may be 0.5 time, and the first preset multiple is greater than the second preset multiple.
It should be noted that, when the domain controller of the vehicle needs to update or upgrade the software, a data packet of the software is usually sent to an Electronic Control Unit (ECU) of the vehicle for data writing, and at this time, the vehicle-mounted terminal needs to perform data transmission through a data transmission service (i.e., 36 services) dedicated to data transmission. The reference transfer amount refers to the data amount of 36 services per transfer when the ECU is upgraded, namely the single data transfer amount.
In this embodiment, the first threshold and the second threshold are determined according to the reference transmission amount in the data transmission service, so that the vehicle-mounted terminal can make clear the difference between the available buffer capacity and the target buffer capacity and the relationship between the single data transmission amounts, and determine whether the first size of the receiving window and the second size of the sending window can be adjusted by using the available buffer capacity, so that the adjusted receiving window and sending window can finish data transmission with the data amount as the reference transmission amount at one time, and the working efficiency of the vehicle-mounted terminal is improved.
In an embodiment of the present application, the in-vehicle terminal may execute step S203 when detecting that a difference between the target buffer capacity and the available buffer capacity of the gateway controller is greater than a first threshold.
In another embodiment of the present application, the vehicle-mounted terminal may execute step S204 when detecting that the difference between the target buffer capacity and the available buffer capacity of the gateway controller is smaller than the second threshold.
In still another embodiment of the present application, the in-vehicle terminal may execute step S205 when detecting that a difference between the target buffer capacity and the available buffer capacity of the gateway controller is between the first threshold and the second threshold.
In S203, if the difference between the available cache capacity and the target cache capacity is greater than a first threshold, the first size and the second size are respectively adjusted according to a first adjustment policy.
In this embodiment, when the vehicle-mounted terminal detects that the difference between the target cache capacity and the available cache capacity of the gateway controller is greater than the first threshold, it indicates that the available cache capacity of the gateway controller is sufficient, and the available cache capacity can be used, so that the vehicle-mounted terminal can respectively adjust the first size of the receiving window and the second size of the sending window of the gateway controller according to the first adjustment policy.
The first adjustment strategy is to allocate the available buffer capacity of the gateway controller to the receive window and the transmit window of the network controller, respectively, that is, the first size of the receive window and the second size of the transmit window are adjusted according to the available buffer capacity of the gateway controller.
Specifically, in an embodiment of the present application, the vehicle-mounted terminal may implement step S203 through S301 to S302 shown in fig. 3, which are detailed as follows:
in S301, a reference transmission amount of the data to be transmitted in a data transmission service is determined, where the reference transmission amount is a single data transmission amount corresponding to the data transmission service.
In S302, the first size and the second size are adjusted according to the reference transmission amount.
In this embodiment, the vehicle-mounted terminal may allocate the available buffer capacity of the gateway controller to the receiving window and the sending window respectively based on the reference transmission amount of the data to be transmitted in the data transmission service, that is, complete the adjustment of the first size of the receiving window and the second size of the sending window.
Specifically, in an embodiment of the present application, the vehicle-mounted terminal may implement step S302 by the following steps, which are detailed as follows:
determining the size of a target window according to the reference transmission quantity;
adjusting both the first size and the second size to the target window size.
In this embodiment, after receiving data with a size equal to the window size of the receiving window (i.e., after full reception), the receiving window of the gateway controller needs to process the data received by the receiving window first, and then can start receiving the data again after the processing is completed, and meanwhile, after the sending window of the gateway controller sends each 4 frames of TCP packets, the sending window needs to release the buffer and wait for the TCP protocol stack with a task period of 5ms to recall the data again.
It is understood that the minimum amount of data that the target window size can accommodate at a time is the above-mentioned reference transfer amount. For example, assuming that the reference transmission amount is 20k, the target window size is a size capable of accommodating at least 20k of data at a time.
Based on this, the vehicle-mounted terminal can respectively allocate the buffer capacity corresponding to the reference data volume in the available buffer capacity to the receiving window and the sending window, namely, the first size of the receiving window and the second size of the sending window are both adjusted to be the size of the target window, so that the data volume which can be received by the first size of the adjusted receiving window every time and the data volume which can be accommodated by the second size of the adjusted sending window are both larger than or equal to the reference transmission volume, the data of the reference transmission volume is prevented from being required to be received by the receiving window for multiple times, the sending window is sent for multiple times, the transmission speed is increased, and the data transmission efficiency is further increased.
In S204, if the difference between the available cache capacity and the target cache capacity is smaller than a second threshold, adjusting the first size and the second size according to a second adjustment policy, respectively; the first threshold is greater than the second threshold.
In this embodiment, when detecting that the difference between the target cache capacity and the available cache capacity of the gateway controller is smaller than the second threshold, the vehicle-mounted terminal indicates that the available cache capacity is insufficient and cannot be used, that is, the first size of the receiving window and the second size of the sending window cannot be adjusted according to the first adjustment policy, and therefore the vehicle-mounted terminal may respectively adjust the first size of the receiving window and the second size of the sending window according to the second adjustment policy.
The second adjustment strategy is to adjust the buffer capacities of the receiving window and the sending window according to whether the receiving window and the sending window are in the working state or not so as to adjust the first size of the receiving window and the second size of the sending window.
Specifically, in an embodiment of the present application, the vehicle-mounted terminal may implement step S204 through S401 to S402 shown in fig. 4, which are detailed as follows:
in S401, when it is detected that the receiving window is in the working state, the first size is increased based on the second buffer capacity, and the second size is decreased based on the second buffer capacity.
In S402, when it is detected that the transmission window is in the working state, the second size is increased based on the first buffer capacity, and the first size is decreased based on the first buffer capacity.
In practical applications, the receiving window and the transmitting window of the network controller cannot operate simultaneously, that is, when the receiving window is receiving data, the transmitting window cannot transmit data, when the transmitting window is transmitting data, the receiving window cannot receive data, that is, when the receiving window is receiving data, the second buffer capacity of the transmitting window is in an idle state, and when the transmitting window is transmitting data, the first buffer capacity of the receiving window is in an idle state.
Specifically, the in-vehicle terminal may allocate the second buffer capacity of the sending window to the receiving window, and increase the first size of the receiving window according to the window size corresponding to the second buffer capacity, and at the same time, since the second buffer capacity of the sending window is already allocated to the receiving window, that is, the sending window has no buffer capacity, the in-vehicle terminal needs to decrease the second size of the sending window according to the window size corresponding to the second buffer capacity.
It can be understood that, when the receiving window is in the working state, the in-vehicle terminal allocates the second buffer capacity of the sending window to the receiving window, that is, all buffer capacities of the sending window are allocated to the receiving window by the in-vehicle terminal. That is, the buffer capacity can be fully allocated to the receive window at this time, that is, all buffer space is allocated to the receive window when the receive window operates, so as to improve data transmission efficiency.
In this embodiment, when detecting that the sending window is in an operating state (i.e., is sending data), the in-vehicle terminal may increase the second size of the sending window based on the first buffer capacity of the receiving window, and decrease the first size of the receiving window based on the first buffer capacity.
Specifically, the in-vehicle terminal may allocate a first buffer capacity of the receiving window to the transmitting window, and increase the second size of the transmitting window according to a window size corresponding to the first buffer capacity, and at the same time, since the first buffer capacity of the receiving window is already allocated to the transmitting window, that is, the receiving window has no buffer capacity, the in-vehicle terminal needs to decrease the first size of the receiving window according to the window size corresponding to the first buffer capacity.
It can be understood that, when the sending window is in the working state, the in-vehicle terminal allocates the first buffer capacity of the receiving window to the sending window, that is, the in-vehicle terminal allocates all buffer capacities of the receiving window to the sending window. That is, at this time, all of the available buffer capacity is allocated to the transmission window, i.e., all buffer space is allocated to the transmission window when the transmission window is operated, to improve data transmission efficiency.
It can be seen that, the vehicle-mounted terminal can flexibly adjust the first size of the receiving window and the second size of the sending window according to the above manner, so that not only is the data transmission efficiency improved, but also the resource utilization rate of the cache capacity is improved.
In S205, if the difference between the available cache capacity and the target cache capacity is between the first threshold and the second threshold, the first size and the second size are respectively adjusted according to the first adjustment policy, or the first size and the second size are respectively adjusted according to the second adjustment policy.
In this embodiment, when the in-vehicle terminal detects that the difference between the target buffer capacity and the available buffer capacity of the gateway controller is between the first threshold and the second threshold, it indicates that the available buffer capacity of the network controller may be used, but the available amount is not large, so the in-vehicle terminal may randomly select any one of the first adjustment policy and the second adjustment policy, and adjust the first size of the receiving window and the second size of the sending window, that is, the in-vehicle terminal may adjust the first size of the receiving window and the second size of the sending window according to the first adjustment policy, or may adjust the first size of the receiving window and the second size of the sending window according to the second adjustment policy.
In S103, the gateway controller is controlled to transmit the data to be transmitted by using the data transmission window with the window size adjusted.
In the embodiment of the application, after the vehicle-mounted terminal adjusts the window size of the data transmission window of the network controller, the vehicle-mounted terminal can control the gateway controller to transmit the data to be transmitted by adopting the data transmission window with the adjusted window size.
In an embodiment of the present application, the vehicle-mounted terminal may specifically transmit the data to be transmitted through S501 to S503 shown in fig. 5, which are detailed as follows:
in S501, if the data amount of the data to be transmitted is greater than a third threshold, the data to be transmitted is divided into a plurality of data packets.
In this embodiment, when the data to be transmitted is transmitted through the data transmission service (i.e., 36 services), only the data whose data volume is the third threshold value can be transmitted to the maximum, so that when the data to be transmitted is transmitted by the vehicle-mounted terminal, the data volume of the data to be transmitted needs to be compared with the third threshold value. The third threshold may be determined according to actual needs, and is not limited herein, and for example, the third threshold may be 1500 bytes.
When the vehicle-mounted terminal detects that the data volume of the data to be transmitted is larger than the third threshold value, it indicates that the data to be transmitted needs unpacking, and therefore the vehicle-mounted terminal can divide the data to be transmitted into a plurality of data packets.
In S502, the plurality of data packets are sequentially transmitted to the adjusted receiving window.
In S503, when it is detected that the plurality of data packets have been successfully transmitted to the adjusted receiving window, the plurality of data packets are transmitted to the electronic control unit of the vehicle through the adjusted transmitting window.
In this embodiment, after obtaining a plurality of data packets of the data to be transmitted, the vehicle-mounted terminal may sequentially transmit the plurality of data packets to the adjusted receiving window.
When the vehicle-mounted terminal detects that the plurality of data packets are successfully transmitted to the adjusted receiving window, namely the adjusted receiving window successfully receives the plurality of data packets, the vehicle-mounted terminal indicates that the receiving window has completely received the data to be transmitted, so that the vehicle-mounted terminal can control the adjusted sending window to sequentially send the plurality of data packets to the electronic control unit of the vehicle, and the transmission of the data to be transmitted is completed.
In an embodiment of the application, after sending the plurality of data packets to an electronic control unit of a vehicle, the vehicle-mounted terminal may control the electronic control unit to perform data flash on to-be-transmitted data restored by the plurality of data packets.
As can be seen from the above, in the data transmission method provided in the embodiment of the present application, the data to be transmitted and the usable buffer capacity of the gateway controller used in the transmission process of the data to be transmitted are obtained; according to the available buffer capacity, adjusting the window size of a data transmission window of the gateway controller; and controlling the gateway controller to adopt the data transmission window with the adjusted window size to transmit the data to be transmitted. Compared with the prior art that the window size of the data transmission window for data transmission is fixed, the method and the device can adjust the window size of the data transmission window in real time according to the available cache capacity of the gateway controller used in the transmission process, so that the flexibility and the practicability of data transmission are improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 6 shows a block diagram of a data transmission device provided in the embodiment of the present application, where for convenience of description, only the relevant parts of the embodiment of the present application are shown. Referring to fig. 6, the data transmission apparatus 600 includes: a first acquiring unit 61, a first adjusting unit 62 and a first controlling unit 63. Wherein:
the first obtaining unit 61 is configured to obtain data to be transmitted and a usable buffer capacity of a gateway controller used by the data to be transmitted in a transmission process.
The first adjusting unit 62 is configured to adjust a window size of a data transmission window of the gateway controller according to the available buffer capacity.
The first control unit 63 is configured to control the gateway controller to transmit the data to be transmitted using the data transmission window with the adjusted window size.
In one embodiment of the present application, the data transmission window includes a reception window and a transmission window; the window size comprises a first size of the receive window and a second size of the transmit window; the first obtaining unit 61 specifically includes: the device comprises a second acquisition unit, a calculation unit, a second adjustment unit, a third adjustment unit and a fourth adjustment unit. Wherein:
the second obtaining unit is configured to obtain a first buffer capacity corresponding to the receiving window and a second buffer capacity corresponding to the sending window.
The calculation unit is used for calculating the sum of the first cache capacity and the second cache capacity to obtain a target cache capacity.
The second adjusting unit is configured to adjust the first size and the second size according to a first adjusting policy, if a difference between the available cache capacity and the target cache capacity is greater than a first threshold.
The third adjusting unit is configured to adjust the first size and the second size according to a second adjusting policy, if a difference between the available cache capacity and the target cache capacity is smaller than a second threshold; the first threshold is greater than the second threshold.
The fourth adjusting unit is configured to, if a difference between the available cache capacity and the target cache capacity is between the first threshold and the second threshold, respectively adjust the first size and the second size according to the first adjustment policy, or respectively adjust the first size and the second size according to the second adjustment policy.
In an embodiment of the present application, the first adjusting unit specifically includes: a first determining unit and a fifth adjusting unit. Wherein:
the first determining unit is configured to determine a reference transmission amount of the data to be transmitted in a data transmission service, where the reference transmission amount is a single data transmission amount corresponding to the data transmission service.
The fifth adjusting unit is used for adjusting the first size and the second size according to the reference transmission amount.
In an embodiment of the application, the fifth adjusting unit specifically includes: a second determining unit and a sixth adjusting unit. Wherein:
the second determining unit is used for determining the size of the target window according to the reference transmission amount.
The sixth adjusting unit is configured to adjust both the first size and the second size to the target window size.
In an embodiment of the application, the third adjustment determining unit specifically includes: a first increasing unit and a second increasing unit. Wherein:
the first increasing unit is configured to increase the first size based on the second buffer capacity and decrease the second size based on the second buffer capacity when the receiving window is detected to be in the working state.
The second increasing unit is configured to increase the second size based on the first buffer capacity and decrease the first size based on the first buffer capacity when it is detected that the sending window is in the working state.
In an embodiment of the present application, the window-sized data transmission window includes an adjusted receiving window and an adjusted sending window; the first control unit 63 specifically includes: the device comprises a dividing unit, a first transmission unit and a second transmission unit. Wherein:
the dividing unit is used for dividing the data to be transmitted into a plurality of data packets if the data volume of the data to be transmitted is greater than a third threshold value.
The first transmission unit is used for sequentially transmitting the plurality of data packets to the adjusted receiving window.
The second transmission unit is used for transmitting the data packets to an electronic control unit of a vehicle through the adjusted sending window when detecting that the data packets are successfully transmitted to the adjusted receiving window.
In one embodiment of the present application, the data transmission apparatus 600 further includes: a second control unit.
And the second control unit is used for controlling the electronic control unit to carry out data flash on the data to be transmitted, which are obtained by restoring the plurality of data packets.
It should be noted that, for the information interaction, execution process, and other contents between the above devices/units, the specific functions and technical effects thereof based on the same concept as those of the method embodiment of the present application can be specifically referred to the method embodiment portion, and are not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Fig. 7 is a schematic structural diagram of a vehicle-mounted terminal according to an embodiment of the present application. As shown in fig. 7, the in-vehicle terminal 7 of the embodiment includes: at least one processor 70 (only one shown in fig. 7), a memory 71, and a computer program 72 stored in the memory 71 and executable on the at least one processor 70, the processor 70 implementing the steps in any of the various data transmission method embodiments described above when executing the computer program 72.
The vehicle-mounted terminal may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art will appreciate that fig. 7 is only an example of the vehicle-mounted terminal 7, and does not constitute a limitation to the vehicle-mounted terminal 7, and may include more or less components than those shown, or combine some components, or different components, for example, and may further include an input/output device, a network access device, and the like.
The Processor 70 may be a Central Processing Unit (CPU), and the Processor 70 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 71 may in some embodiments be an internal storage unit of the in-vehicle terminal 7, such as an internal memory of the in-vehicle terminal 7. The memory 71 may also be an external storage device of the in-vehicle terminal 7 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the in-vehicle terminal 1. Further, the memory 71 may also include both an internal storage unit and an external storage device of the in-vehicle terminal 7. The memory 71 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer program. The memory 71 may also be used to temporarily store data that has been output or is to be output.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiment of the present application provides a computer program product, which, when running on a vehicle-mounted terminal, enables the vehicle-mounted terminal to implement the steps in the foregoing method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be implemented by instructing relevant hardware by a computer program, which can be stored in a computer readable storage medium, and when the computer program is executed by a processor, the steps of the embodiments of the methods described above can be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a vehicle terminal, recording medium, computer Memory, read-Only Memory (ROM), random-Access Memory (RAM), electrical carrier wave signals, telecommunications signals, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method of data transmission, comprising:
acquiring data to be transmitted and the usable cache capacity of a gateway controller used in the transmission process of the data to be transmitted;
according to the available buffer capacity, adjusting the window size of a data transmission window of the gateway controller;
and controlling the gateway controller to adopt the data transmission window with the adjusted window size to transmit the data to be transmitted.
2. The data transmission method of claim 1, wherein the data transmission window comprises a reception window and a transmission window; the window size comprises a first size of the receive window and a second size of the transmit window; the adjusting the window size of the data transmission window of the gateway controller according to the available buffer capacity includes:
acquiring a first cache capacity corresponding to the receiving window and a second cache capacity corresponding to the sending window;
calculating the sum of the first cache capacity and the second cache capacity to obtain a target cache capacity;
if the difference value between the available cache capacity and the target cache capacity is larger than a first threshold value, respectively adjusting the first size and the second size according to a first adjustment strategy;
if the difference value between the available cache capacity and the target cache capacity is smaller than a second threshold value, respectively adjusting the first size and the second size according to a second adjustment strategy; the first threshold is greater than the second threshold;
if the difference between the available cache capacity and the target cache capacity is between the first threshold and the second threshold, respectively adjusting the first size and the second size according to the first adjustment strategy, or respectively adjusting the first size and the second size according to the second adjustment strategy.
3. The data transmission method of claim 2, wherein the adjusting the first size and the second size according to a first adjustment policy, respectively, comprises:
determining a reference transmission quantity of the data to be transmitted in a data transmission service, wherein the reference transmission quantity is a single data transmission quantity corresponding to the data transmission service;
and adjusting the first size and the second size according to the reference transmission amount.
4. The data transmission method as claimed in claim 3, wherein the adjusting the first size and the second size according to the reference transmission amount comprises:
determining the size of a target window according to the reference transmission quantity;
adjusting both the first size and the second size to the target window size.
5. The data transmission method of claim 2, wherein the adjusting the first size and the second size according to a second adjustment policy, respectively, comprises:
when the receiving window is detected to be in a working state, increasing the first size based on the second cache capacity, and decreasing the second size based on the second cache capacity;
and when the sending window is detected to be in a working state, increasing the second size based on the first cache capacity, and decreasing the first size based on the first cache capacity.
6. The data transmission method according to any one of claims 1 to 5, wherein the data transmission window after the window size is adjusted includes an adjusted reception window and an adjusted transmission window; the controlling the gateway controller to transmit the data to be transmitted by adopting the data transmission window with the adjusted window size comprises the following steps:
if the data volume of the data to be transmitted is larger than a third threshold value, dividing the data to be transmitted into a plurality of data packets;
transmitting the plurality of data packets to the adjusted receiving window in sequence;
when detecting that the plurality of data packets have been successfully transmitted to the adjusted receiving window, transmitting the plurality of data packets to an electronic control unit of a vehicle through the adjusted sending window.
7. The data transmission method of claim 6, further comprising, after said transmitting said plurality of data packets to an electronic control unit of a vehicle through said adjusted send window:
and controlling the electronic control unit to carry out data flash on the data to be transmitted, which are obtained by restoring the plurality of data packets.
8. A data transmission apparatus, comprising:
the first acquisition unit is used for acquiring the data to be transmitted and the usable cache capacity of the gateway controller used by the data to be transmitted in the transmission process;
a first adjusting unit, configured to adjust a window size of a data transmission window of the gateway controller according to the available buffer capacity;
and the first control unit is used for controlling the gateway controller to adopt the data transmission window with the adjusted window size to transmit the data to be transmitted.
9. An in-vehicle terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the data transmission method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the data transmission method according to any one of claims 1 to 7.
CN202211374868.9A 2022-11-04 2022-11-04 Data transmission method and device, vehicle-mounted terminal and storage medium Pending CN115766606A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211374868.9A CN115766606A (en) 2022-11-04 2022-11-04 Data transmission method and device, vehicle-mounted terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211374868.9A CN115766606A (en) 2022-11-04 2022-11-04 Data transmission method and device, vehicle-mounted terminal and storage medium

Publications (1)

Publication Number Publication Date
CN115766606A true CN115766606A (en) 2023-03-07

Family

ID=85356334

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211374868.9A Pending CN115766606A (en) 2022-11-04 2022-11-04 Data transmission method and device, vehicle-mounted terminal and storage medium

Country Status (1)

Country Link
CN (1) CN115766606A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009224834A (en) * 2008-03-13 2009-10-01 Nec Commun Syst Ltd Communication apparatus, communication system, window size adjusting method and program
CN102201997A (en) * 2011-06-03 2011-09-28 华为技术有限公司 Data transmission control method and equipment
CN109862297A (en) * 2017-11-30 2019-06-07 浙江宇视科技有限公司 Window regulation method, device and readable storage medium storing program for executing
CN111314237A (en) * 2020-01-17 2020-06-19 深信服科技股份有限公司 Method, device and equipment for adjusting data packet transmission rate and readable storage medium
CN115119259A (en) * 2021-03-17 2022-09-27 华为技术有限公司 Congestion control method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009224834A (en) * 2008-03-13 2009-10-01 Nec Commun Syst Ltd Communication apparatus, communication system, window size adjusting method and program
CN102201997A (en) * 2011-06-03 2011-09-28 华为技术有限公司 Data transmission control method and equipment
CN109862297A (en) * 2017-11-30 2019-06-07 浙江宇视科技有限公司 Window regulation method, device and readable storage medium storing program for executing
CN111314237A (en) * 2020-01-17 2020-06-19 深信服科技股份有限公司 Method, device and equipment for adjusting data packet transmission rate and readable storage medium
CN115119259A (en) * 2021-03-17 2022-09-27 华为技术有限公司 Congestion control method and device

Similar Documents

Publication Publication Date Title
JP4896904B2 (en) Method, device and process for distributing tasks over time in mobile terminals
CN113852563B (en) Message data transmission method and device, terminal equipment and readable storage medium
WO2021168840A1 (en) Software version rollback method, apparatus and system
CN109640294B (en) Unmanned vehicle data transmission method, device, system and storage medium
CN111338662A (en) Firmware upgrading method and device for slave station and terminal
CN110086566B (en) Vehicle-mounted data transmission method and vehicle-mounted equipment
CN113688076B (en) EPA-based data communication method, computing device and medium
CN114189569B (en) Data transmission method, device and system
KR102303424B1 (en) Direct memory access control device for at least one processing unit having a random access memory
CN115766606A (en) Data transmission method and device, vehicle-mounted terminal and storage medium
CN117376339A (en) OTA-based vehicle ECU upgrading method, device, equipment and medium
CN115189977B (en) Broadcast transmission method, system and medium based on AXI protocol
CN113992707A (en) Data transmission method and device, vehicle-mounted Ethernet equipment and storage medium
CN112532664A (en) Data upgrading method and device
CN113110850B (en) Vehicle upgrading method, device, equipment, vehicle and storage medium
CN110677466A (en) Application program downloading method, device, gateway and storage medium
CN115277671A (en) OTA (over the air) upgrading method and device for vehicle, vehicle and storage medium
EP0887980A2 (en) Address setting method and communication system to which the address setting method is applied
CN110839294B (en) Method and device for transmitting data
US20240069888A1 (en) Vehicular software update system and method therefor
CN112566082B (en) Data transmission method, device, equipment and medium
CN111679909B (en) Data processing method and device and terminal equipment
CN111694581B (en) Software upgrading method of automobile noise reduction system and automobile noise reduction system
CN103514126A (en) Method, system and device for receiving data
CN114070792B (en) Vehicle-mounted Ethernet bandwidth allocation method and device, electronic equipment and storage medium

Legal Events

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