Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, 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.
Fig. 1 is a flow chart of a vehicle software upgrading method based on multi-channel data transmission according to an embodiment of the present application. The vehicle software upgrade method based on multi-channel data transmission of fig. 1 may be performed by an upgrade master provided on an automobile. Alternatively, the vehicle software upgrade method based on multi-channel data transmission of fig. 1 may also be performed by a computer or a server, or software on a computer or a server. Taking an upgrade master controller as an execution subject as an example, the vehicle software upgrade method based on multi-channel data transmission comprises the following steps:
s101, configuring a transmission strategy for a data packet in response to an OTA upgrading request, wherein the transmission strategy comprises transmission channels corresponding to all data fragments of the data packet;
S102, if the abnormal probability of the target transmission channel is larger than a first preset threshold, configuring a corresponding standby channel for the target transmission channel, wherein the abnormal probability of the standby channel is smaller than that of the target transmission channel, and the target transmission channel is at least one of the transmission channels corresponding to the data fragments;
S103, when each transmission channel is used for transmitting the corresponding data fragment, if the target transmission channel is detected to be abnormal, the corresponding standby channel is used for transmitting the data fragment corresponding to the target transmission channel.
The method comprises the steps that an upgrade main control machine and a plurality of ports are arranged on a virtual machine of an automobile, the upgrade main control machine sends data to a controller on the automobile through the ports, an OTA upgrade request is a request for upgrading software of the controller on the automobile, after the upgrade main control machine receives the OTA upgrade request, a transmission strategy between the OTA upgrade main control machine and the controller is configured, the controller comprises a whole automobile controller, a gearbox controller, an engine controller, a motor controller, an air conditioner controller, a battery management system controller and the like, a data packet comprises data packets of all the controllers, the abnormal probability of a transmission channel and a standby channel can be determined through a channel transmission estimation model, and in order to improve the probability of successful data transmission, the corresponding standby channel is configured for a target transmission channel with the abnormal probability larger than a first preset threshold value, and when the target transmission channel is abnormal, the corresponding standby channel is utilized to transmit data fragments corresponding to the target transmission channel.
According to the technical scheme provided by the embodiment of the application, a transmission strategy is configured for a data packet in response to an OTA upgrading request, wherein the transmission strategy comprises transmission channels corresponding to all data fragments of the data packet, a corresponding standby channel is configured for the target transmission channel if the abnormal probability of the target transmission channel is larger than a first preset threshold, wherein the abnormal probability of the standby channel is smaller than that of the target transmission channel, the target transmission channel is at least one of the transmission channels corresponding to all the data fragments, and when all the transmission channels are used for transmitting the corresponding data fragments, if the abnormal occurrence of the target transmission channel is detected, the corresponding standby channel is used for transmitting the data fragments corresponding to the target transmission channel. Because the embodiment of the application adopts a plurality of transmission channels to transmit data in the vehicle software upgrading process, and utilizes the standby channel to transmit the data of the transmission channel with the abnormality when the transmission channel is abnormal, the problems of low vehicle software upgrading efficiency and low success rate in the prior art can be solved by adopting the technical means, and the vehicle software upgrading efficiency and success rate are further improved.
Further, if the abnormal probability of the target transmission channel is greater than the first preset threshold, configuring corresponding standby channels for the target transmission channel, wherein the more the number of the target transmission channels is, the more the number of the corresponding standby channels are configured for each target transmission channel.
The number of target transmission channels is proportional to the number of its corresponding backup channels.
Fig. 2 is a flow chart of another vehicle software upgrading method based on multi-channel data transmission according to an embodiment of the present application, which is executed by an upgrade master controller, as shown in fig. 2, and includes:
the following loop is performed:
S201, a transmission strategy is configured for the data packet in response to an OTA upgrade request;
S202, judging whether the number of target transmission channels with the abnormal probability larger than a first preset threshold is larger than a second preset threshold;
S203, if not, configuring a corresponding standby channel for the target transmission channel;
S204, if the number is larger than the number, jumping to S201;
s205, when each transmission channel is used for transmitting the corresponding data fragment, if the target transmission channel is detected to be abnormal, the corresponding standby channel is used for transmitting the data fragment corresponding to the target transmission channel, and the transmission of the whole data packet is ended and then the data packet is exited.
When the number of the target transmission channels is greater than a second preset threshold, the method jumps to S201, namely reconfigures the transmission strategy to screen out new transmission channels to replace the original transmission channels, and comprises the steps of determining the data quantity of the data packet and the residual bandwidth of each screened out new transmission channel, reconfirm the size of the fragments according to the data quantity and the residual bandwidth of each screened out new transmission channel, reconfigures the fragments of the data packet according to the reconfirm size of the fragments, and reconfigures the data fragments for each screened out new transmission channel.
Fig. 3 is a flowchart of a method for configuring a transmission policy according to an embodiment of the present application, which is executed by an upgrade master, as shown in fig. 3, and includes:
s301, polling whether link channels between a plurality of ports and a target address of a controller are reachable, and determining each reachable link channel as a transmission channel;
S302, determining the data quantity of a data packet and the residual bandwidth of each transmission channel, and determining the size of a fragment according to the data quantity and the residual bandwidth of each transmission channel;
S303, performing slicing processing on the data packet according to the slicing size to obtain a plurality of data slices and slicing serial numbers of each data slice;
S304, distributing a plurality of data fragments for each transmission channel according to the residual bandwidth of the transmission channel.
The method comprises the steps of polling a reachable link channel, namely a transmission channel capable of transmitting information between an upgrade master controller and a controller, judging whether the link channel is reachable or not, checking whether the link channel is in LINKUP states or not in a PING mode, if yes, reaching the link channel, arranging an upgrade master controller, a controller and an upgrade slave controller at the controller side on an automobile, wherein the upgrade slave controller is used for assisting the upgrade master controller to execute a relevant step of upgrading vehicle software at the controller side, the upgrade slave controller can be regarded as an actual execution main body at the controller side, the upgrade master controller executes the relevant step of upgrading vehicle software at the controller side by controlling the upgrade slave controller, the residual bandwidth of the transmission channel refers to a value subtracted from the total bandwidth of the transmission channel, the size of a data slice is equal to that of the data slice, and naturally, data slices with the sub-packet sizes smaller than the size of the slices are possible to exist in a plurality of data slices obtained by the slice processing (the sub-packet sizes of the data slices obtained by the sub-slice processing are often the sub-slice sizes), and each slice carries own serial numbers of the data slices.
The size of the fragments should be smaller than the minimum value in the residual bandwidths of the plurality of transmission channels, and in the case that the condition is satisfied, the number of fragments of the data obtained by performing the fragmentation processing on the data packets with the size of the data amount according to the size of the fragments cannot be larger than the preset number of the fragments. For example, the data volume of the data packet is large and is 10G, three transmission channels are provided, the residual bandwidths of the three transmission channels are respectively 200M, 300M and 1000M, the size of the fragments is determined to be 10M according to the data volume and the residual bandwidth of each transmission channel (the data volume is 10G, the size of the fragments is 10M or more, if the data volume is small, for example, hundreds of M, the size of the fragments can be 1M or less, the number of the fragments of the data is controlled within a reasonable range anyway), and the fragments are carried out according to the capacity of 10M, and 10G/10 m=1000 fragments. The ratio of the residual bandwidths of the three transmission channels is 2:3:10, so that the data fragments can be allocated to the three transmission channels according to the ratio of 2:3:10.
Further, after the transmission of the whole data packet is finished, the upgrading slave controller is utilized to assemble a plurality of data fragments according to the fragment serial numbers of each data fragment at the controller side, the data packet is obtained, and the controller is upgraded by utilizing the data packet.
In an alternative embodiment, the controller side assembles the plurality of data fragments according to the fragment sequence number of each data fragment by using the upgrade slave, and the method comprises the steps of receiving a retransmission instruction sent by the upgrade slave when the upgrade slave detects the fragment sequence number of the missing data fragment, so as to retransmit the missing data fragment according to the retransmission instruction, wherein the retransmission instruction carries the fragment sequence number of the missing data fragment.
When the upgrading slave controller detects the missing data fragments, the upgrading slave controller can send retransmission instructions to the upgrading master controller, and the upgrading master controller retransmits the missing data fragments according to the retransmission instructions. The retransmission may be performed by selecting the original transmission channel or by replacing the transmission channel in which no abnormality has occurred. The occurrence of an abnormality in the transmission channel means transmission errors, including missing data slices.
In an alternative embodiment, before the controller is upgraded by using the data packet, the method further comprises the steps of carrying out file integrity check on the assembled data packet by using the upgrading slave, controlling the upgrading slave to upgrade the controller by using the data packet when the assembled data packet passes the file integrity check, and controlling the upgrading slave to determine that the controller fails to upgrade this time when the assembled data packet does not pass the file integrity check.
And judging whether the data volume of the data packet obtained by assembly is equal to the data volume of the data packet of the upgrade master controller side, if so, passing the file integrity check, and if not, not passing the file integrity check. In general, the data volume of the data packet obtained by assembly is not larger than the data volume of the data packet of the upgrade master controller side, and if the data volume is larger than the data volume, the data packet received by the controller side is mixed with other files. This situation requires retransmission.
In an alternative embodiment, when the controller side assembles the plurality of data fragments according to the fragment sequence number of each data fragment by using the upgrade slave controller, whether the data fragment belongs to the data packet is judged according to the fragment sequence number of each data fragment, and if not, the data fragment is deleted.
Further, before the corresponding data fragments are transmitted by the transmission channels, the method further comprises the steps of determining the total bandwidth and the residual bandwidth of each alternative channel in each transmission channel and each alternative channel set, inputting the fragments and the total bandwidth and the residual bandwidth of each transmission channel into a channel transmission estimation model, outputting the abnormal probability of each transmission channel, and inputting the fragments and the total bandwidth and the residual bandwidth of each alternative channel into the channel transmission estimation model, and outputting the abnormal probability of each alternative channel.
In an alternative embodiment, a positive sample set and a negative sample set are constructed according to histories of transmission information of a plurality of transmission channels, wherein the positive sample set comprises a plurality of groups of samples in a normal transmission process, the negative sample set comprises a plurality of groups of samples in an abnormal transmission process, each group of samples comprises a slice size, total bandwidth and residual bandwidth of the transmission channels, iterative training is carried out on a channel transmission estimation model by using the positive sample set and the negative sample set, and model parameters of the channel transmission estimation model are optimized to obtain a trained channel transmission estimation model.
A set of samples including the fragment size of a transmission and the total bandwidth and the remaining bandwidth of a transmission channel in the transmission, the labels of the set of samples being normal or abnormal for the transmission. The labels of the positive sample set are normal, and the labels of the negative sample set are abnormal. The method for training the channel transmission estimation model is a method for training the existing model, and will not be described in detail.
Abnormal transmission means that an abnormality occurs, and normal transmission means that no abnormality occurs.
When each transmission channel is used for transmitting the corresponding data fragments, if the target transmission channel is detected to be abnormal, the corresponding standby channel is used for transmitting the data fragments corresponding to the target transmission channel, wherein the method comprises the steps of screening the corresponding number of standby channels from the plurality of standby channels according to the number of the transmission channels detected to be abnormal, and transmitting the plurality of data fragments distributed to the transmission channels transmitted abnormally to the target address by using the screened standby channels.
For example, 4 transmission channels with an exception are selected from a plurality of alternative channels, the 4 selected alternative channels are used for sending a plurality of data fragments allocated to the 4 transmission channels with the exception to a target address, that is, one transmission channel with the exception corresponding to one transmission channel with the exception, or the 4 transmission channels with the exception are selected, 2 alternative channels are selected from the plurality of alternative channels, and the 2 selected alternative channels are used for sending a plurality of data fragments allocated to the 4 transmission channels with the exception to the target address, that is, one transmission channel with the exception corresponding to two transmission channels with the exception.
Fig. 4 is a flow chart of another vehicle software upgrade method based on multi-channel data transmission according to an embodiment of the present application, which is executed by an upgrade master controller, as shown in fig. 4, and includes:
in the embodiment of the application, four ports P1, P2, P3 and P4 are arranged on a virtual machine of an automobile, four gateways VGW1, VGW2, VGW3 and VGW4 are arranged on the automobile, and a controller is recorded as an ECU.
S401, determining four link channels to the ECU P1->VGW1->ECU,P3->VGW2->VGW1->ECU,P2->VGW4->VGW1->ECU,P4->VGW3->VGW2->VGW1->ECU;
S402, determining that four link channels are reachable in a polling mode, wherein the four link channels are used as four transmission channels;
S403, determining that the data amount of the data packet is 2Mbytes (2×1024×1024=2097252 Bytes), determining that the slice size is 1434Bytes, and the slice number is 2097152/1434= 1462.4, and taking 1463;
s404, performing slicing processing on the data packet according to the slicing size to obtain a plurality of data slices and slicing serial numbers of each data slice, and distributing the plurality of data slices for each transmission channel;
S405, transmitting the multiple data fragments allocated to each transmission channel to a target address by using each transmission channel;
S406, carrying out homologous verification on the data fragments in the target address by using the upgrading slave controller at the controller side, carrying out file integrity verification and detecting whether each channel is normally transmitted in real time, and if an abnormal transmission channel exists, selecting a corresponding alternative channel to retransmit the fragment data of the transmission channel with the abnormality;
S407, assembling the plurality of data fragments according to the fragment sequence number of each data fragment after homologous verification, file integrity verification and normal transmission detection to obtain the data packet.
The homologous verification is to verify whether the data fragments in the target address all belong to the data packet.
For example, if a transmission channel fails and the missing segment sequence number is 100, the data packet cannot be assembled normally, the upgrade slave controller detects the missing segment sequence number and feeds the missing segment sequence number 100 back to the upgrade master controller for retransmission, and the upgrade master controller retransmits the missing data segment.
For example, when the upgrade master detects that VBOX (P2) - > VGW4- > VGW1- > ECU fails, the upgrade master does not send the data fragments from the transmission channel any more, and may send the data fragments through other transmission channels and alternative channels.
The method for transmitting the data packets by the plurality of transmission channels in a fragmented manner greatly improves the data transmission efficiency, also ensures that data transmission can be performed by other transmission channels and alternative channels due to faults of certain channels, ensures that the data packets are successfully transmitted, greatly improves the success rate of transmitting the data packets, and also ensures that the bus load is overweight due to data retransmission.
Any combination of the above optional solutions may be adopted to form an optional embodiment of the present application, which is not described herein.
The following are examples of the apparatus of the present application that may be used to perform the method embodiments of the present application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the method of the present application.
Fig. 5 is a schematic diagram of a vehicle software upgrading device based on multi-channel data transmission according to an embodiment of the present application. As shown in fig. 5, the vehicle software upgrade apparatus based on multi-channel data transmission includes:
A first configuration module 501 configured to configure a transmission policy for a data packet in response to an OTA upgrade request, where the transmission policy includes transmission channels corresponding to respective data slices of the data packet;
The second configuration module 502 is configured to configure a corresponding standby channel for the target transmission channel if the abnormal probability of the target transmission channel is greater than the first preset threshold, where the abnormal probability of the standby channel is smaller than the target transmission channel, and the target transmission channel is at least one of the transmission channels corresponding to each data slice;
the detection module 503 is configured to, when each transmission channel is used to transmit a corresponding data fragment, if an abnormality occurs in the target transmission channel, transmit the corresponding data fragment of the target transmission channel by using a corresponding backup channel.
According to the technical scheme provided by the embodiment of the application, a transmission strategy is configured for a data packet in response to an OTA upgrading request, wherein the transmission strategy comprises transmission channels corresponding to all data fragments of the data packet, a corresponding standby channel is configured for the target transmission channel if the abnormal probability of the target transmission channel is larger than a first preset threshold, wherein the abnormal probability of the standby channel is smaller than that of the target transmission channel, the target transmission channel is at least one of the transmission channels corresponding to all the data fragments, and when all the transmission channels are used for transmitting the corresponding data fragments, if the abnormal occurrence of the target transmission channel is detected, the corresponding standby channel is used for transmitting the data fragments corresponding to the target transmission channel. Because the embodiment of the application adopts a plurality of transmission channels to transmit data in the vehicle software upgrading process, and utilizes the standby channel to transmit the data of the transmission channel with the abnormality when the transmission channel is abnormal, the problems of low vehicle software upgrading efficiency and low success rate in the prior art can be solved by adopting the technical means, and the vehicle software upgrading efficiency and success rate are further improved.
The more the number of the target transmission channels, the more the number of the corresponding standby channels is configured for each target transmission channel.
Optionally, the first configuration module 501 is further configured to perform a loop, in response to an OTA upgrade request, to configure a transmission policy for a data packet, determine whether the number of target transmission channels with an anomaly probability greater than a first preset threshold is greater than a second preset threshold, if not, configure a corresponding backup channel for the target transmission channel, if so, skip to a step of configuring a transmission policy for a data packet in response to the OTA upgrade request, when each transmission channel is used to transmit its corresponding data fragment, if it is detected that the target transmission channel is abnormal, transmit the data fragment corresponding to the target transmission channel by using the corresponding backup channel, and exit after the transmission of the entire data packet is ended.
Optionally, the first configuration module 501 is further configured to poll whether link channels between the plurality of ports and the target address of the controller are reachable, determine each reachable link channel as a transmission channel, determine a data amount of the data packet and a remaining bandwidth of each transmission channel, determine a slice size according to the data amount and the remaining bandwidth of each transmission channel, perform slice processing on the data packet according to the slice size to obtain a plurality of data slices and a slice sequence number of each data slice, and allocate a plurality of data slices for each transmission channel according to the remaining bandwidth of the transmission channel.
Optionally, the detecting module 503 is further configured to, after finishing the transmission of the entire data packet, assemble, at the controller side, the plurality of data slices according to the slice serial number of each data slice by using the upgrade slave controller, to obtain the data packet, and upgrade the controller by using the data packet.
Optionally, the detecting module 503 is further configured to receive a retransmission instruction sent by the upgrade slave when the upgrade slave detects the fragment sequence number of the missing data fragment, so as to retransmit the missing data fragment according to the retransmission instruction, where the retransmission instruction carries the fragment sequence number of the missing data fragment.
Optionally, the detecting module 503 is further configured to perform file integrity check on the assembled data packet by using the upgrade slave, control the upgrade slave to upgrade the controller by using the data packet when the assembled data packet passes the file integrity check, and control the upgrade slave to determine that the upgrade of the controller fails when the assembled data packet does not pass the file integrity check.
Optionally, the detecting module 503 is further configured to, when the controller side assembles the plurality of data slices according to the slice serial number of each data slice by using the upgrade slave controller, determine whether the data slice belongs to the data packet according to the slice serial number of each data slice, and if not, delete the data slice.
Optionally, the second configuration module 502 is further configured to determine a total bandwidth and a residual bandwidth of each of the transmission channels and each of the alternative channels in the set of alternative channels, input the tile size and the total bandwidth and the residual bandwidth of each of the transmission channels into the channel transmission estimation model, output the anomaly probability of each of the transmission channels, input the tile size and the total bandwidth and the residual bandwidth of each of the alternative channels into the channel transmission estimation model, and output the anomaly probability of each of the alternative channels.
Optionally, the second configuration module 502 is further configured to construct a positive sample set and a negative sample set according to the histories of the transmission information of the plurality of transmission channels, where the positive sample set includes multiple groups of samples in the normal transmission process, the negative sample set includes multiple groups of samples in the abnormal transmission process, and each group of samples includes a slice size and a total bandwidth and a residual bandwidth of the transmission channel.
Optionally, the detecting module 503 is further configured to screen a corresponding number of alternative channels from the plurality of alternative channels according to the number of the transmission channels detected to be abnormal, and send the plurality of data fragments allocated to the transmission channels transmitted abnormally to the target address by using the screened alternative channels.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present application.
Fig. 6 is a schematic diagram of an automobile 6 provided by an embodiment of the present disclosure. As shown in fig. 6, the car 6 of this embodiment includes an upgrade master 601, a memory 602, and a computer program 603 stored in the memory 602 and executable on the upgrade master 601. The upgrade master 601 performs the steps of the various method embodiments described above when executing the computer program 603. Or the upgrade master 601, when executing the computer program 603, performs the functions of the modules/units in the device embodiments described above.
The automobiles 6 include conventional automobiles and new energy automobiles. The car 6 may include, but is not limited to, an upgrade master 601 and a memory 602. It will be appreciated by those skilled in the art that fig. 6 is merely an example of the automobile 6 and is not limiting of the automobile 6 and may include more or fewer components than shown, or different components.
The memory 602 may be an internal storage unit of the car 6, for example, a hard disk or a memory of the car 6. The memory 602 may also be an external storage device of the automobile 6, such as a plug-in hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like, which are provided on the automobile 6. The memory 602 may also include both internal storage units and external storage devices of the car 6. The memory 602 is used to store computer programs and other programs and data needed for the automobile.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and the computer program may implement the steps of the method embodiments described above when executed by the upgrade master. The computer program may comprise computer program code, which may be in source code form, object code form, executable file or in some intermediate form, etc. The computer readable medium can include any entity or device capable of carrying computer program code, recording medium, USB flash disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), electrical carrier signals, telecommunications signals, and software distribution media, among others. It should be noted that the content of the computer readable medium can be appropriately increased or decreased according to the requirements of the jurisdiction's jurisdiction and the patent practice, for example, in some jurisdictions, the computer readable medium does not include electrical carrier signals and telecommunication signals according to the jurisdiction and the patent practice.
The foregoing embodiments are merely for illustrating the technical solution of the present application, but not for limiting the same, and although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that the technical solution described in the foregoing embodiments may be modified or substituted for some of the technical features thereof, and that these modifications or substitutions should not depart from the spirit and scope of the technical solution of the embodiments of the present application and should be included in the protection scope of the present application.