Data transmission method, device, vehicle-mounted terminal and storage medium
By dynamically adjusting the data transmission window size of the gateway controller, the problem of low data transmission efficiency in the software update of the automotive domain controller is solved, and the flexibility and practicality of data transmission is improved, and it is suitable for automotive intelligent systems.
Patent Information
- Application Number
- CN202211374868.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-04
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2042-11-04
AI Technical Summary
During the software update or upgrade of the automotive domain controller, due to the excessive data packet, the flexibility and practicality of data transmission are low due to the fixed data reception and transmission window size of the gateway controller, resulting in low transmission efficiency. .
By obtaining the usable cache capacity of the gateway controller used in the transmission process, the size of the data transmission window is dynamically adjusted, including the reception window and the transmission window, according to the difference between the usable cache capacity and the target cache capacity, Select the appropriate adjustment strategy to adjust the window size to improve the flexibility and practicality of data transmission.
Real-time adjustment of data transmission windows based on actual available cache capacity is realized, improving the efficiency and resource utilization of data transmission, and is suitable for software updates and upgrades of automotive domain controllers.
Smart Images

Figure CN115766606B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and in particular, relates to a data transmission method, device, vehicle-mounted terminal and computer-readable storage medium. Background Art
[0002] With the rapid development of automobile intelligence, the functions that automobiles can realize are becoming more and more numerous and complex. Therefore, the core of automobile intelligence, the Domain Control Unit (DCU), has its internal software getting bigger and bigger, from the initial 100M level to the current 1G level. Its internal software usually needs to be updated and upgraded to realize more functions.
[0003] At present, when updating or upgrading software, the automotive domain controller needs to flash the data packet of the software. Specifically, the data packet is first transmitted to the DoIP buffer area of the gateway controller. After the gateway controller receives the data packet, it transmits the data packet to the vehicle's electronic control unit (ECU) for data flashing. However, during the data transmission process, the data packet is too large, and the data receiving window and data sending window sizes of the gateway controller are usually fixed, resulting in low flexibility and practicality of data transmission. Summary of the invention
[0004] The embodiments of the present application provide a data transmission method, device, vehicle-mounted terminal and computer-readable storage medium, which improve the flexibility and practicality of data transmission.
[0005] In a first aspect, an embodiment of the present application provides a data transmission method, including:
[0006] Acquire the data to be transmitted and the available cache capacity of the gateway controller used in the transmission process of the data to be transmitted;
[0007] According to the available cache capacity, adjusting the window size of the data transmission window of the gateway controller;
[0008] The gateway controller is controlled to use the data transmission window with the adjusted window size to transmit the data to be transmitted.
[0009] Optionally, the data transmission window includes a receiving window and a sending window; the window size includes a first size of the receiving window and a second size of the sending window; and adjusting the window size of the data transmission window of the gateway controller according to the available cache capacity includes:
[0010] Acquire a first buffer capacity corresponding to the receiving window and a second buffer capacity corresponding to the sending window;
[0011] Calculating the sum of the first cache capacity and the second cache capacity to obtain a target cache capacity;
[0012] If the difference between the available cache capacity and the target cache capacity is greater than a first threshold, adjusting the first size and the second size respectively according to a first adjustment strategy;
[0013] If the difference between the available cache capacity and the target cache capacity is less than a second threshold, adjusting the first size and the second size respectively according to a second adjustment strategy; the first threshold is greater than the second threshold;
[0014] 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 adjusted according to the first adjustment strategy, or the first size and the second size are adjusted according to the second adjustment strategy.
[0015] Optionally, adjusting the first size and the second size respectively according to a first adjustment strategy includes:
[0016] Determine a benchmark transmission amount of the data to be transmitted in the data transmission service, where the benchmark transmission amount is a corresponding single data transmission amount in the data transmission service;
[0017] The first size and the second size are adjusted according to the reference transmission amount.
[0018] Optionally, adjusting the first size and the second size according to the reference transmission amount includes:
[0019] Determining a target window size according to the benchmark transmission amount;
[0020] The first size and the second size are both adjusted to the target window size.
[0021] Optionally, adjusting the first size and the second size respectively according to the second adjustment strategy includes:
[0022] When it is detected that the receiving window is in a working state, increasing the first size based on the second buffer capacity, and reducing the second size based on the second buffer capacity;
[0023] When it is detected that the sending window is in a working state, the second size is increased based on the first buffer capacity, and the first size is reduced based on the first buffer capacity.
[0024] Optionally, the data transmission window after the window size is adjusted includes an adjusted receiving window and an adjusted sending window; and controlling the gateway controller to use the data transmission window after the window size is adjusted to transmit the data to be transmitted includes:
[0025] If the amount of the data to be transmitted is greater than a third threshold, dividing the data to be transmitted into a plurality of data packets;
[0026] Transmitting the multiple data packets sequentially to the adjusted receiving window;
[0027] 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 an electronic control unit of the vehicle through the adjusted sending window.
[0028] Optionally, after transmitting the plurality of data packets to an electronic control unit of a vehicle through the adjusted sending window, the method further includes:
[0029] The electronic control unit is controlled to perform data flushing on the data to be transmitted obtained by restoring the multiple data packets.
[0030] In a second aspect, an embodiment of the present application provides a data transmission device, including:
[0031] The first acquisition unit is used to acquire the data to be transmitted and the available cache capacity of the gateway controller used in the transmission process of the data to be transmitted.
[0032] The first adjustment unit is configured to adjust the window size of the data transmission window of the gateway controller according to the available cache capacity.
[0033] The first control unit is used to control the gateway controller to use the data transmission window with the window size adjusted to transmit the data to be transmitted.
[0034] In a third aspect, an embodiment of the present application provides a vehicle-mounted terminal, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data transmission method as described in any one of the first aspects above is implemented.
[0035] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the data transmission method as described in any one of the above-mentioned first aspects is implemented.
[0036] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a vehicle-mounted terminal, the vehicle-mounted terminal can execute the data transmission method described in any one of the first aspects above.
[0037] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0038] The embodiment of the present application provides a data transmission method, which obtains data to be transmitted and the available cache capacity of the gateway controller used in the transmission process of the data to be transmitted; adjusts the window size of the data transmission window of the gateway controller according to the available cache capacity; and controls the gateway controller to use the data transmission window with the adjusted window size to transmit the data to be transmitted. Compared with the fixed window size of the data transmission window used for data transmission in the prior art, the present application 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, thereby improving the flexibility and practicality of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0040] Figure 1 is a flowchart of an implementation of a data transmission method provided in an embodiment of the present application;
[0041] Figure 2 is a flowchart of an implementation of a data transmission method provided by another embodiment of the present application;
[0042] Figure 3 is a flowchart of a data transmission method according to another embodiment of the present application;
[0043] Figure 4 is a flowchart of a data transmission method according to another embodiment of the present application;
[0044] Figure 5 is a flowchart of a data transmission method according to another embodiment of the present application;
[0045] Figure 6 is a structural diagram of a data transmission device provided by an embodiment of the present application;
[0046] Figure 7 It is a structural diagram of a vehicle-mounted terminal provided in one embodiment of the present application. DETAILED DESCRIPTION
[0047] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0048] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0049] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0050] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0051] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0052] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0053] In practical applications, with the rapid development of automobile intelligence, the functions that automobiles can realize are becoming more and more numerous and complex. Therefore, the core of automobile intelligence, the Domain Control Unit (DCU), has its internal software getting bigger and bigger, from the initial 100M level to the current 1G level. Its internal software usually needs to be updated and upgraded to realize more functions.
[0054] When the automotive domain controller updates or upgrades the software, it needs to flash the data packet of the software, that is, the data packet is first transmitted to the DoIP cache area of the gateway controller (CEM). After the gateway controller completes the reception, it transmits the data packet to the vehicle's Electronic Control Unit (ECU) for data flashing.
[0055] However, it takes a long time to transfer the data packets through CEM. Due to the limitation of CEM's receiving window, it needs to process the data it receives first when the receiving window is full before it can start receiving data again. Similarly, when CEM transmits data to the vehicle's ECU through the sending window, it is limited by CEM's sending window. After sending 4 TCP packets, the sending window needs to release the cache and wait for the TCP protocol stack of the task cycle to re-retrieve data before continuing to send data.
[0056] Based on this, the present application provides a data transmission method, which obtains the data to be transmitted and the available cache capacity of the gateway controller used by the data to be transmitted during the transmission process; adjusts the window size of the data transmission window of the gateway controller according to the available cache capacity; and controls the gateway controller to use the data transmission window with the adjusted window size to transmit the data to be transmitted. Since the data transmission method provided by the present application 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, the flexibility and practicality of data transmission are improved.
[0057] See also Figure 1 , Figure 1 This is a flow chart of a data transmission method provided in an embodiment of the present application. In the embodiment of the present application, the execution subject of the data transmission method is a vehicle-mounted terminal.
[0058] like Figure 1 As shown, the data transmission method provided in an embodiment of the present application may include S101 to S103, which are described in detail as follows:
[0059] In S101, data to be transmitted and available cache capacity of a gateway controller used in the transmission process of the data to be transmitted are obtained.
[0060] In an embodiment of the present application, when the vehicle's automotive domain controller needs to update or upgrade the software, it is usually necessary to send the software data packet to the vehicle's electronic control unit (ECU) for data flashing. Therefore, at this time, the on-board terminal can obtain the data to be transmitted, as well as the available cache capacity of the gateway controller used by the data to be transmitted during the transmission process.
[0061] In S102, the window size of the data transmission window of the gateway controller is adjusted according to the available cache capacity.
[0062] In practical applications, the window size of the data transmission window of the gateway controller is determined according to the buffer capacity allocated by the gateway controller to the data transmission window.
[0063] Based on this, in an embodiment of the present application, the vehicle terminal can adjust the cache capacity of the data transmission window of the gateway controller according to the available cache capacity of the gateway controller, that is, dynamically adjust the window size of the data transmission window.
[0064] It should be noted that the above data transmission window includes a receiving window and a sending window. 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. Based on this, in one embodiment of the present application, in order to improve the data transmission efficiency, the vehicle-mounted terminal can specifically Figure 2 S201 to S205 shown adjust the window size of the data transmission window of the gateway controller, as detailed below:
[0065] In S201, a first buffer capacity corresponding to the receiving window and a second buffer capacity corresponding to the sending window are obtained.
[0066] In S202, the sum of the first cache capacity and the second cache capacity is calculated to obtain a target cache capacity.
[0067] In this embodiment, after obtaining the target cache capacity, the vehicle terminal can calculate the 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 can be determined according to actual needs, and are not limited here, and the first threshold is greater than the second threshold.
[0068] In some possible embodiments, the first threshold and the second threshold may be determined according to a benchmark transmission volume in a data transmission service. Exemplarily, the first threshold may be a first preset multiple of the benchmark transmission volume, and the second threshold may be a second preset multiple of the benchmark transmission volume. The first preset multiple may be 2 times, the second preset multiple may be 0.5 times, and the first preset multiple is greater than the second preset multiple.
[0069] It should be noted that when the vehicle's automotive domain controller needs to update or upgrade the software, the software data packet is usually sent to the vehicle's electronic control unit (ECU) for data flashing. At this time, the vehicle terminal needs to use a data transmission service (i.e., 36 service) specifically used for data transmission to transmit data. Among them, the benchmark transmission volume refers to the amount of data transmitted each time by the 36 service during the ECU upgrade, that is, the single data transmission volume.
[0070] In this embodiment, the first threshold and the second threshold are determined according to the benchmark transmission volume in the data transmission service, so that the vehicle-mounted terminal can clearly understand the difference between the available cache capacity and the target cache capacity, and the relationship between the number of single data transmissions, thereby determining whether the available cache capacity can be used to adjust the first size of the receiving window and the second size of the sending window, so that the adjusted receiving window and sending window can complete the data transmission with a data volume of the benchmark transmission volume at one time, thereby improving the working efficiency of the vehicle-mounted terminal.
[0071] In one embodiment of the present application, 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 a first threshold, step S203 may be executed.
[0072] In another embodiment of the present application, when the vehicle-mounted terminal detects that the difference between the target cache capacity and the available cache capacity of the gateway controller is less than the second threshold, step S204 may be executed.
[0073] In yet another embodiment of the present application, when the vehicle-mounted terminal detects that the difference between the target cache capacity and the available cache capacity of the gateway controller is between the first threshold and the second threshold, step S205 may be executed.
[0074] 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 adjusted respectively according to a first adjustment strategy.
[0075] 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. Therefore, the vehicle-mounted terminal can 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 strategy.
[0076] The first adjustment strategy refers to allocating the available cache capacity of the gateway controller to the receiving window and sending window of the network controller, that is, adjusting the first size of the receiving window and the second size of the sending window according to the available cache capacity of the gateway controller.
[0077] Specifically, in one embodiment of the present application, the vehicle terminal can Figure 3 The steps S301 to S302 shown implement step S203, which is described in detail as follows:
[0078] 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 corresponding single data transmission amount in the data transmission service.
[0079] In S302, the first size and the second size are adjusted according to the reference transmission amount.
[0080] In this embodiment, the vehicle terminal can allocate the available cache capacity of the gateway controller to the receiving window and the sending window respectively based on the benchmark transmission volume of the data to be transmitted in the data transmission service, thereby completing the adjustment of the first size of the receiving window and the second size of the sending window.
[0081] Specifically, in one embodiment of the present application, the vehicle-mounted terminal can implement step S302 through the following steps, which are described in detail as follows:
[0082] Determining a target window size according to the benchmark transmission amount;
[0083] The first size and the second size are both adjusted to the target window size.
[0084] In this embodiment, after the receiving window of the gateway controller receives data equal to the window size of the receiving window (that is, after it is full), it needs to process the data received by the receiving window first, and can start receiving data again after processing. At the same time, after the sending window of the gateway controller sends every 4 frames of TCP messages, the sending window needs to release the cache and wait for the TCP protocol stack with a task cycle of 5ms to re-call data. Therefore, in order to avoid the receiving window needing to receive data multiple times to complete the reception of data each time data is transmitted to the receiving window of the gateway controller, and to avoid the situation where the sending window has to re-call data after sending 4 frames of TCP messages, thereby causing excessive transmission time, the on-board terminal can determine the target window size based on the benchmark transmission volume of the data to be transmitted in the data transmission service.
[0085] It is understandable that the minimum amount of data that the target window size can accommodate each time is the above-mentioned reference transmission amount. Exemplarily, assuming that the reference transmission amount is 20k, the target window size is the size that can accommodate at least 20k of data each time.
[0086] Based on this, the vehicle-mounted terminal can allocate the cache capacity corresponding to the benchmark data amount in the available cache capacity to the receiving window and the sending window respectively, that is, adjust the first size of the receiving window and the second size of the sending window to the target window size, so that the amount of data that can be received by the adjusted first size of the receiving window each time and the amount of data that can be accommodated by the adjusted second size of the sending window are both greater than or equal to the benchmark transmission amount, avoiding the need for the receiving window to receive the data of the benchmark transmission amount multiple times and the sending window to send it multiple times, thereby improving the transmission speed and further improving the data transmission efficiency.
[0087] In S204, if the difference between the available cache capacity and the target cache capacity is smaller than a second threshold, the first size and the second size are adjusted respectively according to a second adjustment strategy; the first threshold is larger than the second threshold.
[0088] 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 less than the second threshold, it indicates that the available cache capacity is insufficient and the available cache capacity 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 strategy. Therefore, the vehicle-mounted terminal can adjust the first size of the receiving window and the second size of the sending window respectively according to the second adjustment strategy.
[0089] The second adjustment strategy refers to adjusting the buffer capacity of the receiving window and the sending window according to whether the receiving window and the sending window are in working state, so as to adjust the first size of the receiving window and the second size of the sending window.
[0090] Specifically, in one embodiment of the present application, the vehicle terminal can Figure 4 S401-S402 shown implements step S204, which is described in detail as follows:
[0091] In S401, when it is detected that the receiving window is in a 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.
[0092] In S402, when it is detected that the sending window is in a working state, the second size is increased based on the first buffer capacity, and the first size is reduced based on the first buffer capacity.
[0093] In actual applications, the receiving window and sending window of the network controller cannot work at the same time, that is, when the receiving window is receiving data, the sending window cannot send data, and when the sending window is sending data, the receiving window cannot receive data. In other words, when the receiving window is receiving data, the second cache capacity of the sending window is idle, and when the sending window is sending data, the first cache capacity of the receiving window is idle. Therefore, in this embodiment, when the vehicle-mounted terminal detects that the receiving window is in a working state (that is, receiving data), it can increase the first size of the receiving window based on the second cache capacity of the sending window, and reduce the second size of the sending window based on the second cache capacity.
[0094] Specifically, the vehicle-mounted terminal can allocate the second cache 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 cache capacity. At the same time, since the second cache capacity of the sending window has been allocated to the receiving window, that is, the sending window has no cache capacity, the vehicle-mounted terminal needs to reduce the second size of the sending window according to the window size corresponding to the second cache capacity.
[0095] It can be understood that when the receiving window is in the working state, the vehicle terminal allocates the second buffer capacity of the sending window to the receiving window, that is, the vehicle terminal allocates all the buffer capacity of the sending window to the receiving window. In other words, the available buffer capacity can be fully allocated to the receiving window at this time, that is, when the receiving window is working, all the buffer space is allocated to the receiving window to improve the data transmission efficiency.
[0096] In this embodiment, when the vehicle terminal detects that the sending window is in working state (i.e., sending data), it can increase the second size of the sending window based on the first cache capacity of the receiving window, and reduce the first size of the receiving window based on the first cache capacity.
[0097] Specifically, the vehicle-mounted terminal can allocate the first cache capacity of the receiving window to the sending window, and increase the second size of the sending window according to the window size corresponding to the first cache capacity. At the same time, since the first cache capacity of the receiving window has been allocated to the sending window, that is, the receiving window has no cache capacity, the vehicle-mounted terminal needs to reduce the first size of the receiving window according to the window size corresponding to the first cache capacity.
[0098] It can be understood that when the sending window is in the working state, the vehicle terminal allocates the first buffer capacity of the receiving window to the sending window, that is, the vehicle terminal allocates all the buffer capacity of the receiving window to the sending window. In other words, the available buffer capacity can be fully allocated to the sending window at this time, that is, when the sending window is working, all the buffer space is allocated to the sending window to improve the data transmission efficiency.
[0099] It can be seen from the above 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 method, which not only improves the data transmission efficiency, but also improves the resource utilization of the cache capacity.
[0100] 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 adjusted respectively according to the first adjustment strategy, or the first size and the second size are adjusted respectively according to the second adjustment strategy.
[0101] 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 between the first threshold and the second threshold, it indicates that the available cache capacity of the network controller can be used, but the available amount is not large. Therefore, the vehicle-mounted terminal can randomly select any one of the first adjustment strategy and the second adjustment strategy to adjust the first size of the receiving window and the second size of the sending window. That is, the vehicle-mounted terminal can adjust the first size of the receiving window and the second size of the sending window according to the first adjustment strategy, or adjust the first size of the receiving window and the second size of the sending window according to the second adjustment strategy.
[0102] In S103, the gateway controller is controlled to transmit the data to be transmitted using the data transmission window after the window size is adjusted.
[0103] In the embodiment of the present application, after the vehicle terminal adjusts the window size of the data transmission window of the network controller, the vehicle terminal can control the gateway controller to use the data transmission window with the adjusted window size to transmit the data to be transmitted.
[0104] In one embodiment of the present application, the vehicle-mounted terminal can be specifically configured as follows: Figure 5 S501 to S503 shown transmit the data to be transmitted, as detailed below:
[0105] In S501, if the 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.
[0106] In this embodiment, since the data to be transmitted can only transmit data with a maximum data volume of the third threshold when transmitting data through the data transmission service (i.e., the 36 service), the vehicle-mounted terminal needs to compare the data volume of the data to be transmitted with the third threshold when transmitting the data to be transmitted. The third threshold can be determined according to actual needs and is not limited here. For example, the third threshold can be 1500 bytes.
[0107] When the vehicle-mounted terminal detects that the amount of the data to be transmitted is greater than the third threshold, it indicates that the data to be transmitted needs to be unpacked. Therefore, the vehicle-mounted terminal may divide the data to be transmitted into multiple data packets.
[0108] In S502, the multiple data packets are transmitted to the adjusted receiving window in sequence.
[0109] 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 sending window.
[0110] In this embodiment, after obtaining multiple data packets of data to be transmitted, the vehicle-mounted terminal may transmit the multiple data packets to the adjusted receiving window in sequence.
[0111] When the vehicle-mounted terminal detects that multiple data packets have been successfully transmitted to the adjusted receiving window, that is, the adjusted receiving window has successfully received the above-mentioned multiple data packets, it means that the receiving window has completed receiving the data to be transmitted. Therefore, at this time, the vehicle-mounted terminal can control the adjusted sending window to send the above-mentioned multiple data packets to the vehicle's electronic control unit in sequence, thereby completing the transmission of the data to be transmitted.
[0112] In one embodiment of the present application, after sending the above-mentioned multiple data packets to the electronic control unit of the vehicle, the vehicle-mounted terminal can control the electronic control unit to flash the data to be transmitted obtained by restoring the above-mentioned multiple data packets.
[0113] From the above, it can be seen that the data transmission method provided by the embodiment of the present application obtains the data to be transmitted and the available cache capacity of the gateway controller used in the transmission process of the data to be transmitted; according to the available cache capacity, the window size of the data transmission window of the gateway controller is adjusted; and the gateway controller is controlled to use the data transmission window with the adjusted window size to transmit the data to be transmitted. Compared with the fixed window size of the data transmission window used for data transmission in the prior art, the present application 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, thereby improving the flexibility and practicality of data transmission.
[0114] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0115] Corresponding to a data transmission method described in the above embodiment, Figure 6The structure block diagram of a data transmission device provided by an embodiment of the present application is shown. For the convenience of description, only the part related to the embodiment of the present application is shown. Figure 6 The data transmission device 600 includes: a first acquisition unit 61, a first adjustment unit 62 and a first control unit 63. Among them:
[0116] The first acquisition unit 61 is used to acquire the data to be transmitted and the available cache capacity of the gateway controller used in the transmission process of the data to be transmitted.
[0117] The first adjusting unit 62 is used for adjusting the window size of the data transmission window of the gateway controller according to the available cache capacity.
[0118] The first control unit 63 is used to control the gateway controller to use the data transmission window with the adjusted window size to transmit the data to be transmitted.
[0119] In one embodiment of the present application, the data transmission window includes a receiving window and a sending window; the window size includes a first size of the receiving window and a second size of the sending window; the first acquisition unit 61 specifically includes: a second acquisition unit, a calculation unit, a second adjustment unit, a third adjustment unit and a fourth adjustment unit. Among them:
[0120] The second acquisition unit is used to acquire a first buffer capacity corresponding to the receiving window and a second buffer capacity corresponding to the sending window.
[0121] The calculation unit is used to calculate the sum of the first cache capacity and the second cache capacity to obtain a target cache capacity.
[0122] The second adjustment unit is configured to adjust the first size and the second size respectively according to a first adjustment strategy if the difference between the available cache capacity and the target cache capacity is greater than a first threshold.
[0123] The third adjustment unit is used to adjust the first size and the second size respectively according to a second adjustment strategy if the difference between the available cache capacity and the target cache capacity is less than a second threshold; the first threshold is greater than the second threshold.
[0124] The fourth adjustment unit is used to adjust the first size and the second size respectively according to the first adjustment strategy if the difference between the available cache capacity and the target cache capacity is between the first threshold and the second threshold, or to adjust the first size and the second size respectively according to the second adjustment strategy.
[0125] In one embodiment of the present application, the first adjustment unit specifically includes: a first determination unit and a fifth adjustment unit.
[0126] The first determining unit is configured to determine a reference transmission amount of the data to be transmitted in a data transmission service, wherein the reference transmission amount is a corresponding single data transmission amount in the data transmission service.
[0127] The fifth adjustment unit is used to adjust the first size and the second size according to the reference transmission amount.
[0128] In one embodiment of the present application, the fifth adjustment unit specifically includes: a second determination unit and a sixth adjustment unit.
[0129] The second determining unit is used to determine the target window size according to the reference transmission amount.
[0130] The sixth adjusting unit is used to adjust both the first size and the second size to the target window size.
[0131] In one embodiment of the present application, the third adjustment determination unit specifically includes: a first increasing unit and a second increasing unit.
[0132] The first increasing unit is configured to increase the first size based on the second buffer capacity and reduce the second size based on the second buffer capacity when it is detected that the receiving window is in a working state.
[0133] The second increasing unit is configured to increase the second size based on the first buffer capacity and reduce the first size based on the first buffer capacity when it is detected that the sending window is in a working state.
[0134] In one embodiment of the present application, the data transmission window after adjusting the window size includes an adjusted receiving window and an adjusted sending window; the first control unit 63 specifically includes: a division unit, a first transmission unit and a second transmission unit. Among them:
[0135] The dividing unit is used for dividing the data to be transmitted into a plurality of data packets if the amount of the data to be transmitted is greater than a third threshold.
[0136] The first transmission unit is used to transmit the multiple data packets to the adjusted receiving window in sequence.
[0137] The second transmission unit is used to transmit the multiple data packets to the electronic control unit of the vehicle through the adjusted sending window when it is detected that the multiple data packets have been successfully transmitted to the adjusted receiving window.
[0138] In one embodiment of the present application, the data transmission device 600 further includes: a second control unit.
[0139] The second control unit is used to control the electronic control unit to flash the data to be transmitted obtained by restoring the multiple data packets.
[0140] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0141] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0142] Figure 7 This is a schematic diagram of the structure of a vehicle-mounted terminal provided in one embodiment of the present application. Figure 7 As shown, the vehicle terminal 7 of this embodiment includes: at least one processor 70 ( Figure 7 Only one is shown in the figure) a processor, a memory 71, and a computer program 72 stored in the memory 71 and executable on the at least one processor 70, wherein the processor 70 implements the steps in any of the above-mentioned data transmission method embodiments when executing the computer program 72.
[0143] 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 Figure 7 It is only an example of the vehicle-mounted terminal 7 and does not constitute a limitation on the vehicle-mounted terminal 7. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
[0144] The processor 70 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0145] In some embodiments, the memory 71 may be an internal storage unit of the vehicle terminal 7, such as the memory of the vehicle terminal 7. In other embodiments, the memory 71 may also be an external storage device of the vehicle terminal 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the vehicle terminal 1. Further, the memory 71 may also include both the internal storage unit of the vehicle terminal 7 and an external storage device. The memory 71 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 71 may also be used to temporarily store data that has been output or is to be output.
[0146] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0147] An embodiment of the present application provides a computer program product. When the computer program product runs on a vehicle-mounted terminal, the vehicle-mounted terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0148] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the vehicle-mounted terminal, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0149] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0150] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A data transmission method, characterized in that: include: Acquire the data to be transmitted and the available cache capacity of the gateway controller used in the transmission process of the data to be transmitted; According to the available cache capacity, adjusting the window size of the data transmission window of the gateway controller; Controlling the gateway controller to transmit the data to be transmitted using the data transmission window after adjusting the window size; The data transmission window includes a receiving window and a sending window; the window size includes a first size of the receiving window and a second size of the sending window; The adjusting the window size of the data transmission window of the gateway controller according to the available cache capacity includes: Acquire a first buffer capacity corresponding to the receiving window and a second buffer 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 between the available cache capacity and the target cache capacity is greater than a first threshold, adjusting the first size and the second size respectively according to a first adjustment strategy; If the difference between the available cache capacity and the target cache capacity is less than a second threshold, adjusting the first size and the second size respectively 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, the first size and the second size are adjusted according to the first adjustment strategy, or the first size and the second size are adjusted according to the second adjustment strategy.
2. The data transmission method according to claim 1, characterized in that: The adjusting the first size and the second size respectively according to the first adjustment strategy includes: Determine a benchmark transmission amount of the data to be transmitted in the data transmission service, where the benchmark transmission amount is a corresponding single data transmission amount in the data transmission service; The first size and the second size are adjusted according to the reference transmission amount.
3. The data transmission method according to claim 2, characterized in that: The adjusting the first size and the second size according to the reference transmission amount includes: Determining a target window size according to the benchmark transmission amount; The first size and the second size are both adjusted to the target window size.
4. The data transmission method according to claim 1, characterized in that: The adjusting the first size and the second size respectively according to the second adjustment strategy includes: When it is detected that the receiving window is in a working state, increasing the first size based on the second buffer capacity, and reducing the second size based on the second buffer capacity; When it is detected that the sending window is in a working state, the second size is increased based on the first buffer capacity, and the first size is reduced based on the first buffer capacity.
5. The data transmission method according to any one of claims 1 to 4, characterized in that: The data transmission window after adjusting the window size includes an adjusted receiving window and an adjusted sending window; and controlling the gateway controller to use the data transmission window after adjusting the window size to transmit the data to be transmitted includes: If the amount of the data to be transmitted is greater than a third threshold, dividing the data to be transmitted into a plurality of data packets; Transmitting the multiple data packets sequentially to the adjusted receiving window; 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 an electronic control unit of the vehicle through the adjusted sending window.
6. The data transmission method according to claim 5, characterized in that: After transmitting the plurality of data packets to the electronic control unit of the vehicle through the adjusted sending window, the method further includes: The electronic control unit is controlled to perform data flushing on the data to be transmitted obtained by restoring the multiple data packets.
7. A data transmission device, characterized in that: include: A first acquisition unit, used to acquire data to be transmitted and an available cache capacity of a gateway controller used in a transmission process of the data to be transmitted; A first adjustment unit, configured to adjust a window size of a data transmission window of the gateway controller according to the available cache capacity; A first control unit, configured to control the gateway controller to transmit the data to be transmitted using the data transmission window after the window size is adjusted; The data transmission window includes a receiving window and a sending window; the window size includes a first size of the receiving window and a second size of the sending window; The first adjustment unit specifically includes: A second acquisition unit, used to acquire a first buffer capacity corresponding to the receiving window and a second buffer capacity corresponding to the sending window; a calculation unit, configured to calculate the sum of the first cache capacity and the second cache capacity to obtain a target cache capacity; a second adjustment unit, configured to adjust the first size and the second size respectively according to a first adjustment strategy if the difference between the available cache capacity and the target cache capacity is greater than a first threshold; a third adjustment unit, configured to adjust the first size and the second size respectively according to a second adjustment strategy if the difference between the available cache capacity and the target cache capacity is less than a second threshold; and the first threshold is greater than the second threshold; and a fourth adjustment unit, configured to adjust the first size and the second size respectively according to the first adjustment strategy if the difference between the available cache capacity and the target cache capacity is between the first threshold and the second threshold, or to adjust the first size and the second size respectively according to the second adjustment strategy.
8. A vehicle-mounted terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the data transmission method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data transmission method according to any one of claims 1 to 6 is implemented.
