Terminal upgrading method and device, computer equipment, readable storage medium and program product
By adopting differential update strategies and load restructuring technology in on-board terminals, the problem of low upgrade efficiency of traditional on-board terminals is solved, and more efficient data transmission and terminal upgrades are achieved.
Patent Information
- Application Number
- CN202510306054.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-06-10
AI Technical Summary
The traditional vehicle terminal upgrade method is inefficient and requires the complete update package to be written into the domain controller, which results in a long time in the upgrade process.
The differential update strategy is adopted to obtain the update data packet issued by the server, which includes the difference data between the original file and the update file, the first address information corresponding to the difference data, and the second address information corresponding to the same data. Then, the update packet is split based on the preset split length, and the initial sub-packet is load-reorganized according to the address information, obtaining the first target sub-packet and the second target sub-packet, and only the difference data is transmitted.
Through differential update strategies, the data transmission volume is reduced, the network bandwidth pressure and transmission time are reduced, and the efficiency of terminal upgrades is improved.
Smart Images

Figure CN120128910A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of vehicle communication, and particularly to a method and device for terminal upgrade, a computer device, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the development of in-vehicle terminal technology, the functions of in-vehicle terminals can be updated according to the requirements of safety, control, etc. The in-vehicle terminals can be upgraded through OTA (Over The Air, remotely update and manage devices through wireless networks) technology.
[0003] In traditional technologies, for the upgrade of the domain controller of an in-vehicle terminal, the T-Box (Telematics BOX, remote information processor) in the in-vehicle terminal receives a complete update package sent by an upgrade platform, and sends the complete update package to the domain controller according to the UDS (Unified Diagnostic Services) protocol, so that the domain controller writes the complete update package to the storage medium of the domain controller.
[0004] However, in current traditional technologies, since the complete update package is written to the domain controller every time the in-vehicle terminal is upgraded, the upgrade efficiency of the in-vehicle terminal is low. Summary of the Invention
[0005] Based on this, in view of the above technical problems, it is necessary to provide a method and device for terminal upgrade, a computer device, a computer-readable storage medium, and a computer program product.
[0006] In a first aspect, the present application provides a method for terminal upgrade, which is applied to a remote information processor and includes:
[0007] Obtain an update data packet sent by a server; the update data packet includes the difference data between the original file and the update file, the first address information corresponding to the difference data, and the second address information corresponding to the same data;
[0008] Split the update data packet based on a preset split length, and perform payload recombination on the initial sub-data packets obtained after splitting according to the address ranges of the initial sub-data packets, the first address information, and the second address information, to obtain a first target sub-data packet and a second target sub-data packet; the first target sub-data packet includes the difference data after payload recombination, and the second target sub-data packet is an empty data packet;
[0009] Send the first target sub-data packet and the second target sub-data packet to a controller.
[0010] In one embodiment, after obtaining the update data packet sent by the server, the method further includes:
[0011] Feedback a terminal upgrade prompt on the front-end page;
[0012] Receive the voltage status information reported by the voltage sensor. If the voltage status information meets the preset voltage condition, execute the step of splitting the update data packet based on the preset splitting length.
[0013] In one embodiment, the step of performing payload recombination on the initial sub-packets according to the address ranges corresponding to the initial sub-packets obtained after splitting, the first address information, and the second address information to obtain the first target sub-packet and the second target sub-packet includes:
[0014] Match the address range corresponding to the initial sub-packet based on the first address information and the second address information to obtain a matching result;
[0015] Determine the target packet type corresponding to each initial sub-packet according to the matching result;
[0016] Recombine the payloads of the initial sub-packets based on the target packet type to obtain the first target sub-packet and the second target sub-packet.
[0017] In one embodiment, the step of determining the target packet type corresponding to each initial sub-packet according to the matching result includes:
[0018] If the matching result is that the address range corresponding to the initial sub-packet includes the first address information, determine the target packet type as the update data type;
[0019] If the matching result is that the address range corresponding to the initial sub-packet only includes the second address information, determine the target packet type as the no-update data type.
[0020] In one embodiment, the step of recombining the payloads of the initial sub-packets based on the target packet type to obtain the first target sub-packet and the second target sub-packet includes:
[0021] For the initial sub-packet of the update data type, construct the first header information of the first target sub-packet based on the first address information;
[0022] Construct the payload data of the first target sub-packet according to the differential data corresponding to the first address information to obtain the first target sub-packet containing the differentially recombined data;
[0023] For the initial sub - data packet of the non - updated data type, construct the second header information of the second target sub - data packet based on the second address information, and determine the payload data as blank data, obtaining a second target sub - data packet containing an empty data packet.
[0024] In a second aspect, the present application further provides a terminal upgrade method, which is applied to a server. The method includes:
[0025] Perform data comparison on the original file and the update file corresponding to the terminal to be upgraded, determine the difference data between the original file and the update file, the first address information corresponding to the difference data, and the second address information corresponding to the identical data;
[0026] Construct an update data packet according to the difference data, the first address information, and the second address information, and send the update data packet to the remote information processor.
[0027] In a third aspect, the present application further provides a terminal upgrade device, which is applied to a remote information processor and includes:
[0028] An acquisition module, configured to acquire the update data packet sent by the server; the update data packet includes the difference data between the original file and the update file, the first address information corresponding to the difference data, and the second address information corresponding to the identical data;
[0029] A splitting module, configured to split the update data packet based on a preset splitting length, and perform payload recombination on the initial sub - data packet according to the address range corresponding to the initial sub - data packet obtained after splitting, the first address information, and the second address information, obtaining a first target sub - data packet and a second target sub - data packet; the first target sub - data packet includes the difference data after payload recombination, and the second target sub - data packet is an empty data packet;
[0030] A sending module, configured to send the first target sub - data packet and the second target sub - data packet to the controller.
[0031] In one embodiment, the device further includes:
[0032] A feedback module, configured to feedback a terminal upgrade prompt on the front - end page;
[0033] A detection module, configured to receive the voltage status information reported by the voltage sensor, and if the voltage status information meets a preset voltage condition, execute the step of splitting the update data packet based on the preset splitting length.
[0034] In one embodiment, the splitting module is specifically configured to match the address range corresponding to the initial sub-packet based on the first address information and the second address information to obtain a matching result;
[0035] Determine the target packet type corresponding to each of the initial sub-packets according to the matching result;
[0036] Recombine the payloads of the initial sub-packets based on the target packet type to obtain a first target sub-packet and a second target sub-packet.
[0037] In one embodiment, the splitting module is specifically configured to, if the matching result is that the address range corresponding to the initial sub-packet includes the first address information, determine the target packet type as the updated data type;
[0038] If the matching result is that the address range corresponding to the initial sub-packet only includes the second address information, determine the target packet type as the non-updated data type.
[0039] In one embodiment, the splitting module is specifically configured to, for the initial sub-packet of the updated data type, construct the first header information of the first target sub-packet based on the first address information;
[0040] Construct the payload data of the first target sub-packet according to the differential data corresponding to the first address information to obtain a first target sub-packet containing the differential data after payload recombination;
[0041] For the initial sub-packet of the non-updated data type, construct the second header information of the second target sub-packet based on the second address information, and determine the payload data as blank data to obtain a second target sub-packet containing an empty packet.
[0042] In a fourth aspect, the present application further provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0043] Obtain an update packet sent by a server; the update packet includes the differential data between an original file and an updated file, the first address information corresponding to the differential data, and the second address information corresponding to the same data;
[0044] Split the updated data packet based on a preset splitting length, and perform payload recombination on the initial sub-packets obtained after splitting according to the address ranges corresponding to the initial sub-packets, the first address information, and the second address information, to obtain a first target sub-packet and a second target sub-packet; the first target sub-packet includes the differential data after payload recombination, and the second target sub-packet is an empty data packet;
[0045] Send the first target sub-packet and the second target sub-packet to the controller.
[0046] In a fifth aspect, the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0047] Obtain the updated data packet sent by the server; the updated data packet includes the differential data between the original file and the updated file, the first address information corresponding to the differential data, and the second address information corresponding to the identical data;
[0048] Split the updated data packet based on a preset splitting length, and perform payload recombination on the initial sub-packets obtained after splitting according to the address ranges corresponding to the initial sub-packets, the first address information, and the second address information, to obtain a first target sub-packet and a second target sub-packet; the first target sub-packet includes the differential data after payload recombination, and the second target sub-packet is an empty data packet;
[0049] Send the first target sub-packet and the second target sub-packet to the controller.
[0050] In a sixth aspect, the present application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0051] Obtain the updated data packet sent by the server; the updated data packet includes the differential data between the original file and the updated file, the first address information corresponding to the differential data, and the second address information corresponding to the identical data;
[0052] Split the updated data packet based on a preset splitting length, and perform payload recombination on the initial sub-packets obtained after splitting according to the address ranges corresponding to the initial sub-packets, the first address information, and the second address information, to obtain a first target sub-packet and a second target sub-packet; the first target sub-packet includes the differential data after payload recombination, and the second target sub-packet is an empty data packet;
[0053] Send the first target sub-packet and the second target sub-packet to the controller.
[0054] The above terminal upgrade method, device, computer device, computer-readable storage medium, and computer program product obtain an update data packet sent by a server; the update data packet includes difference data between an original file and an updated file, first address information corresponding to the difference data, and second address information corresponding to identical data; split the update data packet based on a preset split length, and perform payload recombination on the initial sub-packets obtained after splitting according to the address ranges, first address information, and second address information corresponding to the initial sub-packets, to obtain a first target sub-packet and a second target sub-packet; the first target sub-packet includes the difference data after payload recombination, and the second target sub-packet is an empty data packet; send the first target sub-packet and the second target sub-packet to a controller. By using this method, first, an update data packet including difference data, first address information, and second address information sent by the server is obtained, and a differential update strategy is adopted to only transmit the different parts between the original file and the updated file, which can greatly reduce the data transmission volume, reduce the network bandwidth pressure and transmission time, and improve the update efficiency. The update data packet is split according to the preset split length, and payload recombination is performed based on the address information to obtain a first target sub-packet and a second target sub-packet, so that the first target sub-packet is used for terminal upgrade, includes key difference data and first address information, can accurately guide the target controller to perform data update, and at the same time, the second target sub-packet only includes second address information, which ensures that the message transmission during terminal upgrade meets the requirements of the communication protocol and reduces the data transmission volume, thereby improving the efficiency of terminal upgrade. Description of the Drawings
[0055] To more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments of the present application or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0056] Figure 1 It is an application environment diagram of the terminal upgrade method in an embodiment;
[0057] Figure 2 It is a flowchart of the terminal upgrade method applied to a remote information processor in an embodiment;
[0058] Figure 3 It is a flowchart of the upgrade environment preparation step in an embodiment;
[0059] Figure 4 It is a flowchart of the process of performing type division and matching on the initial sub-packets in an embodiment;
[0060] Figure 5 Flow schematic diagram for dividing matching results in an embodiment;
[0061] Figure 6 Flow schematic diagram for payload recombination of initial sub - data packets in an embodiment;
[0062] Figure 7 Flow schematic diagram for terminal upgrade applied to a server in an embodiment;
[0063] Figure 8 Flow schematic diagram for an example of a terminal upgrade method in an embodiment;
[0064] Figure 9 Block diagram of a terminal upgrade device applied to a telematics unit in an embodiment;
[0065] Figure 10 Internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0066] In order to make the objectives, technical solutions and advantages of the present application more clear and understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0067] The terminal upgrade method provided by the embodiments of the present application can be applied to, for example Figure 1In the application environment shown. Among them, the remote information processor 102 communicates with the server 104 through the network, and the remote information processor 102 communicates with the controller 106 through the CAN bus. The remote information processor 102 and the controller 106 are arranged inside the vehicle, and the vehicle realizes interaction with the server 104 through the remote information processor 102. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or can be placed on the cloud or other network servers. The remote information processor 102 communicates with the controller 106 through the CAN (Controller Area Network) bus. The remote information processor 102 obtains the update data packet sent by the server 104; the update data packet includes the difference data between the original file and the update file, the first address information corresponding to the difference data, and the second address information corresponding to the same data; the remote information processor 102 splits the update data packet based on a preset split length, and based on the address range, the first address information, and the second address information corresponding to the obtained initial sub-packets after splitting, performs payload recombination on the initial sub-packets to obtain a first target sub-packet and a second target sub-packet; the first target sub-packet includes the difference data after payload recombination, and the second target sub-packet is an empty data packet; the remote information processor 102 sends the first target sub-packet and the second target sub-packet to the controller 106. Among them, the remote information processor 102 can be an in-vehicle T-Box. The server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The controller can be an in-vehicle domain controller (DCU, Domain Control Unit). The CAN bus is a communication protocol and hardware standard used in automotive and industrial control systems. It enables each control unit in the vehicle (for example, the engine control unit, the braking system, the body control system, etc.) to communicate through a shared network.
[0068] In an exemplary embodiment, as Figure 2 shown, a terminal upgrade method is provided. Taking the remote information processor in Figure 1 as an example, the method includes the following steps 202 to 206. Among them:
[0069] Step 202, obtain the update data packet sent by the server.
[0070] Among them, the update data packet includes the difference data between the original file and the update file, the first address information corresponding to the difference data, and the second address information corresponding to the same data.
[0071] In the embodiments of the present application, when an automobile manufacturer develops an update file for a certain vehicle model, it will upload it to the upgrade platform. The upgrade platform will screen out the vehicles that need to be updated according to information such as the vehicle model and software version, and send the update data packet to the terminal devices of these vehicles (for example, T-Box). The vehicles that need to be upgraded can be commercial heavy-duty vehicles or a group of vehicles in a commercial heavy-duty vehicle fleet. By planning, scheduling, maintaining, and optimizing multiple vehicles, and conducting data analysis and real-time monitoring, the transportation efficiency can be improved and the operation cost can be reduced.
[0072] After the upgrade platform of the server sends the update data packet, the vehicle receives and obtains the update data packet sent by the upgrade platform in the server through the telematics processor (T-Box). The update data packet is an update data packet that the server clips and reconstructs according to the difference between the current original file and the update file of the vehicle terminal to be upgraded. The construction process of the update data packet in the server is elaborated in detail in the following embodiments.
[0073] In a specific embodiment, the upgrade platform first sends an upgrade instruction to the telematics processor. The upgrade instruction may include key information such as the version number of the upgrade package, the download address, the upgrade time requirement, and the vehicle identification number (VIN, Vehicle Identification Number) to ensure that the upgrade task is accurately assigned to the corresponding vehicle. The telematics processor listens to the communication interface in real time. When it receives the data packet of the upgrade instruction sent by the upgrade platform, it first performs a data integrity check to ensure that the received upgrade instruction is not lost or damaged. Then, after confirming that the download conditions are met, the telematics processor starts resource allocation. The telematics processor reserves enough local storage medium space for the update data packet and adjusts the system resources to ensure that other normal functions of the vehicle will not be affected during the download process. For example, reasonably allocate the processor usage rate, memory space, etc. After the update data packet is downloaded, the telematics processor generates a feedback message indicating successful download and sends the feedback message indicating successful download to the server. The feedback message includes information such as the vehicle identification number, the version number of the upgrade package, and the download completion time.
[0074] Step 204: Split the update data packet based on a preset split length, and perform payload recombination on the initial sub-packets obtained after splitting according to the address range, the first address information, and the second address information corresponding to the initial sub-packets to obtain a first target sub-packet and a second target sub-packet.
[0075] Among them, the first target sub-packet includes the differential data after payload recombination, and the second target sub-packet is an empty data packet.
[0076] In the embodiments of the present application, after the remote information processor completes the download of the update data packet, it is necessary to transmit the update data packet to the controller, and the controller is flashed with the update data packet. Herein, the controller may be a power domain controller. Before the remote information processor transmits the content of the update data packet to the controller, it is necessary to split the complete update data packet. That is, the remote information processor splits the update data packet according to a preset split length to obtain a plurality of initial sub-packets.
[0077] The preset split length is a fixed data length value preset according to system design and actual requirements. For example, based on the data reception ability of the controller, the regulations of the communication protocol, or the consideration of transmission efficiency, the preset split length is set to 1024 bytes. The remote information processor starts from the starting position of the update data packet and intercepts a data segment with a length of the preset split length as an initial sub-packet each time until the update data packet is completely split. Finally, a plurality of initial sub-packets are obtained, and the length of each initial sub-packet is the preset split length.
[0078] In the update data packet design stage, the corresponding relationship between each data part and a specific address range in the vehicle controller memory has been established. The remote information processor determines the corresponding address range of each initial sub-packet in the controller memory according to the predefined address mapping table and records the corresponding address range for each initial sub-packet. For example, the controller memory address range corresponding to the first 1024-byte initial sub-packet is 0x1000 - 0x13FF, and the second corresponds to 0x1400 - 0x17FF, etc.
[0079] The first address information refers to the valid address range where data needs to be updated, including the difference data between the original file and the update file. For example, the first address information is to only enhance the function or repair vulnerabilities in a certain area of the controller, and the address range of this area is the first address information.
[0080] The second address information refers to the address range where data does not need to be updated, that is, the address range of the same data between the original file and the update file, or the reserved address area. During the update process, no actual data content needs to be transmitted for these address ranges.
[0081] Finally, the remote information processor performs payload recombination on the initial sub-packets, so that the first target sub-packet includes the difference data after payload recombination, or includes partial difference data and blank data, and the second target sub-packet is an empty data packet.
[0082] Step 206: Transmit the first target sub-packet and the second target sub-packet to the controller.
[0083] In the embodiments of the present application, before sending, the remote information processor performs an integrity check on the reorganized first target sub-packet and second target sub-packet. Specifically, before sending, the remote information processor performs an integrity check on the first target sub-packet and the second target sub-packet. If the checksum is inconsistent with the pre-calculated value, it indicates that an error may have occurred during the reorganization of the sub-packet, and the sub-packet needs to be regenerated.
[0084] To ensure that the controller can correctly receive and process the first target sub-packet and the second target sub-packet, the remote information processor sorts and numbers the first target sub-packet and the second target sub-packet. The remote information processor numbers them in the order of the address range corresponding to the data packets, and constructs multiple data frames to be transmitted. For example, the data packets with a smaller address range are numbered first, and the data packets with a larger address range are numbered later. Then, when receiving the data packets, the controller can splice and process them correctly according to the numbers.
[0085] Taking the UDS (Unified Diagnostic Services) transmission protocol as an example, the remote information processor establishes a connection with the controller according to the UDS protocol, encapsulates the first target sub-packet and the second target sub-packet into UDS data frames, and sends the UDS data frames to the controller. The target controller is upgraded through the first target sub-packet, and interactive verification is performed through the second target sub-packet, so that the transmission between the remote information processor and the controller meets the requirements of the UDS transmission protocol.
[0086] In an alternative embodiment, since strong interference on the CAN bus may cause a certain UDS data frame to be lost, resulting in a frame loss situation, the transmission process of the UDS protocol is adjusted in this embodiment. When a UDS data frame is lost, the remote information processor resends the lost frame to the controller from the position of the lost frame. Specifically, according to the improved UDS protocol, the controller feeds back the header of the lost frame and the remaining frame quantity to the remote information processor. Then, the remote information processor calculates the lost frame according to the remaining frame quantity and resends the data frame from the position of the lost frame. In addition, during the flashing process of the controller, after the controller receives and completes the flashing of each UDS data frame, it feeds back a success feedback message to the remote information processor. If the remote information processor does not receive the feedback message from the controller within a preset time period (for example, 500 ms), the current UDS data frame is resent. After three consecutive flashing failures, the remote information processor sends a sleep instruction to the controller to end the flashing process.
[0087] After the controller completes the flashing according to the first target sub-packet and the second target sub-data transmitted by the remote controller, the controller performs self-check on the updated program. If the self-check is successful, the controller sends a feedback message of successful update to the remote information processor and enters the sleep state. If the self-check fails, the controller restores the failed updated program to the original version, sends a feedback message of failed update to the remote information processor, and enters the sleep state. Furthermore, the remote information processor uploads the feedback message returned by the controller to the server and feeds back the flashing result of the controller to the upgrade platform, so that the upgrade platform can record the upgrade result of the vehicle's on-board terminal.
[0088] In the above terminal upgrade method, first, an update data packet containing difference data, first address information, and second address information is obtained from the server. By adopting the differential update strategy and only transmitting the difference part between the original file and the updated file, the data transmission volume can be greatly reduced, the network bandwidth pressure and transmission time can be reduced, and the update efficiency can be improved. The update data packet is split according to a preset split length, and the first target sub-packet and the second target sub-packet are obtained through payload recombination based on the address information. The first target sub-packet is used for terminal upgrade and contains key difference data and first address information, which can accurately guide the target controller to perform data update. At the same time, the second target sub-packet only contains the second address information, ensuring that the message transmission in the terminal upgrade meets the requirements of the communication protocol and reducing the data transmission volume, thereby improving the efficiency of terminal upgrade.
[0089] In an exemplary embodiment, before the vehicle performs the on-board terminal upgrade, the vehicle needs to be in an upgrade-ready state that can perform the upgrade to prevent abnormal vehicle operation, such as Figure 3 As shown, after step 202, steps 302 to 304 are further included. Among them:
[0090] Step 302, feedback a terminal upgrade prompt on the front-end page.
[0091] In the embodiment of the present application, after the remote information processor completes the download of the update data packet and obtains the update data packet, the remote information processor displays a message of a terminal upgrade prompt on the front-end page (for example, the vehicle's dashboard), prompting the user to stop the vehicle operation and turn off the power to prepare for the upgrade process of the vehicle terminal.
[0092] Step 304, receive the voltage status information reported by the voltage sensor. If the voltage status information meets the preset voltage condition, execute the step of splitting the update data packet according to the preset split length.
[0093] In the embodiment of the present application, after the user stops the vehicle operation, the telematics processor establishes a communication connection with the voltage sensor and receives the voltage status information reported by the voltage sensor. The preset voltage condition is preset according to the requirements of vehicle terminal upgrade. Generally, it is required that the vehicle battery voltage be within a suitable range to ensure the stability and safety of the upgrade process. For example, the preset voltage condition can be set to the battery voltage between 12V and 14V. Taking the controller as the power domain controller as an example, when the telematics processor detects that the voltage status changes to low high voltage, it wakes up the power domain controller. Specifically, the telematics processor compares the voltage value in the voltage status information with the preset voltage condition. If the voltage value meets the preset voltage condition, it continues to execute the subsequent step of splitting the update data packet; if the voltage value does not meet the preset voltage condition, it waits for a period of time and then receives the information of the voltage sensor again for judgment, or feeds back a prompt message of voltage abnormality to the user. Optionally, after the telematics processor wakes up the power domain controller, the telematics processor and the power domain controller establish an encrypted interactive communication state to prevent the interference of malicious software flashing and communicate through the CAN bus to ensure the security and integrity of data transmission.
[0094] In this embodiment, by reminding the user to stop the vehicle operation and turn off the power, the interference and danger that may be caused by upgrading in the vehicle running state are avoided, and it is judged whether the voltage status information meets the preset voltage condition. Only when the voltage status information is in the preset voltage condition, the step of splitting the update data packet based on the preset splitting length is executed, ensuring the stability of the power environment required for terminal upgrade, and further ensuring the safety and stability of the in-vehicle terminal upgrade process.
[0095] In an exemplary embodiment, as Figure 4 shown, step 204 includes step 402 to step 406. Among them:
[0096] Step 402, match the address range corresponding to the initial sub-packet based on the first address information and the second address information to obtain a matching result.
[0097] In the embodiment of the present application, for each initial sub-packet, the telematics processor matches the address range corresponding to the initial sub-packet based on the first address information and the second address information to determine the address type included in the address range of each initial sub-packet, and obtains a matching result. For example, the initial sub-packet 1 includes address 1 (0x1000 - 0x13FF), the initial sub-packet 2 includes address 2 (0x1400 - 0x17FF), and the first address information is 0x1001 and the second address information is 0x1401. It means that the matching result corresponding to the initial sub-packet 1 is that the address range includes the first address information, and the matching result corresponding to the initial sub-packet 2 is that the address range includes the second address information.
[0098] Step 404. Determine the target data packet type corresponding to each initial sub-packet according to the matching result.
[0099] In the embodiment of the present application, the remote information processor divides the corresponding target data packet type for each initial sub-packet according to the matching result of each initial sub-packet. The target data packet type includes an update data type and a non-update data type. The update data type indicates that the initial sub-packet obtained by splitting according to the preset split length contains differential data; while the non-update data type indicates that the initial sub-packet after splitting only contains the same data.
[0100] Step 406. Recombine the payloads of the initial sub-packets based on the target data packet type to obtain a first target sub-packet and a second target sub-packet.
[0101] In the embodiment of the present application, the remote information processor performs targeted operations on each initial sub-packet according to the target sub-packet construction rule corresponding to the target data packet type. The target data packet type represents whether the target sub-packet contains differential data. For the update data type containing differential data, it is necessary to combine the differential data into the first target sub-packet and eliminate the payload in the second target sub-packet so that it does not carry payload data.
[0102] In this embodiment, the remote information processor can accurately identify the address type within the address range of each initial sub-packet by matching the address range of the initial sub-packet based on the first and second address information to obtain the matching result. Then, according to the matching result, the target data packet type is divided for each initial sub-packet, clearly distinguishing the update data type and the non-update data type, which helps to perform differential processing on the initial sub-packets containing differential data and only the same data subsequently. Finally, the payloads of the initial sub-packets are recombined according to the rules corresponding to the target data packet type to obtain the first and second target sub-packets. Especially for the update data type, the differential data can be combined into the first target sub-packet, the payload of the second target sub-packet is eliminated, the data transmission volume is reduced, the network bandwidth pressure and transmission time are reduced, and the update efficiency is improved.
[0103] In an exemplary embodiment, as Figure 5 shown, Step 404 includes Step 502 to Step 504. Among them:
[0104] Step 502. If the matching result is that the address range corresponding to the initial sub-packet includes the first address information, determine the target data packet type as the update data type.
[0105] In the embodiment of the present application, for each initial sub-packet, if the matching result of the address range of the initial sub-packet and the first address information and the second address information indicates that the address range corresponding to the initial sub-packet includes the first address information, it means that the initial sub-packet contains differential data. Then, the remote information processor determines the target packet type of the initial sub-packet as the update data type. The initial sub-packets of the update data type will perform operation payload recombination according to the rules related to updates during subsequent payload recombination, so as to ensure that the remote information processor can transmit the differential data to the controller, enabling the controller to rewrite the differential data.
[0106] Step 504, if the matching result is that the address range corresponding to the initial sub-packet only includes the second address information, determine the target packet type as the no-update data type.
[0107] In the embodiment of the present application, after determining that a certain initial sub-packet only contains identical data, the remote information processor will determine the target packet type of the initial sub-packet as the no-update data type. For the initial sub-packets of the no-update data type, different processing methods from those of the update data type can be adopted during subsequent payload recombination, enabling the remote information processing to perform storage more efficiently or simplify the transmission process, so as to improve the upgrade efficiency of the vehicle-mounted terminal.
[0108] In this embodiment, by dividing the target packet type of the initial value packet into the update data type and the no-update data type, it provides a basis for payload recombination for subsequent initial sub-packets of different target data types, making the target sub-packets after payload recombination more targeted in the process of upgrading the controller, improving the communication efficiency between the remote information processor and the controller, and ensuring that the communication process meets the requirements of the communication protocol.
[0109] In an exemplary embodiment, as Figure 6 shown, step 406 includes steps 602 to 606. Among them:
[0110] Step 602, for the initial sub-packets of the update data type, construct the first header information of the first target sub-packet based on the first address information.
[0111] In the embodiment of the present application, the telematics processor screens out the initial sub-packets with the target packet type being the update data type from multiple initial sub-packets. For example, the initial sub-packets include initial sub-packets 1-10, and through previous judgment, it is determined that initial sub-packets 3, 5, and 7 are of the update data type. For the initial sub-packets of the update data type, within the address range of the initial sub-packet, the telematics processor constructs the first header information of the first target sub-packet based on the first address information. The first header information may include metadata such as packet identification, data source, and data length. For example, the first address information is 0x2010, and the telematics processor will generate the first header information including specific identification and data length information according to the first address information 0x2010. The first header information serves as a "tag" to describe the basic characteristics of the subsequent payload data.
[0112] Optionally, the initial sub-packets of the update data type may contain part of the first address information and also part of the second address information. Then, the telematics processor splices the address range corresponding to the first address information with the address range of the second address information to construct the first header information of the first target sub-packet.
[0113] Step 604: Construct the payload data of the first target sub-packet according to the differential data corresponding to the first address information, and obtain the first target sub-packet containing the differential data after payload recombination.
[0114] In the embodiment of the present application, the telematics processor locates and extracts the corresponding differential data in the initial sub-packet according to the first address information. Taking initial sub-packet 3 as an example, the data pointed to by the first address information 0x2010 may be the differential data that has changed in different versions or different states. Then, the telematics processor extracts this part of the differential data from the initial sub-packet and uses the extracted differential data as the payload data of the first target sub-packet, so that the first target sub-packet contains the differential data after recombination. Furthermore, the first target sub-packet has a complete structure, including the first header information and the payload data, and can accurately carry the differential data to be updated.
[0115] Step 606: For the initial sub-packets without the update data type, construct the second header information of the second target sub-packet based on the second address information, and determine the payload data as blank data, to obtain the second target sub-packet containing an empty packet.
[0116] In the embodiment of the present application, for the initial sub-packet of the non-updated data type, the remote information processor constructs the second header information of the second target sub-packet based on the second address information. The second header information also contains necessary metadata, such as the second target sub-packet identifier, data source, etc., and has a difference identifier from the first header information to distinguish different types of target sub-packets. Since the initial sub-packet of the non-updated data type only contains the same data, when the remote information processor constructs the second target sub-packet, it determines its payload data as blank data. Furthermore, the second target sub-packet becomes a structure containing an empty packet, only carrying the second header information and not carrying the effective data that actually needs to be transmitted or processed.
[0117] In this embodiment, by reorganizing the payload of the initial sub-packet of the updated data type into the first target sub-packet containing the first header information and the differential data, and for the initial sub-packet of the non-updated data type, only constructing the second header information containing the second address information and filling the payload data with blank data, the processing overhead of the same data transmission can be reduced, and the upgrade efficiency of the in-vehicle terminal can be improved.
[0118] In an exemplary embodiment, as Figure 7 shown, a terminal upgrade method is provided. Taking the server in Figure 1 as an example, the method includes the following steps 702 to 704. Among them:
[0119] Step 702, perform data comparison on the original file and the updated file corresponding to the terminal to be upgraded, and determine the differential data between the original file and the updated file, the first address information corresponding to the differential data, and the second address information corresponding to the same data.
[0120] In the embodiment of the present application, by comparing the original file and the modified updated file corresponding to the terminal to be upgraded, the differential data and the same data are determined, and the differential data and its first address information in the file are stored in a trimmed bin file. Specifically, the server divides the original file and the modified updated file into units of 1 KB. For example, if the size of the original file is 10 KB, it is divided into 10 data blocks of 1 KB, and the modified updated file is also divided in the same principle.
[0121] The server compares the data blocks corresponding to the original file and the updated file respectively. When it is found that the data in a certain 1 KB data block is different in the original file and the updated file, record the starting address of the data block in the file and the content of the data block as the differential data, and then the starting address of the differential data is used as the first address information; the server records the data blocks with the same data content as the same data and records the second address information corresponding to the same data according to the same principle.
[0122] Step 704: Construct an update data packet based on the differential data, the first address information, and the second address information, and send the update data packet to the remote information processor.
[0123] In the embodiment of the present application, the server trims the update file according to the differential data, the first address information, and the second address information, trims the data block corresponding to the second address information into empty data, and retains the data block corresponding to the first address information, thereby constructing an update data packet containing the differential data, the first address information, and the second address information. Finally, the server sends the constructed update data packet to the remote information processor of the vehicle to be upgraded through the network.
[0124] In this embodiment, by comparing the original file and the update file, the differential data and the identical data are determined, and the update file is trimmed according to the first address information of the differential data and the second address information of the identical data to obtain an update data packet, so that the remote information processor only needs to download this trimmed update data packet. When performing UDS download, for the second target sub-packet corresponding to the second address information of the identical data, only interaction is performed between the remote information processor and the controller without actual writing operation, while for the first target sub-packet containing the differential data, the controller performs normal writing according to the payload data of the first target sub-packet, thereby reducing the sending and writing of a large amount of duplicate data, improving the writing efficiency, and further improving the terminal upgrade efficiency.
[0125] In a specific embodiment, an example of a terminal upgrade method is provided, as Figure 8 shown, including:
[0126] Step 801: The server sends an upgrade instruction to the remote information processor.
[0127] Step 802: The remote information processor responds to the upgrade instruction and downloads the update data packet.
[0128] Step 803: After the remote information processor completes the download of the update data packet, it sends feedback information indicating successful download to the server.
[0129] Step 804: After the remote information processor detects that the voltage state changes to low voltage, it wakes up the power domain controller.
[0130] Step 805: The remote information processor performs operations of splitting, verifying, and payload recombination on the update data packet to obtain a first target sub-packet and a second target sub-packet.
[0131] Step 806: The domain controller enters the Boot program, receives the first target sub-packet and the second target sub-packet transmitted by the remote information processor in the form of data frames, and performs flashing. After each data frame is flashed, a feedback message indicating successful flashing is sent back to the remote information processor.
[0132] Step 807: The remote information processor determines whether there are lost frames during the flashing process based on the feedback message. If there are lost frames, execute Step 808; if there are no lost frames, execute Step 809.
[0133] Step 808: The remote information processor resends the data frame from the position where the frame was lost until all data frames are transmitted.
[0134] Step 809: After the domain controller finishes flashing all data frames, it starts the program for completing the upgrade and performs self-check on the updated program. If the self-check is successful, execute Step 810; if the self-check fails, re-execute Step 806.
[0135] Step 810: The remote information processor uploads the feedback message returned by the controller to the server and feeds back the flashing result of the controller to the upgrade platform of the server.
[0136] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, there is no strict order limit for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0137] Based on the same inventive concept, the embodiments of the present application also provide a terminal upgrade device for implementing the terminal upgrade method described above. The implementation solutions provided by this device for solving problems are similar to the implementation solutions described in the above method. Therefore, the specific limitations in one or more embodiments of the terminal upgrade device provided below can refer to the limitations on the terminal upgrade method in the above text and will not be repeated here.
[0138] In an exemplary embodiment, as Figure 9 shown, a terminal upgrade device 900 is provided. This device 900 is applied to the remote information processor and includes: an acquisition module 901, a splitting module 902, and a sending module 903, where:
[0139] An acquisition module 901, configured to acquire an update data packet sent by a server; the update data packet includes difference data between an original file and an update file, first address information corresponding to the difference data, and second address information corresponding to identical data;
[0140] A splitting module 902, configured to split the update data packet based on a preset splitting length, and perform payload recombination on the initial sub-packets obtained after splitting according to the address range, first address information, and second address information corresponding to the initial sub-packets, to obtain a first target sub-packet and a second target sub-packet; the first target sub-packet includes the difference data after payload recombination, and the second target sub-packet is an empty data packet;
[0141] A sending module 903, configured to send the first target sub-packet and the second target sub-packet to a controller.
[0142] In one embodiment, the apparatus 900 further includes:
[0143] A feedback module, configured to feedback a terminal upgrade prompt on a front-end page;
[0144] A detection module, configured to receive voltage status information reported by a voltage sensor, and if the voltage status information meets a preset voltage condition, perform the step of splitting the update data packet based on a preset splitting length.
[0145] In one embodiment, the splitting module 902 is specifically configured to match the address range corresponding to the initial sub-packets based on the first address information and the second address information, to obtain a matching result;
[0146] Determine the target packet type corresponding to each initial sub-packet according to the matching result;
[0147] Perform payload recombination on the initial sub-packets based on the target packet type, to obtain a first target sub-packet and a second target sub-packet.
[0148] In one embodiment, the splitting module 902 is specifically configured to, if the matching result is that the address range corresponding to the initial sub-packet includes the first address information, determine the target packet type as an update data type;
[0149] If the matching result is that the address range corresponding to the initial sub-packet only includes the second address information, determine the target packet type as a no-update data type.
[0150] In one embodiment, the splitting module 902 is specifically configured to, for an initial sub-packet of the update data type, construct first header information of the first target sub-packet based on the first address information;
[0151] Construct the payload data of the first target sub-packet according to the difference data corresponding to the first address information, and obtain the first target sub-packet containing the difference data after payload recombination;
[0152] For the initial sub-packet of the data type without update, construct the second header information of the second target sub-packet based on the second address information, and determine the payload data as blank data, so as to obtain the second target sub-packet containing an empty packet.
[0153] Each module in the above terminal upgrade device can be implemented in whole or in part by software, hardware and their combination. Each of the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0154] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as Figure 10 shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner. The wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, it implements a terminal upgrade method. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0155] Those skilled in the art can understand, Figure 10The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0156] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:
[0157] Obtain the update data packet sent by the server; the update data packet includes the difference data between the original file and the update file, the first address information corresponding to the difference data, and the second address information corresponding to the same data;
[0158] Split the update data packet based on a preset split length, and perform payload recombination on the initial sub-packets obtained after splitting according to the address range, the first address information, and the second address information corresponding to the initial sub-packets to obtain the first target sub-packet and the second target sub-packet; the first target sub-packet includes the difference data after payload recombination, and the second target sub-packet is an empty data packet;
[0159] Send the first target sub-packet and the second target sub-packet to the controller.
[0160] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0161] Feed back a terminal upgrade prompt on the front-end page;
[0162] Receive the voltage status information reported by the voltage sensor. If the voltage status information meets the preset voltage condition, execute the step of splitting the update data packet based on the preset split length.
[0163] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0164] Match the address range corresponding to the initial sub-packet based on the first address information and the second address information to obtain a matching result;
[0165] Determine the target data packet type corresponding to each initial sub-packet according to the matching result;
[0166] Recombine the payloads of the initial sub-packets based on the target data packet type to obtain the first target sub-packet and the second target sub-packet.
[0167] In one embodiment, when the processor executes the computer program, the following steps are further implemented:
[0168] If the matching result shows that the address range corresponding to the initial sub-packet includes the first address information, determine the target packet type as the updated data type;
[0169] If the matching result shows that the address range corresponding to the initial sub-packet only includes the second address information, determine the target packet type as the no-update data type.
[0170] In one embodiment, when the processor executes the computer program, the following steps are also implemented:
[0171] For the initial sub-packet of the updated data type, construct the first header information of the first target sub-packet based on the first address information;
[0172] Construct the payload data of the first target sub-packet according to the differential data corresponding to the first address information, and obtain the first target sub-packet containing the differential data after payload recombination;
[0173] For the initial sub-packet of the no-update data type, construct the second header information of the second target sub-packet based on the second address information, and determine the payload data as blank data, so as to obtain the second target sub-packet containing an empty packet.
[0174] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0175] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0176] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0177] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in this application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., without limitation.
[0178] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this application.
[0179] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation to the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A terminal upgrade method, characterized in that: The method is applied to a telematics processor, and the method comprises: Obtain an update data packet sent by the server; the update data packet includes difference data between the original file and the update file, first address information corresponding to the difference data, and second address information corresponding to the same data; The update data packet is split based on a preset split length, and the initial sub-data packet is reassembled according to the address range corresponding to the initial sub-data packet obtained after the splitting, the first address information and the second address information, so as to obtain a first target sub-data packet and a second target sub-data packet; the first target sub-data packet includes the difference data after the payload is reassembled, and the second target sub-data packet is an empty data packet; The first target sub-data packet and the second target sub-data packet are sent to a controller.
2. The method according to claim 1, characterized in that: After obtaining the update data packet sent by the server, the method further includes: Feedback terminal upgrade prompts on the front-end page; The voltage status information reported by the voltage sensor is received, and if the voltage status information satisfies a preset voltage condition, the step of splitting the update data packet based on a preset split length is executed.
3. The method according to claim 1, characterized in that The step of performing payload reorganization on the initial sub-data packet according to the address range corresponding to the initial sub-data packet obtained after splitting, the first address information, and the second address information to obtain a first target sub-data packet and a second target sub-data packet includes: Matching the address range corresponding to the initial sub-data packet based on the first address information and the second address information to obtain a matching result; Determine the target data packet type corresponding to each of the initial sub-data packets according to the matching result; The payload of the initial sub-data packet is reassembled based on the target data packet type to obtain a first target sub-data packet and a second target sub-data packet.
4. The method according to claim 3, characterized in that Determining the target data packet type corresponding to each of the initial sub-data packets according to the matching result includes: If the matching result is that the address range corresponding to the initial sub-data packet includes the first address information, determining the target data packet type as an update data type; If the matching result is that the address range corresponding to the initial sub-data packet only includes the second address information, the target data packet type is determined as a non-update data type.
5. The method according to claim 4, characterized in that The step of reorganizing the payload of the initial sub-data packet based on the target data packet type to obtain a first target sub-data packet and a second target sub-data packet includes: For the initial sub-data packet of the updated data type, constructing first header information of a first target sub-data packet based on the first address information; constructing the payload data of the first target sub-data packet according to the difference data corresponding to the first address information, and obtaining the first target sub-data packet including the difference data after the payload is reorganized; For the initial sub-data packet of the non-updated data type, second header information of a second target sub-data packet is constructed based on the second address information, and the payload data is determined as blank data to obtain a second target sub-data packet containing an empty data packet.
6. A terminal upgrade method, characterized in that: The method is applied to a server, and the method comprises: Performing data comparison on the original file and the update file corresponding to the terminal to be upgraded, determining difference data between the original file and the update file, first address information corresponding to the difference data, and second address information corresponding to the same data; An update data packet is constructed according to the difference data, the first address information and the second address information, and the update data packet is sent to the telematics processor.
7. A terminal upgrade device, characterized in that: The device is applied to a telematics processor, and comprises: An acquisition module, used to acquire an update data packet sent by a server; the update data packet includes difference data between an original file and an update file, first address information corresponding to the difference data, and second address information corresponding to the same data; a splitting module, configured to split the update data packet based on a preset splitting length, and reassemble the payload of the initial sub-data packet according to the address range corresponding to the initial sub-data packet obtained after the splitting, the first address information, and the second address information, to obtain a first target sub-data packet and a second target sub-data packet; the first target sub-data packet includes differential data after the payload is reassembled, and the second target sub-data packet is an empty data packet; A sending module is used to send the first target sub-data packet and the second target sub-data packet to a controller.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.