Disclosure of Invention
Based on the method and the device for updating and writing and the vehicle, the success rate of updating and writing is improved.
In a first aspect, an upgrade writing method is provided, the method including:
when downloading the upgrade data packet, diagnosing the network state of at least one link path, and taking the link path with the network state indicated as an unblocked state as an estimated transmission channel;
According to the average load, the delay time length and the path hop number of at least one estimated transmission channel, carrying out weighted calculation to obtain a corresponding evaluation score;
comparing each evaluation score to obtain a highest score, and taking an estimated transmission channel corresponding to the highest score as a final transmission channel;
generating a data message according to the upgrading data packet, and sending the data message through the final transmission channel;
and receiving and analyzing the data message from the final transmission channel to obtain an analyzed upgrading data packet, and updating and refreshing according to the upgrading data packet.
With reference to the first aspect, in a first implementation manner of the first aspect, one end of each link path includes a transmitting port for transmitting the upgrade data packet, and the other end includes a receiving port for receiving the upgrade data packet;
the step of diagnosing a network status of at least one link path includes:
acquiring a destination address associated with at least one receiving port;
diagnosing a link state of at least one of the transmitting ports, and diagnosing an on-off state between at least one of the transmitting ports to a receiving port associated with at least one of the destination addresses;
And taking the link state of at least one transmitting port and the on-off state between at least one transmitting port and at least one receiving port as the network state of at least one corresponding link path.
With reference to the first aspect, in a second implementation manner of the first aspect, the step of performing weighted calculation to obtain a corresponding evaluation score according to an average load, a delay time length, and a path hop count of at least one estimated transmission channel includes:
acquiring a first weight, a second weight and a third weight according to the upgrading object indicated by the upgrading data packet, wherein the first weight is used for measuring the importance degree of the average load in the evaluation score, the second weight is used for measuring the importance degree of the delay time length in the evaluation score, and the third weight is used for measuring the importance degree of the path hop count in the evaluation score;
calculating a first score multiplied by the average load of each estimated transmission channel and a corresponding first weight, a second score multiplied by the delay time of each estimated transmission channel and a corresponding second weight, and a third score multiplied by the path hop count of each estimated transmission channel and a corresponding third weight;
And calculating the sum of the first score, the second score and the third score of the same estimated transmission channel to obtain a corresponding evaluation score.
With reference to the first aspect, in a third implementation manner of the first aspect, the step of generating a data packet according to the upgrade data packet includes:
taking the transmission direction indicated by the final transmission channel as a reference direction, and acquiring the protocol address of the transmission node at the next moment;
acquiring a source address of a transmitting port and a destination address of a receiving port in the final transmission channel;
generating a data message according to the protocol address of the transmission node at the next moment, the source address of the sending port, the destination address of the receiving port and the upgrade refreshing data of the upgrade data packet.
With reference to the first aspect, in a fourth implementation manner of the first aspect, a transmission direction indicated by the final transmission channel is taken as a reference direction, and a protocol address of each transmission node is obtained;
acquiring a source address of a transmitting port and a destination address of a receiving port in the final transmission channel;
generating a data message according to the transmission direction according to the protocol address of each transmission node, the source address of the sending port, the destination address of the receiving port and the upgrade refreshing data of the upgrade data packet.
With reference to the third or fourth implementation manner of the first aspect, in a fifth implementation manner of the first aspect, the data packet further includes a source packet code, where the source packet code is configured to determine whether a received upgrade packet is the same as a transmitted upgrade packet after receiving and parsing the data packet, and in the data packet, the source packet code, a protocol address of a transmission node at the next moment, or a protocol address of each transmission node, a source address of the transmission port, a destination address of the reception port, and upgrade brushing data of the upgrade packet are arranged in a sequence from front to back, and are transmitted and received according to a sequential time sequence.
With reference to the third implementation manner of the first aspect, in a sixth implementation manner of the first aspect, the step of sending the data packet through the final transmission channel includes:
when the next node receives the data message, judging whether the data message is sent to a receiving port which is pre-associated with a destination address according to the destination address in the data message;
if yes, forwarding the data message to a receiving port corresponding to the destination address;
If not, calculating an optimal path according to the destination address in the data message, updating the optimal path into the final transmission channel, and forwarding the data message according to the updated final transmission channel.
With reference to the sixth implementation manner of the first aspect, in a seventh implementation manner of the first aspect, the step of sending the data packet through the final transmission channel further includes:
monitoring the transmission process of the data message sent by the final transmission channel;
when the final transmission channel is monitored to be faulty or blocked, acquiring a smooth transmission channel;
updating the unblocked transmission channel into the final transmission channel, and forwarding the data message according to the updated final transmission channel.
In a second aspect, an upgrade writing and brushing device is provided, which includes a issuing unit, at least one gateway and a control unit, wherein,
the issuing unit comprises at least one sending port, each sending port is respectively and electrically connected with each gateway, each gateway is connected in series to form a transmission loop, each gateway is electrically connected with at least one receiving port of the control unit, and the sending port of the issuing unit, at least one gateway and the receiving port of the control unit are electrically connected to form at least one corresponding link path;
The issuing unit is used for diagnosing the network state of at least one link path when the downloading of the upgrade data packet is completed, and taking the link path with the network state indicated as the unblocked state as an estimated transmission channel;
according to the average load, the delay time length and the path hop number of at least one estimated transmission channel, carrying out weighted calculation to obtain a corresponding evaluation score;
comparing each evaluation score to obtain a highest score, and taking an estimated transmission channel corresponding to the highest score as a final transmission channel;
generating a data message according to the upgrading data packet, and sending the data message through the final transmission channel;
and the control unit is used for receiving and analyzing the data message from the final transmission channel to obtain an analyzed upgrading data packet, and updating and refreshing the upgrading data packet.
In a third aspect, a vehicle is provided, which comprises the upgrade writing device according to the second aspect, wherein the upgrade writing device is configured to perform the steps of the upgrade writing method according to the first aspect or any of the possible embodiments in combination with the first aspect.
According to the upgrade refreshing method, the upgrade refreshing device and the vehicle, when the upgrade data packet is downloaded, the network state of each link path is diagnosed, and the link path with the network state indicated as the unblocked state is used as the estimated transmission channel; then, carrying out weighted calculation on the average load, the delay time length and the path hop count of at least one estimated transmission channel to obtain an estimated score of the corresponding estimated transmission channel; taking an estimated transmission channel corresponding to the highest score in each evaluation score as a final transmission channel; generating a data message according to the upgrade data packet, and sending the data message through the final transmission channel; and receiving and analyzing the data message from the final transmission channel to obtain an analyzed upgrading data packet, and updating and refreshing according to the analyzed upgrading data packet. Therefore, the method and the device can monitor the network state of each link path in real time, and determine the final transmission path according to the load condition, the delay condition and the path length condition, so that the transmission of the data message carrying the upgrade data packet is performed, the possibility of failure or blockage of certain channels is ensured, the upgrade data packet can be transmitted through routing to other channels, the transmission efficiency of the upgrade data packet is improved, and the success rate of upgrade writing and the use experience of a user are further improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
It should be noted that, the illustrations provided in the present embodiment merely illustrate the basic concepts of the application by way of illustration, and only the components related to the application are shown in the drawings, rather than being drawn according to the number, shape and size of the components in actual implementation, and the form, number and proportion of the components in actual implementation may be arbitrarily changed, and the layout of the components may be more complex.
The structures, proportions, sizes, etc. shown in the drawings attached hereto are for illustration purposes only and should not be construed as limiting the scope of the invention, since any structural modifications, changes in proportions, or adjustments of sizes, which may be made by those skilled in the art, should not be construed as limiting the scope of the invention, which is otherwise, limited to the specific embodiments disclosed herein, without affecting the efficiency and objects attained by the subject invention.
References in this specification to orientations or positional relationships as indicated by "upper", "lower", "left", "right", "intermediate", "longitudinal", "transverse", "horizontal", "inner", "outer", "radial", "circumferential", etc., are based on the orientation or positional relationships shown in the drawings, and are for ease of description only, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and are not to be construed as limiting the application. Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
With the increasing richness of intelligent networking automobile functions, corresponding upgrading data packets are larger and larger, and meanwhile, the congestion or fault degree of the network is increased. At present, when an automobile is upgraded based on a space downloading technology (OvertheAir Technology, OTA), an upgrade data packet is transmitted through a fixed channel, and the transmission efficiency of the upgrade data packet is reduced possibly due to network congestion or faults, so that upgrade writing fails, the success rate of upgrade writing is reduced, and the use experience of a user is difficult to meet.
Therefore, the method, the device and the vehicle for updating and writing are provided, and the final transmission path is determined according to the network state of each link path, the load condition, the delay condition and the path length condition, so that the transmission of the data message carrying the updating data packet is performed, the transmission of the updating data packet possibly caused by faults or blockage of certain channels is ensured, the updating data packet can be transmitted through routing to other channels, the transmission efficiency of the updating data packet is improved, and the success rate of updating and writing and the use experience of a user are further improved. Next, the present application will be described in detail by the following examples.
In a first embodiment, as shown in fig. 1, an upgrade brushing method is provided, and the method is applied to the communication structure schematic diagram shown in fig. 2 for explanation, and includes the following steps:
s1: and when the downloading of the upgrade data packet is completed, diagnosing the network state of at least one link path, and taking the link path with the network state indicated as the unblocked state as an estimated transmission channel.
It should be noted that the communication structure schematic diagram shown in fig. 2 may be applied to an upgrade and update scenario of an automobile, where the issuing unit may be a V-BOX or a T-BOX in the automobile, configured to communicate with a remote server through a network, download an upgrade data packet, and then send the downloaded upgrade data packet through each sending port, and transmit the upgrade data packet to a control unit to be upgraded through at least one gateway; the control unit may be any electronic control unit (ElectronicControlUnit, ECU) in the vehicle that requires updating of the software or firmware written. For convenience of description, the respective transmitting ports, the gateway, and the control units under the gateway may be numbered in the manner shown in fig. 2. And fig. 2 is only one schematic diagram of a communication structure applied in the present application, in other scenarios, the number of gateways and sending ports may also be two, three, five or more, and likewise, the number of control units hung under each gateway may also be one, two or more, which is not specifically enumerated in the present application.
According to the communication structure diagram shown in fig. 2, the link path is formed by electrically connecting the transmitting port of the issuing unit, at least one gateway and the receiving port of the control unit. Illustratively, the link path may be a transmit port of the issuing unit 1 Gateway 1 And a control unit 11 Is a receiving port of (a) 11 The electrical connection is formed, and the link path can also be the transmitting port of the transmitting unit 2 Gateway 2 Gateway 1 And a control unit 11 Is a receiving port of (a) 11 The electrical connection is formed, and the link path can also be the transmitting port of the transmitting unit 3 Gateway 3 Gateway 4 Gateway 1 And a control unit 12 Is a receiving port of (a) 12 The path from the transmitting unit of the transmitting unit to the receiving port of the control unit via at least one gateway can be regarded as a link path, which is not shown here.
Further, one end of each link path comprises a transmitting port for transmitting the upgrade data packet, and the other end comprises a receiving port for receiving the upgrade data packet; the step of diagnosing a network status of at least one link path includes: acquiring a destination address associated with at least one receiving port; diagnosing a link state of at least one of the transmitting ports, and diagnosing an on-off state between at least one of the transmitting ports to a receiving port associated with at least one of the destination addresses; and taking the link state of at least one transmitting port and the on-off state between at least one transmitting port and at least one receiving port as the network state of at least one corresponding link path.
The method comprises the steps of diagnosing whether the link state of each sending port is a connection state or not, diagnosing whether an upgrade data packet can be sent to a destination address of a control unit to be upgraded, namely diagnosing whether the on-off state between the sending port and a receiving port associated with the destination address is a communication state or not, and if the sending port of a certain link path is in a non-connection state and/or the on-off state between the sending port and the receiving port of the link path is in a non-communication state, considering the network state of the link path as a non-smooth state and subsequently failing to transmit the upgrade data packet through the link path; when the transmitting port of the link path is in a connection state and the on-off state between the transmitting port and the receiving port of the link path is in a communication state, the network state of the link path is considered to be in an unblocked state, and then the transmission of the upgrade data packet can be carried out through the transmitting port, and the link path is taken as an estimated transmission channel.
In addition, the step of diagnosing the link state and the on-off state may adopt various timing control modes, for example, a serial timing control mode may be adopted, that is, the link state is diagnosed first and then the on-off state is diagnosed, or the on-off state is diagnosed first and then the link state is diagnosed, and when the result of the previous diagnosing step is a non-connection state or a non-connection state, the network state of the link path is considered to be a non-smooth state, and the subsequent diagnosing step is not required to be continued; otherwise, continuing to execute the subsequent diagnosis step, and considering the network state of the link path as an unblocked state when the link state is the connection state and the on-off state is the communication state, so that the link path can be used as an estimated transmission channel; for example, a parallel time sequence control mode is adopted, the link state and the on-off state are diagnosed at the same time, when the diagnosis result shows that the link state is one of the non-connection state and the on-off state is the non-connection state, the network state of the link path is considered to be the non-smooth state, otherwise, the network state of other link paths is continuously diagnosed, and only the link state is simultaneously satisfied, and when the on-off state is the connection state, the network state of the link path is considered to be the smooth state. From the viewpoint of improving the diagnosis rate, the present application adopts a parallel execution control method.
S2: and carrying out weighted calculation according to the average load, the delay time length and the path hop number of at least one estimated transmission channel to obtain a corresponding evaluation score.
Specifically, before calculating the evaluation score, the average load, the delay time length and the path hop count of each estimated transmission channel need to be counted. The method comprises the steps that the total path load, delay time, path hop count and the like of each estimated transmission channel can be obtained through an OpenFlow protocol in a software defined network (SoftwareDefined Network, SDN), and for each estimated transmission channel, the corresponding node number and unit delay between every two adjacent nodes are obtained, wherein the nodes comprise a sending port of a sending unit, a gateway and a receiving port of a control unit; and dividing the total path load of the estimated transmission channel by (the number of nodes is-1) to obtain the average load of the estimated transmission channel, and adding unit delay between every two adjacent nodes of the estimated transmission channel to obtain the delay time of the estimated transmission channel. For example, the step of obtaining the total path load of each estimated transmission channel by using the OpenFlow protocol refers to: in the OpenFlow protocol, statistical information of a port, a flow table item, a group table and a meter table can be obtained through a statistical message; taking statistical information of the ports as an example, the traffic at the transmitting port and the receiving port can be obtained by periodically issuing PortStatistics information to obtain the total path load of the corresponding estimated transmission channel.
Further, for each estimated transmission channel, the path load between every two adjacent nodes can be obtained, wherein the nodes comprise a transmitting port of the issuing unit, a gateway and a receiving port of the control unit; and comparing the path load between two adjacent nodes with a load threshold, and rejecting the estimated transmission channel if the path load between the two adjacent nodes is larger than the load threshold to indicate that the estimated transmission channel is blocked or busy at the moment. The load threshold may be preset, or may be determined according to the total path load of each estimated transmission channel, for example, N times of the average load, so as to eliminate the estimated transmission channel that is blocked or busy.
As a specific implementation manner of step S2, the step of performing weighted calculation to obtain a corresponding evaluation score according to the average load, the delay time length and the path hop count of at least one estimated transmission channel includes: acquiring a first weight, a second weight and a third weight according to the upgrading object indicated by the upgrading data packet, wherein the first weight is used for measuring the importance degree of the average load in the evaluation score, the second weight is used for measuring the importance degree of the delay time length in the evaluation score, and the third weight is used for measuring the importance degree of the path hop count in the evaluation score; calculating a first score multiplied by the average load of each estimated transmission channel and a corresponding first weight, a second score multiplied by the delay time of each estimated transmission channel and a corresponding second weight, and a third score multiplied by the path hop count of each estimated transmission channel and a corresponding third weight; and calculating the sum of the first score, the second score and the third score of the same estimated transmission channel to obtain a corresponding evaluation score.
Wherein, the smaller the average load is, the higher the corresponding first score is, the shorter the delay time is, the higher the corresponding second score is, and the lower the path hop count is, the higher the corresponding third score is. The upgrade data packets of different upgrade objects correspond to different requirements, for example, if the path hop number of a certain upgrade object for transmitting the upgrade data packet is minimum, the third weight is correspondingly higher; for another example, if a certain upgrade object needs to send the upgrade data packet fastest, the second weight is correspondingly higher; for another example, if a path of a certain upgrade object to transmit an upgrade data packet is stable, interference of other transmission data is avoided as much as possible, and the first weight is correspondingly higher. Therefore, the method and the device can allocate the first weight, the second weight and the third weight according to the upgrade objects indicated by the upgrade data packet, so that the evaluation score of each estimated transmission channel is calculated adaptively, and the most suitable transmission channel is screened for the upgrade data packets of different upgrade objects.
For example, the upgrade objects of the automobile OTA include: automotive power systems, infotainment systems, security control systems, chassis electronics systems, body control systems, and the like. Specifically, the automobile power system comprises a battery, a generator, an engine, a variable speed transmission system and the like; the information entertainment system comprises a T-Box, a controller area network (ControllerAreaNetwork, CAN) bus, a global positioning system (GlobalPositioningSystem, GPS) module, an Ethernet, a Head-up display (HUD), a vehicle-mounted sound Box, a central control display screen, an entertainment system and the like; the safety control system comprises an airbag, a collision sensor, a brake anti-lock system (AntilockBrakeSystem, ABS), a passenger detection unit, a noise reduction unit, a brake system, a vehicle speed sensor and the like; the chassis electronic system comprises a suspension system, a steering system and the like; the vehicle Body control system includes a door, a dashboard, a door window, a sunroof, an On-vehicle automatic diagnosis system (On-BoardDiagnostics, OBD), a vehicle Body control system (Body ControlModule, BCM), a vehicle lighting system, a temperature control system, and the like.
The corresponding relation between the upgrading object and the first weight, the second weight and the third weight is preset, so that after the upgrading data packet is acquired, the upgrading object indicated by the upgrading data packet can be searched in the set corresponding relation to acquire the first weight, the second weight and the third weight corresponding to the upgrading object. For example, for an infotainment system, the faster the upgrade packet is sent, the better the upgrade packet is, so the second weight and the third weight are higher than the first weight, and further, if the delay is required to be as shortest as possible, the result of weight allocation may be that the second weight is highest, the third weight is next highest, and the first weight is lowest; for another example, for an automobile power system, a safety control system and a vehicle body control system, the more stable the transmission of the upgrade data packet is, the higher the value of the first weight can be allocated as compared with the second weight and the third weight, the delay time length and the path hop count emphasize the transmission rate, and therefore the value of the second weight and the third weight can be allocated as equal or as small as possible. The manner in which the first weight, the second weight, and the third weight of the other upgrade objects are set is similar, and is not illustrated herein, wherein specific values of the first weight, the second weight, and the third weight of each upgrade object may be determined by performing a real vehicle test.
S3: comparing each evaluation score to obtain a highest score, and taking an estimated transmission channel corresponding to the highest score as a final transmission channel;
s4: generating a data message according to the upgrade data packet, and sending the data message through the final transmission channel.
In a specific embodiment, the step of generating a data packet according to the upgrade data packet includes: taking the transmission direction indicated by the final transmission channel as a reference direction, and acquiring the protocol address of the transmission node at the next moment; acquiring a source address of a transmitting port and a destination address of a receiving port in the final transmission channel; generating a data message according to the protocol address of the transmission node at the next moment, the source address of the sending port, the destination address of the receiving port and the upgrade refreshing data of the upgrade data packet.
The source address of each sending port is the address of the issuing unit, the destination address of the receiving port is the address of the corresponding control unit, and the addresses of the issuing unit, the gateway and the control unit are unique to the whole network. Illustratively, the protocol address of the issuing unit may be 192.168.69.1, the logical address may be 0x1000, and the source address of each sending port of the issuing unit is the address of the issuing unit, where the address may be a protocol address or a logical address; gateway 1 to gateway 4 May be 192.168.69.101 to 192.168.69.104 in order; control unit 11 The protocol address of (c) may be 192.168.69.161 and the logical address may be 0x2001.
Illustratively, taking the communication structure diagram shown in FIG. 2 as an example, assume that the control unit 11 Need to be upgradedAnd the final transmission channel obtained by the steps is the transmitting port of the slave issuing unit 2 Sequentially pass through the gateway 2 And gateway 1 Then to a control unit 11 Is a receiving port of (a) 11 Then the transmission node, namely the gateway, at the next moment is obtained 2 Then according to the gateway 2 Protocol address, transmitting port of (c) 2 Source address, receiving port of (c) 11 The destination address of the transmission node and the update brush data of the update data packet to generate a data message, in this example, the protocol address of the transmission node at the next moment is the gateway 2 Is used for the protocol address of (a).
Further, as shown in fig. 3, the data packet further includes a source data packet code, where in the data packet, the source data packet code, the protocol address of the transmission node at the next moment, the source address of the sending port, the destination address of the receiving port, and the update brush data of the update data packet are arranged in a front-to-back order, and are sent and received according to a time sequence. The source data packet code is used for judging whether the received upgrade data packet is the same as the upgrade data packet sent by the issuing unit after the control unit receives and analyzes the data packet, if so, the upgrade data packet is the same, otherwise, the original upgrade data packet is required to be retransmitted.
In another specific embodiment, the step of generating a data packet according to the upgrade data packet includes: taking the transmission direction indicated by the final transmission channel as a reference direction, and acquiring the protocol address of each transmission node; acquiring a source address of a transmitting port and a destination address of a receiving port in the final transmission channel; generating a data message according to the transmission direction according to the protocol address of each transmission node, the source address of the sending port, the destination address of the receiving port and the upgrade refreshing data of the upgrade data packet. It should be noted that, if the data packet is generated in this way, the data packet is only required to be forwarded according to the protocol address of each transmission node in the packet in sequence when the data packet is transmitted.
Further, as shown in fig. 6, the data packet further includes a source packet code, where in the data packet, the source packet code, the protocol address of each transmission node, the source address of the sending port, the destination address of the receiving port, and the update brush data of the update packet are arranged in a front-to-back order, and are sent and received according to a time sequence. Similarly, the source packet code is used for the receiving unit to verify whether the received upgrade packet is identical to the upgrade packet sent by the issuing unit.
Illustratively, taking the communication structure diagram shown in fig. 2 as an example, it is assumed that the final transmission channel obtained through the foregoing steps is the transmission port of the slave issuing unit 2 Sequentially pass through the gateway 2 And gateway 1 Then to a control unit 11 Is a receiving port of (a) 11 Then the transmission node, namely the gateway, at the next moment is obtained 2 And gateway 1 Is then encoded according to the source data packet and the gateway 2 And gateway 1 Protocol address, transmitting port of (c) 2 Source address, receiving port of (c) 11 The destination address of the data packet and the update brush data of the update data packet are generated according to the format shown in fig. 4, in this example, the gateway is based on the data structure diagram of the data packet shown in fig. 4 2 And gateway 1 The protocol addresses of (2) are arranged in the order from left to right, and are sent and received according to the time sequence. Similarly, if the number of gateway nodes passing through the final transmission channel is three or more, the three or more gateways are arranged from left to right according to the transmission direction based on the data structure diagram shown in fig. 4, and are sent and received according to the time sequence, which is not specifically mentioned in the present application.
S5: and receiving and analyzing the data message from the final transmission channel to obtain an analyzed upgrading data packet, and updating and refreshing according to the upgrading data packet.
Preferably, in the process of data message transmission, the final transmission channel can be continuously updated by monitoring the network state of each link path in real time, so that the data message carrying the upgrade data packet is transmitted through the optimal path, the transmission efficiency of the upgrade data packet is further improved, and the success rate of upgrade and writing is further improved.
In a specific embodiment, the step of sending the data packet through the final transmission channel includes: when the next node receives the data message, judging whether the data message is sent to a receiving port which is pre-associated with a destination address according to the destination address in the data message; if yes, forwarding the data message to a receiving port corresponding to the destination address; if not, calculating an optimal path according to the destination address in the data message, updating the optimal path into the final transmission channel, and forwarding the data message according to the updated final transmission channel.
It should be noted that, the transmission process is implemented based on the data packet generated in the first packet format, that is, the data packet includes the protocol address of the transmission node at the next moment, and the transmitting unit sends the data packet to the corresponding transmission node at the next moment; after the transmission node receives the data message, as each gateway is associated with the address of the control unit hung down by itself, whether the data message is sent to the control unit hung down by itself or not can be judged, if yes, the data message is directly forwarded to the control unit indicated by the destination address in the data message, if not, an optimal path can be calculated through a network awareness application, then the data message is forwarded to the corresponding transmission node at the next moment according to the optimal path, and so on, so that the transmission of the data message is completed.
For example, referring to FIG. 2, the control unit is described above 11 To illustrate the final transmission path that needs to be updated and obtained, the issuing unit sends the data message to the gateway 2 Gateway 2 The data message is analyzed to judge that the data message is not sent to the control unit hung under the control unit, and the data message is found through calculation and is sent to the gateway 1 Transmitting as optimal path, gateway 2 Gateway is connected with 1 Fill in to dataIn the message, and send the data message to the gateway 1 Gateway 1 By parsing it is found to be sent to the own underhung control unit 11 Directly forward it to the control unit 11 。
In another embodiment, the step of sending the data packet through the final transmission channel further includes: monitoring the transmission process of the data message sent by the final transmission channel; when the final transmission channel is monitored to be faulty or blocked, acquiring a smooth transmission channel; updating the unblocked transmission channel into the final transmission channel, and forwarding the data message according to the updated final transmission channel.
For example, assume a control unit 11 The final transmission path is the transmitting port of the issuing unit, which needs to be updated 1 Gateway 1 And a control unit 11 As shown in fig. 5, the issuing unit discovers the transmitting port 1 To gateway 1 The path between them fails, found by reselection, as indicated by the arrow direction in fig. 5, from the transmitting port 4 Warp gateway 4 And gateway 1 To the control unit 11 Is an optimal smooth transmission channel; the issuing unit will gateway 4 Obtains new data message according to the encapsulation format shown in figure 4 and obtains new data message from gateway 4 Sending the data message; gateway (GW) 4 After receiving the data message, the data message is judged to be not sent to the control unit hung under the control unit by analysis, the data message is required to be forwarded, and the data message is found through calculation and gateway 1 Optimally, then the gateway 1 According to the encapsulation format shown in figure 3, a new data message is obtained and sent to the gateway 1 The method comprises the steps of carrying out a first treatment on the surface of the Gateway (GW) 1 After receiving the data message, resolving to find that the data message is sent to the control unit hung down by the user, and then sending the data message to the control unit hung down 11 Control unit 11 And obtaining an upgrade data packet by recombining upgrade refreshing data, checking through source data packet codes, and after checking, carrying out upgrade refreshing.
Also for example, falseIn the transmission process of the data message, as shown in fig. 6, the sending port is monitored 1 To gateway 1 Path, transmission port of (a) 2 To gateway 2 Path, transmission port of (a) 4 To gateway 4 Failure of all paths of (a) and discovery of only the transmit port 3 To gateway 3 Control unit capable of being upgraded 11 Selecting the path to transmit the data message; as indicated by the arrow direction in fig. 6, the issuing unit passes the data message through the transmitting port 3 Sent to gateway 3 Gateway 3 Find that it is not sent to the control unit under itself, so the data message needs to be forwarded, and at this time, two paths can reach the control unit 11 The method comprises the following steps: slave gateway 3 To gateway 2 To the gateway 1 Finally, send to the control unit 11 Or from a gateway 3 To gateway 4 To the gateway 1 Finally, send to the control unit 11 The method comprises the steps of carrying out a first treatment on the surface of the Gateway (GW) 3 At this time, a clear transmission channel needs to be calculated, although both paths reach the control unit 11 Is consistent in path hops but from the gateway 3 To gateway 4 Is failed, thus selecting a slave gateway 3 To gateway 2 To the gateway 1 Finally, send to the control unit 11 As a smooth transmission channel, the data message is transmitted through the smooth transmission channel, and finally upgrade refreshing is realized; wherein, the gateway can be used for transmission 2 According to the message format shown in figure 3 and transmitting the data message to the gateway 2 Then by gateway 2 According to gateway 1 Generates a new data message according to the message format shown in figure 3 and sends it to the gateway 1 Gateway 1 And then sends it to the control unit 11 The method comprises the steps of carrying out a first treatment on the surface of the Or according to the gateway 2 And gateway 1 Generates a data message according to the message format shown in fig. 4, and sends the data message to the gateway according to the prior protocol address 2 Resending to gateway 1 Is transmitted in sequence and finally to the control unit 11 。
In summary, the network state of each link path is monitored in real time, and the final transmission path is determined according to the load condition, the delay condition and the path length condition, so that the transmission of the data message carrying the upgrade data packet is performed, the transmission of the upgrade data packet possibly caused by the failure or blockage of some channels is ensured, the upgrade data packet can be further transmitted to other channels by routing, the transmission efficiency of the upgrade data packet is improved, and the success rate of upgrade writing and the use experience of users are further improved.
It should be understood that, although the steps in the flowchart of fig. 1 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 1 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of other steps or sub-steps of other steps.
In a second embodiment, as shown in fig. 7, an upgrade writing device is provided, which includes a issuing unit, at least one gateway and a control unit, wherein,
the issuing unit comprises at least one sending port, each sending port is respectively and electrically connected with each gateway, each gateway is connected in series to form a transmission loop, each gateway is electrically connected with at least one receiving port of the control unit, and the sending port of the issuing unit, at least one gateway and the receiving port of the control unit are electrically connected to form at least one corresponding link path;
the issuing unit is used for diagnosing the network state of at least one link path when the downloading of the upgrade data packet is completed, and taking the link path with the network state indicated as the unblocked state as an estimated transmission channel;
according to the average load, the delay time length and the path hop number of at least one estimated transmission channel, carrying out weighted calculation to obtain a corresponding evaluation score;
comparing each evaluation score to obtain a highest score, and taking an estimated transmission channel corresponding to the highest score as a final transmission channel;
generating a data message according to the upgrading data packet, and sending the data message through the final transmission channel;
And the control unit is used for receiving and analyzing the data message from the final transmission channel to obtain an analyzed upgrading data packet, and updating and refreshing the upgrading data packet.
Specifically, one end of each link path comprises a transmitting port for transmitting the upgrade data packet, and the other end comprises a receiving port for receiving the upgrade data packet; the issuing unit is used for: acquiring a destination address associated with at least one receiving port; diagnosing a link state of at least one of the transmitting ports, and diagnosing an on-off state between at least one of the transmitting ports to a receiving port associated with at least one of the destination addresses; and taking the link state of at least one transmitting port and the on-off state between at least one transmitting port and at least one receiving port as the network state of at least one corresponding link path.
Specifically, the issuing unit is further configured to: acquiring a first weight, a second weight and a third weight according to the upgrading object indicated by the upgrading data packet, wherein the first weight is used for measuring the importance degree of the average load in the evaluation score, the second weight is used for measuring the importance degree of the delay time length in the evaluation score, and the third weight is used for measuring the importance degree of the path hop count in the evaluation score; calculating a first score multiplied by the average load of each estimated transmission channel and a corresponding first weight, a second score multiplied by the delay time of each estimated transmission channel and a corresponding second weight, and a third score multiplied by the path hop count of each estimated transmission channel and a corresponding third weight; and calculating the sum of the first score, the second score and the third score of the same estimated transmission channel to obtain a corresponding evaluation score.
Specifically, the issuing unit is further configured to: taking the transmission direction indicated by the final transmission channel as a reference direction, and acquiring the protocol address of the transmission node at the next moment; acquiring a source address of a transmitting port and a destination address of a receiving port in the final transmission channel; generating a data message according to the protocol address of the transmission node at the next moment, the source address of the sending port, the destination address of the receiving port and the upgrade refreshing data of the upgrade data packet.
Specifically, the issuing unit is further configured to: taking the transmission direction indicated by the final transmission channel as a reference direction, and acquiring the protocol address of each transmission node; acquiring a source address of a transmitting port and a destination address of a receiving port in the final transmission channel; generating a data message according to the transmission direction according to the protocol address of each transmission node, the source address of the sending port, the destination address of the receiving port and the upgrade refreshing data of the upgrade data packet.
Specifically, the data packet further includes a source data packet code, where the source data packet code is configured to determine whether a received upgrade data packet is the same as a transmitted upgrade data packet after receiving and analyzing the data packet, and in the data packet, the source data packet code, a protocol address of a transmission node at the next moment, or a protocol address of each transmission node, a source address of the transmitting port, a destination address of the receiving port, and upgrade brushing data of the upgrade data packet are arranged in sequence from front to back, and are transmitted and received according to a time sequence.
Specifically, the step of sending the data message through the final transmission channel includes: when the next node receives the data message, judging whether the data message is sent to a receiving port which is pre-associated with a destination address according to the destination address in the data message; if yes, forwarding the data message to a receiving port corresponding to the destination address; if not, the issuing unit is further configured to calculate an optimal path according to the destination address in the data packet, update the optimal path to the final transmission channel, and forward the data packet according to the updated final transmission channel.
Specifically, the issuing unit is further configured to: monitoring the transmission process of the data message sent by the final transmission channel; when the final transmission channel is monitored to be faulty or blocked, acquiring a smooth transmission channel; updating the unblocked transmission channel into the final transmission channel, and forwarding the data message according to the updated final transmission channel.
For specific limitations of the upgrade writing device, reference may be made to the above limitation of the upgrade writing method, and no further description is given here. The above-described respective modules in the upgrade writing apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In another embodiment, a vehicle is provided, the vehicle comprising the upgrade writing device of any one of the second embodiments, wherein the upgrade writing device is configured to perform the upgrade writing method of any one of the first embodiments.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.