Data processing method, server, and terminal device

By creating a data string collection for the old file data of the target application, determining the retained and added data sets based on the data string length threshold, and generating patch files, solving the problem of too large patch files in differential restore technology, and achieving the effect of reducing download traffic and upgrade time.

WO2025148943A1PCT designated stage expired Publication Date: 2025-07-17ZHEJIANG ZEEKR INTELLIGENT TECH CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/071337
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-20
Filing Date
2025-01-08
Publication Date
2025-07-17

AI Technical Summary

Technical Problem

Differential restoration technology leads to a large amount of patch file data in the upgrade of electronic device software, increasing download traffic and storage space, affecting the upgrade efficiency.

Method used

Create a data string collection for the old file data applied to the target and determine the reserved data set and the new data set based on the preset data string length threshold, generate patch files, reduce the size of the reserved data and new data, and compress the size of the patch file.

Benefits of technology

Reduces the traffic of terminal devices to download patch files and shortens the upgrade time of target applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025071337_17072025_PF_FP_ABST
    Figure CN2025071337_17072025_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a data processing method, a server, and a terminal device. The method comprises: creating a data string set for old file data of a target application, and, on the basis of the data string set and a preset data string length threshold, obtaining a reserved data set and a newly added data set of new file data of the target application compared with the old file data; and generating a patch file of the target application on the basis of related information of at least one item of reserved data in the reserved data set and position information in the new file data of at least one item of newly added data in the newly added data set, the patch file being used for performing data updating on the target application. In the described method, the data string length threshold is set for the length of reserved data, thus the amount of reserved data and the size of newly added data can be reduced so that the size of the patch file is compressed, the flow rate of the terminal device downloading the patch file can be reduced, and the upgrading time of the target application is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Data processing method, server and terminal device

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on January 8, 2024, with application number 202410030592.5 and application name “Firmware upgrade processing method, device, equipment and storage medium”, all contents of which are incorporated by reference into this application.

[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on May 23, 2024, with application number 202410649045.5 and application name “A file downloading method, device and vehicle”, the entire contents of which are incorporated by reference into this application.

[0003] This application claims priority to the Chinese patent application filed with the China Patent Office on August 20, 2024, with application number 202411153163.3 and application name “Data processing method, server and terminal device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0004] The present application relates to the field of intelligent terminal technology, and in particular to a data processing method, a server, and a terminal device. Background Art

[0005] Differential restoration technology is used in software upgrades for electronic devices. It includes a differential algorithm and a restoration algorithm. The server uses the differential algorithm to obtain the difference data between the pre-upgraded and upgraded software. The client terminal uses the restoration algorithm and the difference data to upgrade the pre-upgraded software.

[0006] When executing the differential algorithm, a large amount of differential data is usually obtained, resulting in a large amount of patch file data for software upgrades. This will increase the traffic required by the client terminal to download the differential data, increase the download time and increase the storage space occupied, etc., which is not conducive to the client terminal upgrading the non-upgraded software.

[0007] Therefore, how to reduce the patch file size as much as possible through differential algorithms is a problem that needs to be solved urgently. Summary of the Invention

[0008] The present application provides a data processing method, a server, and a terminal device. By setting a data string length threshold for the retained data length, the amount of retained data and the size of newly added data can be reduced to compress the size of the patch file, which can reduce the traffic of the terminal device downloading the patch file and shorten the upgrade time for the target application.

[0009] A first aspect of the present application provides a data processing method, which is applied to a server, and the method includes: receiving a first file update request from a first device, the first file update request including first new file data of a first target application; obtaining first old file data corresponding to the first new file data, and a first data string set, the first data string set being data strings of different lengths created based on the first old file data and the first new file data; determining, based on the first data string set and a preset data string length threshold, a retained data set and a newly added data set of the first new file data compared to the first old file data, the retained data set including at least one retained data, the newly added data set including at least one newly added data, and the data length of each retained data being greater than the data string length threshold; generating a patch file for the first new file data based on the data length of the at least one retained data, the position information of the at least one newly added data in the first new file data, and the position information of the at least one retained data in the first new file data and the first old file data respectively, the patch file being used to update data of the first target application.

[0010] In some embodiments of the first aspect, based on the first data string set and a preset data string length threshold, determining the retained data set and the newly added data set of the first new file data compared to the first old file data includes: starting from the first byte of the first new file data, searching for the longest data string starting with the first byte in the first data string set; determining whether to take the longest data string as a retained data by comparing the length of the longest data string with the data string length threshold; obtaining the retained data set after traversing all bytes of the first new file data; and determining the newly added data set based on the position of the retained data in the retained data set in the first new file data.

[0011] In some embodiments of the first aspect, by comparing the length of the longest data string with a data string length threshold, determining whether to treat the longest data string as a retained data item includes: if the length of the longest data string is greater than the data string length threshold, determining that the longest data string is a retained data item, and starting from the target byte of the first new file data, searching in the first data string set whether there is a longest data string starting with the target byte, wherein the target byte is the byte determined by adding the length of the longest data string starting from the first byte to the first byte; if the length of the longest data string is less than or equal to the data string length threshold, starting from the byte next to the first byte, continuing to search in the first data string set whether there is a longest data string starting with the next byte.

[0012] In some embodiments of the first aspect, according to a preset data volume threshold, the first new file data and the first old file data are respectively split to obtain N pairs of new and old file data blocks, where N is a positive integer greater than 1 and less than or equal to M, and M is the maximum number of processing threads executed in parallel; N first processing threads are created, and the N first processing threads correspond one-to-one to the N pairs of new and old file data blocks; data comparison of the N pairs of new and old file data blocks is performed in parallel by the N first processing threads to obtain patch files of N pairs of new and old file data blocks; based on the patch files of the N pairs of new and old file data blocks, a patch file of the first new file data is generated.

[0013] In some embodiments of the first aspect, the method also includes: calling a preset algorithm library through the first application thread of the first target application to initialize preset parameters, the preset parameters including a data volume threshold and M; creating a first management thread through the first application thread according to the first file update request; performing data segmentation on the first new file data and the first old file data according to the preset data volume threshold, respectively, to obtain N pairs of new and old file data blocks, including: executing the step of performing data segmentation on the first new file data and the first old file data according to the preset data volume threshold, respectively, to obtain N pairs of new and old file data blocks through the first management thread; creating N first processing threads, including: creating N first processing threads through the first management thread; generating a patch file for new file data according to the patch files of the N pairs of new and old file data blocks, including: executing the step of generating a patch file for the first new file data according to the patch files of the N pairs of new and old file data blocks through the first management thread.

[0014] In some embodiments of the first aspect, the first application thread is also used to write information of N first processing threads corresponding to the first file update request in the first storage space; the first management thread is also used to delete the information of N first processing threads after generating a patch file for the first new file data; when the first application thread writes data in the first storage space, the first management thread is prohibited from deleting data in the first storage space.

[0015] In some embodiments of the first aspect, the first processing thread is used to write the processing status and / or processing progress of the first processing thread in the second storage space, and the first management thread is used to read the processing status and / or processing progress of the first processing thread from the second storage space; when the first processing thread writes data in the second storage space, the first management thread is prohibited from reading data in the second storage space.

[0016] In some embodiments of the first aspect, if the first file update request includes first new file data and second new file data of the first target application, the first new file data and the second new file data both correspond to first old file data; creating a first management thread through the first application thread includes: creating two first management threads through the first application; when one of the two first management threads reads the first old file data, prohibiting the other first management thread of the two first management threads from reading the first old file data.

[0017] In some embodiments of the first aspect, while receiving the first file update request, a second file update request is received from the first device, the second file update request including third new file data of the second target application; based on the second file update request, a second application thread of the second target application is created, the second application thread is used to initialize preset parameters by calling a preset algorithm library; a second management thread is created through the second application thread; when the first application thread calls the preset algorithm library, the second application thread is prohibited from calling the preset algorithm library.

[0018] In some embodiments of the first aspect, the method further includes: receiving an upgrade request from the second device, the upgrade request being used to request an upgrade of the first target application; obtaining a patch file of the first target application in response to the upgrade request; and sending an upgrade response to the second device, the upgrade response including the patch file of the first target application.

[0019] A second aspect of the present application also provides a data processing method, which is applied to a terminal device, and the method includes: receiving an upgrade response from a server, the upgrade response including a patch file of a first target application; reading at least one retained data from the first old file data based on the position information of at least one retained data of the patch file in the first old file data, and the data length of at least one retained data; reading new data of the same length as the interval length and the position information of at least one retained data in the first new file data from the patch file based on the interval length between adjacent retained data in the at least one retained data; generating the first new file data of the first target application based on the new data, the position information of at least one retained data in the first new file data, and at least one retained data block.

[0020] In some embodiments of the second aspect, after receiving an upgrade response from the server, it also includes: in response to receiving an upgrade task, creating at least one upgrade process corresponding to the upgrade task, wherein the upgrade process corresponds to the firmware to be upgraded; obtaining the occupancy of at least one type of resource of the firmware to be upgraded and a first threshold corresponding to at least one type of resource; if the occupancy of at least one type of resource is greater than the corresponding first threshold, pausing the upgrade process corresponding to the firmware to be upgraded.

[0021] In some embodiments of the second aspect, after pausing the upgrade process corresponding to the firmware to be upgraded if the occupancy of at least one type of resource is greater than the corresponding first threshold, it also includes: if the occupancy of each type of resource of the firmware to be upgraded is less than the corresponding second threshold, continuing the upgrade process corresponding to the firmware to be upgraded.

[0022] In some embodiments of the second aspect, after obtaining the occupancy of at least one type of resource of the firmware to be upgraded and the first threshold corresponding to at least one type of resource, it also includes: if the occupancy of at least one type of resource of the firmware to be upgraded is greater than the corresponding first threshold, obtaining the first process running in the firmware to be upgraded; determining the priority of each first process; determining the process to be terminated based on the priority of each first process; and terminating the process to be terminated.

[0023] In some embodiments of the second aspect, determining the priority of each first process includes: obtaining the final response time, current time and preset priority score corresponding to each first process; calculating the time difference between the final response time and current time corresponding to the target first process, where the target first process is any first process; determining the minimum and maximum values ​​of the preset priority scores corresponding to each first process as input parameters; writing the input parameters into a preset formula template to obtain a priority calculation formula; inputting the preset priority score and time difference corresponding to the target first process into the priority calculation formula to obtain the priority corresponding to the target first process.

[0024] In some embodiments of the second aspect, in response to receiving an upgrade task, after creating at least one upgrade process corresponding to the upgrade task, it also includes: obtaining a second process running in the firmware to be upgraded; if the second process corresponding to the firmware to be upgraded includes the target process corresponding to the firmware to be upgraded, pausing the upgrade process corresponding to the firmware to be upgraded.

[0025] In some embodiments of the second aspect, after pausing the upgrade process corresponding to the firmware to be upgraded, the method further includes: if the target process is in a stopped state, continuing the upgrade process corresponding to the firmware to be upgraded.

[0026] In some embodiments of the second aspect, after creating at least one upgrade process corresponding to the upgrade task in response to receiving the upgrade task, it also includes: obtaining the running applications; if the running applications include the target application, determining the firmware to be suspended corresponding to the target application; and suspending the upgrade process corresponding to the firmware to be suspended.

[0027] In some embodiments of the second aspect, after receiving an upgrade response from the server, it also includes: setting priority usage rules for multiple downloaders; in response to a download instruction to download a target file, selecting at least one target downloader from multiple downloaders according to a preset identifier of the target file and the priority usage rules of multiple downloaders; determining an expected download bandwidth in at least one target downloader based on the network bandwidth of each node in the distributed network where the multiple downloaders are located; and downloading the target file through the at least one target downloader using the expected download bandwidth.

[0028] In some embodiments of the second aspect, the multiple downloaders include a first downloader, a second downloader, and a third downloader; setting priority usage rules for the multiple downloaders includes: a first priority usage rule: using the first downloader; a second priority usage rule: using the second downloader and the third downloader at the same time; a third priority usage rule: only using the second downloader; and a fourth priority usage rule: only using the third downloader.

[0029] In some embodiments of the second aspect, determining the expected download bandwidth in at least one target downloader includes: determining the communication network bandwidth for the communication network in the in-vehicle network to which the vehicle is connected, the first Ethernet bandwidth for the Ethernet between the first downloader and the gateway, the second Ethernet bandwidth for the Ethernet between the gateway and the second downloader, and the third Ethernet bandwidth for the Ethernet between the gateway and the third downloader; when the first downloader is selected as the target downloader, the communication network bandwidth is determined as the first expected download bandwidth; when the second downloader is selected as the target downloader, the smallest one among the communication network bandwidth, the first Ethernet bandwidth and the second Ethernet bandwidth is determined as the second expected download bandwidth; when the third downloader is selected as the target downloader, the smallest one among the communication network bandwidth, the first Ethernet bandwidth and the third Ethernet bandwidth is determined as the third expected download bandwidth; wherein, the first downloader includes a telematics processor downloader, the second downloader includes a cockpit domain controller downloader, and the third downloader includes a driving domain controller downloader.

[0030] In some embodiments of the second aspect, downloading a target file using an expected download bandwidth through at least one target downloader includes: if the target file can be downloaded using a first downloader, determining the first downloader as the target downloader, and using the first expected download bandwidth to download the target file; if the target file cannot be downloaded using the first downloader, but can be downloaded using a second downloader and a third downloader, and the third Ethernet bandwidth is determined to be the third expected download bandwidth, determining the second downloader and the third downloader as the target downloaders, determining the difference between the smaller of the communication network bandwidth and the first Ethernet bandwidth and the second expected download bandwidth as the auxiliary download bandwidth, and selecting the second downloader to download the target file using the second expected download bandwidth, and simultaneously selecting the third downloader to download the target file using the auxiliary download bandwidth.

[0031] In some embodiments of the second aspect, downloading the target file using the expected download bandwidth through at least one target downloader also includes: if the target file cannot be downloaded using the first downloader and the third downloader, but can be downloaded using the second downloader, or the target file cannot be downloaded using the first downloader, but can be downloaded using the second downloader and the third downloader, and any one of the communication network bandwidth and the first Ethernet bandwidth is determined to be the third expected download bandwidth, then the second downloader is determined as the target downloader, and the second expected download bandwidth is used to download the target file.

[0032] In some embodiments of the second aspect, downloading the target file using the expected download bandwidth through at least one target downloader also includes: if the target file cannot be downloaded using the first downloader and the second downloader, but can be downloaded using a third downloader, determining the third downloader as the target downloader, and downloading the target file using the third expected download bandwidth.

[0033] In some embodiments of the second aspect, downloading a target file using an expected download bandwidth through at least one target downloader also includes: periodically determining a first expected download bandwidth, a second expected download bandwidth, a third expected download bandwidth, and a download rate of the target file based on a preset time period; or dynamically determining the first expected download bandwidth, the second expected download bandwidth, the third expected download bandwidth, and the download rate of the target file based on the current connection status of the vehicle network.

[0034] In some embodiments of the second aspect, after downloading the target file using the expected download bandwidth through at least one target downloader, the method also includes: if the in-vehicle network is disconnected, controlling multiple downloaders to suspend downloading; if the in-vehicle network is restored, determining the updated expected download bandwidth of at least one target downloader, and downloading the target file through the target downloader using the updated expected download bandwidth.

[0035] The third aspect of the present application also provides a data processing device, which is applied to a server, including: a request receiving module, used to receive a first file update request from a first device, the first file update request including first new file data of a first target application; a data acquisition module, used to obtain first old file data corresponding to the first new file data, and a first data string set, the first data string set being data strings of different lengths created based on the first old file data and the first new file data; a data determination module, used to determine, based on the first data string set and a preset data string length threshold, a retained data set and a newly added data set of the first new file data compared to the first old file data, the retained data set including at least one retained data, the newly added data set including at least one newly added data, and the data length of each retained data being greater than the data string length threshold; a file generation module, used to generate a patch file for the first new file data based on the data length of at least one retained data, the position information of at least one newly added data in the first new file data, and the position information of at least one retained data in the first new file data and the first old file data respectively, the patch file being used to update data of the first target application.

[0036] The fourth aspect of the present application also provides a data processing device, which is applied to a terminal device, including: a response receiving module, used to receive an upgrade response from a server, the upgrade response including a patch file of a first target application; a retained data reading module, used to read at least one retained data from the first old file data based on the position information of at least one retained data of the patch file in the first old file data, and the data length of at least one retained data; a new data reading module, used to read new data of the same length as the interval length between adjacent retained data in the at least one retained data from the patch file, and the position information of at least one retained data in the first new file data; a file data generation module, used to generate the first new file data of the first target application based on the new data, the position information of at least one retained data in the first new file data, and at least one retained data block.

[0037] The fifth aspect of the present application also provides a vehicle, comprising the data processing device described in the fourth aspect.

[0038] In a sixth aspect, the present application further provides a server, comprising: a processor and a memory; the memory is coupled to the processor, the memory is used to store computer program code, and the processor calls the computer program code to enable the server to execute the method described in the first aspect.

[0039] The seventh aspect of the present application also provides a terminal device, including: a processor and a memory; the memory is coupled to the processor, the memory is used to store computer program code, and the processor calls the computer program code to enable the terminal device to execute the method described in the second aspect.

[0040] In an eighth aspect, the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the data processing method described in the first or second aspect.

[0041] The present application provides a data processing method, server, and terminal device, the method comprising: creating a data string set for the old file data of a target application; obtaining a retained data set and a newly added data set of the new file data of the target application compared to the old file data based on the data string set and a preset data string length threshold; generating a patch file for the target application based on the relevant information of at least one piece of retained data in the retained data set and the position information of at least one piece of newly added data in the newly added data set within the new file data, for updating the data of the target application. In the above method, by setting a data string length threshold for the length of the retained data, the amount of retained data and the size of the newly added data can be reduced, thereby compressing the size of the patch file, reducing the traffic flow of the terminal device downloading the patch file, and shortening the upgrade time for the target application. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] FIG1 is a schematic diagram of an application scenario of a data processing method provided by an embodiment of the present application;

[0043] FIG2 is a flow chart of a data processing method according to an embodiment of the present application;

[0044] FIG3 is a schematic diagram of another application scenario of the data processing method provided in one embodiment of the present application;

[0045] FIG4 is another flowchart of a data processing method according to an embodiment of the present application;

[0046] FIG5 is a schematic diagram of another application scenario of the data processing method provided in one embodiment of the present application;

[0047] FIG6 is another flowchart of a data processing method provided in an embodiment of the present application;

[0048] FIG7 is a schematic diagram of a multi-threaded scenario of a data processing method provided by an embodiment of the present application;

[0049] FIG8 is a schematic diagram of an application scenario of a data processing method provided by yet another embodiment of the present application;

[0050] FIG9 is a flow chart of a data processing method provided by another embodiment of the present application;

[0051] FIG10 is another flowchart of a data processing method provided in another embodiment of the present application;

[0052] FIG11 is a schematic diagram of another application scenario of a data processing method provided by yet another embodiment of the present application;

[0053] FIG12 is a schematic diagram of another application scenario of the data processing method provided in yet another embodiment of the present application;

[0054] FIG13 is another flow chart of the data processing method provided in an embodiment of the present application;

[0055] FIG14 is a schematic diagram of a modular processing process of a data processing method provided in an embodiment of the present application;

[0056] FIG15 is another flow chart of the data processing method provided in an embodiment of the present application;

[0057] FIG16 is a schematic structural diagram of an embodiment of a data processing device for the data processing method provided by the present application;

[0058] FIG17 is a schematic structural diagram of another embodiment of a data processing device for the data processing method provided by the present application;

[0059] FIG18 is a schematic diagram of the structure of a server provided by the present application;

[0060] FIG19 is a schematic structural diagram of a terminal device provided in this application. DETAILED DESCRIPTION

[0061] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0062] The terms "first," "second," and the like used in this application are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. In the description of the following embodiments, "plurality" means more than two, unless otherwise specifically defined.

[0063] It should be noted that in this article, step codes such as S1 and S2 are used for the purpose of expressing the corresponding content more clearly and concisely, and do not constitute a substantial restriction on the order. When implementing the step, those skilled in the art may execute S2 first and then S1, etc., but these should all be within the scope of protection of this application.

[0064] It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.

[0065] Differential restoration technology is used in software upgrades for electronic devices. It includes a differential algorithm and a restoration algorithm. The server uses the differential algorithm to obtain the difference data between the pre-upgraded and upgraded software. The client terminal uses the restoration algorithm and the difference data to upgrade the pre-upgraded software.

[0066] When executing the differential algorithm, a large amount of differential data is usually obtained, resulting in a large amount of patch file data for software upgrades. This will increase the traffic required by the client terminal to download the differential data, increase the download time and increase the storage space occupied, etc., which is not conducive to the client terminal upgrading the non-upgraded software.

[0067] Therefore, how to reduce the patch file size as much as possible through differential algorithms is a problem that needs to be solved urgently.

[0068] In view of this, the present application provides a data processing method, server, terminal device, storage medium, chip system and program product. By creating a data string set for the old file data of the target application, based on the data string set and a preset data string length threshold, the retained data set and the newly added data set of the new file data of the target application compared with the old file data can be obtained. Based on the relevant information of at least one piece of retained data in the retained data set and the position information of at least one piece of newly added data in the newly added data set in the new file data, a patch file for the target application is generated for updating the data of the target application. In the above method, by setting a data string length threshold for the retained data length, the amount of retained data and the size of the newly added data can be reduced to compress the size of the patch file, which can reduce the traffic of the terminal device downloading the patch file and shorten the upgrade time for the target application.

[0069] Please refer to Figure 1, which is an application scenario diagram of the data processing method of the present application. The application scenario includes a server 10, a first device 20 and a second device 30. The server 10 receives a file update request from the first device 20, and the file update request includes new file data of the target application (Application, APP) (the new file data is the upgraded target application data), obtains the old file data (the old file data is the non-upgraded target application data), and then generates a patch file according to the data processing method of the present application. The content of the patch file includes the newly added data in the newly added data set and the relevant information of the retained data in the retained data set. The relevant information includes the data length of the retained data and the location information of the retained data in the new file data and the old file data respectively.

[0070] The server 10 receives the upgrade request from the second device 30 and sends the patch file to the second device 30 . The second device 30 upgrades the target application deployed on the second device 30 according to the patch file.

[0071] In some embodiments, the first device is a device terminal for developing new file data and / or old file data of a target application, and includes a tablet computer and a desktop computer.

[0072] In some embodiments, the second device includes a user device such as a vehicle, a drone, a smart watch, a mobile phone, and a tablet computer.

[0073] It should be noted that Figure 1 is only a schematic diagram of an application scenario provided by an embodiment of the present application. The embodiment of the present application does not limit the actual form of the various devices included in Figure 1, nor does it limit the interaction method between the devices in Figure 1. In the specific application of the solution, it can be set according to actual needs.

[0074] The following describes in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems using specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0075] Figure 2 is a flow chart of an embodiment of the data processing method provided by the present application. The execution subject of the embodiment of the present application can be a server. The method in this embodiment can be implemented by software, hardware, or a combination of software and hardware. As shown in Figure 2, the data processing method can include the following steps:

[0076] Step S110: Receive a first file update request from a first device.

[0077] The first file update request includes first new file data of a first target application. The first target application includes a navigation and mapping application, an entertainment application, a communication application, an intelligent driving assistance application, or a parking or charging application. The first new file data is updated (including an upgrade) data of the first target application.

[0078] It is understandable that in order to upgrade the first target application, after the R&D personnel develop the first new file data of the first target application, they generate a first file update request through the first device to send the first new file data to the server.

[0079] Step S120: Acquire the first old file data corresponding to the first new file data and the first data string set.

[0080] The first old file data and the first data string set can be obtained from a storage device of the server. The first old file data can be the first target application data before the update. The first data string set is data strings of different lengths created based on the first old file data and the first new file data. The data strings of different lengths are sorted in ascending order of length and stored in the first data string set for use in determining retained data in subsequent steps. In some embodiments, the first data string set can also be described as a suffix array, and the data strings can also be described as byte strings.

[0081] For example, as shown in FIG5 , the first new file data includes "abcde". Based on the differential algorithm, data strings of different lengths starting with "a" can be found in the first old file data, such as "a", "abc", "a", and "abcd" in FIG5 . Similarly, data strings of different lengths starting with "b", "c", "d", or "e" can also be found in the first old file data.

[0082] Step S130 : Determine a retained data set and a newly added data set of the first new file data compared to the first old file data according to the first data string set and a preset data string length threshold.

[0083] Specifically, a byte in the first new file data is selected, and a data string starting with the byte is read from the first data string set. The data string is compared with a preset data string length threshold, and the data string longer than the data string length threshold is selected as a piece of retained data. For example, as shown in FIG5 , the retained data is data present in both the first new file data and the first old file data. The first new file data may contain the same retained data as the first old file data, or a subset of the retained data in the first old file data. Typically, the retained data set includes at least one piece of retained data.

[0084] 3 , the first new file data includes four pieces of retained data 1, 2, 3, and 4. The first old file data includes three pieces of retained data 1, 2, and 3, wherein retained data 3 includes retained data 4, that is, retained data 4 is a subset of retained data 3, and the data length of each piece of retained data is greater than the data string length threshold.

[0085] After determining multiple pieces of retained data, the newly added data between two adjacent pieces of retained data can be read. Since there are multiple pieces of retained data, a newly added data set including at least one piece of newly added data can be obtained. As shown in Figure 3, the newly added data set includes five newly added data pieces A, B, C, D, and E of the first new file data.

[0086] It should be understood that for new file data of the same size, if the data length of each retained data is greater than the data string length threshold, then the amount of retained data will be smaller (for example, part of the retained data can be reused, such as retained data 3 and retained data 4 in Figure 3), and the amount of new data will also be smaller.

[0087] Step S140: Generate a patch file for the first new file data according to the data length of the at least one piece of retained data, the location information of the at least one piece of newly added data in the first new file data, and the location information of the at least one piece of retained data in the first new file data and the first old file data respectively.

[0088] The patch file is used to update the data of the first target application. For example, the first target application can be upgraded according to the patch file. The patch file includes relevant information of the newly added data set and the retained data set. The relevant information of the retained data set includes the data length of the retained data and the location information of the retained data in the first new file data and the first old file data respectively. The location information includes the starting position. As shown in Figure 3, the patch file includes relevant information of 3 retained data and 5 newly added data A, B, C, D and E of the first new file data. For example, the relevant information of retained data 2 includes the starting position of retained data 2 in the first new file data, the starting position of retained data 2 in the first old file data and the data length of retained data 2.

[0089] It can be understood that the longer each piece of retained data is, the smaller the overall amount of retained data is, the smaller the newly added data determined between adjacent retained data blocks is, and the smaller the patch file is. Therefore, by setting the data string length threshold, the longest retained data can be found in the old file data as much as possible, and ultimately the purpose of compressing the patch file is achieved.

[0090] Please refer to Figure 1 again. In one application scenario, the server 10 receives a file update request from the first device 20. The file update request includes new file data of the intelligent driving assistance application, obtains the old file data of the intelligent driving assistance application, and a data string set. Then, based on the data string set and the preset data string length threshold, the retained data set and the newly added data set of the new file data compared to the old file data are determined. Finally, based on the data length of at least one retained data, the location information of at least one newly added data in the new file data, and the location information of at least one retained data in the new file data and the old file data of the intelligent driving assistance application, a patch file for the new file data is generated.

[0091] The server 10 receives the upgrade request from the vehicle 30 and sends the patch file to the vehicle 30 . The vehicle 30 upgrades the intelligent driving assistance application deployed in the vehicle 30 according to the patch file.

[0092] In the above technical solution, the server receives a first file update request from the first device, and can obtain the first old file data corresponding to the first new file data, as well as the first data string set. Then, based on the first data string set and the preset data string length threshold, the retained data set and the newly added data set of the first new file data compared to the first old file data can be determined. Among them, the retained data length of the retained data set is greater than the data string length threshold, which can reduce the size of the newly added data in the newly added data set and the number of retained data in the retained data set. Finally, based on the data length of at least one retained data, the position information of at least one newly added data in the first new file data, and the position information of at least one retained data in the first new file data and the first old file data, respectively, a patch file for the first new file data is generated. By setting a data string length threshold for the retained data length, the number of retained data and the size of the newly added data can be reduced to compress the size of the patch file, which can reduce the traffic of the terminal device downloading the patch file and shorten the upgrade time for the target application.

[0093] In some embodiments, referring to FIG4 , the data processing method further includes the following steps:

[0094] Step S210: Receive an upgrade request from the second device.

[0095] The upgrade request is used to request an upgrade of the first target application. When the second device detects that the first target application needs to be upgraded, it generates an upgrade request and sends it to the server.

[0096] Step S220: In response to the upgrade request, obtain a patch file of the first target application.

[0097] In response to the upgrade request, the server obtains a patch file of the first target application obtained according to the first new file data and the first old file data from the storage device.

[0098] Step S230: Send an upgrade response to the second device.

[0099] The server sends an upgrade response including the patch file of the first target application to the second device.

[0100] In some embodiments, determining the retained data set and the newly added data set of the first new file data compared to the first old file data based on the first data string set and a preset data string length threshold includes the following steps:

[0101] Step S310: Starting from the first byte of the first new file data, search the first data string set for the longest data string starting with the first byte.

[0102] Step S320: By comparing the length of the longest data string with the data string length threshold, determine whether to treat the longest data string as a retained data.

[0103] Specifically, if the length of the longest data string is greater than the data string length threshold, the longest data string is determined to be a retained data item. If the length of the longest data string is less than or equal to the data string length threshold, starting from the byte after the first byte, the first data string set is searched for a longest data string starting with the next byte.

[0104] Step S330: After traversing all bytes of the first new file data, a reserved data set is obtained.

[0105] Steps S310 to S330 are further explained through steps a1 to a3 of the following examples.

[0106] For example, the data string length threshold is 12 bytes. The server performs the following steps:

[0107] Step a1: Starting from the first byte of the first new file data, search the first data string set for the longest data string starting with the first byte.

[0108] Step a2: If the length of the longest data string, Len, is greater than 12 bytes, the longest data string is retained, and relevant information about the retained data is recorded. Starting from the Len+1th byte of the first new file data, the first data string set is searched for the longest data string starting with the Len+1th byte, until all bytes of the first new file data are traversed.

[0109] Step a3: If the length of the longest data string Len is less than or equal to 12 bytes, starting from the second byte of the first new file data, continue searching the first data string set for the longest data string starting with the second byte until all bytes of the first new file data are traversed.

[0110] The following describes step S310 and step S320 with reference to the example in FIG5 .

[0111] For example, as shown in FIG5 , the first new file data includes "abcde...", where the first byte of the first new file data is "a". In one example, assume that the first data string set includes three data strings beginning with "a": "a," "abc," and "abcde." Starting from "a" in the first new file data, the longest data string beginning with "a" found in the first data string set is "abcde." If the data string length threshold is 4, and the length of the longest data string "abcde" exceeds the data string length threshold 4, then the longest data string "abcde" is retained. In another example, assume that the first data string set includes three data strings starting with "a", namely "a", "ab" and "abc". Starting from "a" of the first new file data, the longest data string starting with "a" can be found in the aforementioned first data string set as "abc". If the data string length threshold is 4, and the length of the longest data string "abc" is less than the data string length threshold 4, then "abc" is not retained as data. Starting from the second byte "b" of the first new file data, the longest data string starting with the second byte is searched in the first data string set (which may include a data string starting with "b"), and by comparing the length of the longest data string with the data string length threshold, it is determined whether to use the longest data string as a retained data.

[0112] Step S340: determining a new data set according to the position of the reserved data in the first new file data in the reserved data set.

[0113] In one embodiment, according to the position of the reserved data in the first new file data, the newly added data between two adjacent reserved data in the reserved data set is read to obtain the newly added data set.

[0114] It can be understood that starting from the first byte of the first new file data, the longest data string starting with the first byte is searched in the first data string set. By comparing the length of the longest data string with the data string length threshold, it is determined whether the longest data string should be regarded as a retained data item. According to the first byte search method, after traversing all bytes of the first new file data, a retained data set and related information of the retained data set are obtained. Based on the position of the retained data in the retained data set within the first new file data, the newly added data set can be determined. In this way, the differential processing of the first new file data and the first old file data is completed, and a patch file can be generated based on the related information of the retained data set and the newly added data set.

[0115] In some embodiments, when a server performs differential processing on a pair of new file data and old file data to generate a patch file, the server may use multithreading to parallelly process multiple new and old file data blocks generated from the pair of new file data and old file data to increase the differential processing speed. This data processing method is described using the processing of the first new file data and the first old file data as an example. Specifically, referring to Figures 6 and 7 , the data processing method further includes the following steps:

[0116] Step S410: Initializing preset parameters by calling a preset algorithm library through a first application thread of a first target application.

[0117] The preset algorithm library stores differencing algorithms and defines an operating system-independent interface for the differencing algorithms, allowing them to adapt to different operating systems. The first application thread invokes the differencing algorithm through the independent interface and initializes preset parameters. These parameters include a data volume threshold and the maximum number M of parallel processing threads. The data volume threshold refers to the size threshold of the new and old file data blocks.

[0118] It is understood that after obtaining the sizes of a pair of new file data and old file data, by presetting the size thresholds of the new and old file data blocks and the maximum number M of processing threads to be executed in parallel, indicator parameters such as the sizes of the new and old file data blocks and the number of first processing threads can be controlled. The staff can control the indicator parameters by modifying the preset parameters.

[0119] Step S420: creating a first management thread through the first application thread according to the first file update request.

[0120] After receiving the first file update request, the server creates a first management thread via the first application thread. The first management thread is configured to segment the first new file data and the first old file data based on a preset data volume threshold, generating N pairs of new and old file data blocks. N is a positive integer greater than 1 and less than or equal to M. As shown in FIG8 , the first file data and the first old file data can be segmented into at least three pairs of new and old file data blocks. Each pair of new and old file data blocks includes a new file data block and an old file data block.

[0121] Step S430: Create N first processing threads through the first management thread. The N first processing threads correspond one-to-one to N pairs of new and old file data blocks.

[0122] It can be understood that the first management thread divides a pair of new file data and old file data according to a preset data volume threshold, resulting in N pairs of new and old file data blocks. N first processing threads are then created for each of the N pairs of new and old file data blocks. These N first processing threads simultaneously process the N pairs of new and old file data blocks, thereby enabling parallel processing of the N pairs of new and old file data blocks and shortening the differential processing time for the new and old file data pair. Furthermore, by adjusting the maximum number M of processing threads executed in parallel, the number of threads processed in parallel can be adjusted, effectively adjusting the differential processing time.

[0123] Step S440: using N first processing threads to perform data comparison on N pairs of new and old file data blocks in parallel, to obtain patch files for the N pairs of new and old file data blocks.

[0124] Each first processing thread independently reads a new and old file data block into memory, performs data comparison, and obtains a piece of patch information corresponding to each new and old file data block. The specific method is consistent with the technical principles of steps S120 to S130 above, except that the differential processing objects of this embodiment are the new and old file data blocks, and the differential processing generates patch information. Specifically, the specific method and steps include:

[0125] Step b1: the first processing thread creates multiple suffixes for the old file data blocks of the new and old file data blocks.

[0126] Step b2: Arrange multiple suffixes in ascending order to obtain a suffix array.

[0127] Step b3: Starting from the first byte of the new file data block of the new and old file data blocks, search the suffix array for the longest data string starting with the first byte.

[0128] Step b4: If the length of the longest data string, Len, is greater than 12 bytes, the longest data string is retained, and relevant information about the retained data is recorded. Starting from the Len+1th byte of the new file data block, the suffix array is searched for the longest data string starting with the Len+1th byte until all bytes of the new file data block are traversed.

[0129] Step b5: If the length Len of the longest data string is less than or equal to 12 bytes, start from the second byte of the new file data block and continue searching the suffix array for the longest data string starting with the second byte until all bytes of the new file data block are traversed.

[0130] Step b6: Generate patch information based on the relevant information of the retained data and the newly added data between adjacent retained data.

[0131] For technical features not elaborated in detail in steps b1 to b6, please refer to steps S120 to S130 and their detailed steps.

[0132] Step S450: Generate a patch file for the first new file data according to the patch files of N pairs of new and old file data blocks through the first management thread.

[0133] A patch file can be obtained according to the N patch information corresponding to the N pairs of new and old file data blocks, thus completing the difference process of a pair of new file data and old file data.

[0134] In one embodiment, a pair of new file data and old file data are divided into multiple new and old file data blocks through a first management thread, and multiple first processing threads are created several times. Each time, the multiple first processing threads read several new and old file data blocks from the multiple new and old file data blocks into memory for differential processing. After generating patch information, the new and old file data blocks are deleted, thereby effectively reducing memory usage.

[0135] In some embodiments, multiple pairs of new file data and old file data can be processed in parallel to obtain multiple patch files corresponding to the multiple pairs of new file data and old file data. Please refer to Figure 7 again to illustrate the simultaneous processing of two pairs of new file data and old file data. The data processing method also includes:

[0136] Step S510: while receiving the first file update request, receiving a second file update request from the first device, the second file update request includes third new file data of the second target application.

[0137] The second target application has a function different from the first target application, and may also include a navigation and mapping application, an entertainment application, a communication application, an intelligent driving assistance application, or a parking or charging application. For example, the first target application is an intelligent driving assistance application, and the second target application is a communication application.

[0138] Step S520: creating a second application thread of a second target application according to the second file update request.

[0139] The second application thread is used to initialize preset parameters by calling a preset algorithm library.

[0140] Step S530: Create a second management thread through the second application thread.

[0141] Step S540: Create N second processing threads through the second management thread. The N second processing threads correspond one-to-one to N pairs of new and old file data blocks.

[0142] Step S550: using N second processing threads to perform data comparison on N pairs of new and old file data blocks in parallel, to obtain patch files for the N pairs of new and old file data blocks.

[0143] In some embodiments, during differential processing, if multiple application threads, multiple management threads, an application thread and a management thread, or a management thread and a processing thread simultaneously operate on the same data, the thread that operates first acquires a mutex lock to prevent data reading functions between threads from being disrupted. Specifically, referring to FIG9 , the data processing method further includes the following steps:

[0144] Step S610: When the first application thread writes data in the first storage space, the first management thread is prohibited from deleting data in the first storage space.

[0145] Specifically, the first storage space is used to store information of the differential processing process, including information of N first processing threads generated based on the first file update request. During the differential processing process, according to the first file update request, the first application thread writes the information of the N first processing threads corresponding to the first file update request into the first storage space. The first management thread reads the information of the N first processing threads corresponding to the first file update request from the first storage space and creates N first processing threads. After the differential processing is completed, the first management thread is also used to delete the information corresponding to the N first processing threads after generating the patch file of the first new file data. Therefore, during the entire differential processing process, the first application thread and the first management thread may operate on the data in the first storage space at the same time. When the first application thread writes data (for example, information of N first processing threads) in the first storage space, the first management thread is prohibited from deleting data (for example, information of N first processing threads) in the first storage space, that is, the first application thread obtains a mutual exclusion lock to prevent the first application thread and the first management thread from reading data in a disordered manner.

[0146] Step S620: When the first processing thread writes data into the second storage space, the first management thread is prohibited from reading data from the second storage space.

[0147] Specifically, the second storage space is used to store the processing status and / or processing progress of the first processing thread. The processing status refers to whether the patch information is successfully generated, or whether a pair of new and old file data blocks are successfully differentially generated. The processing progress refers to the differential progress of the pair of new and old file data blocks, for example, the differential progress is 5% and 10%.

[0148] During the differential processing process, the first processing thread is used to write the processing status and / or processing progress of the first processing thread into the second storage space. The first management thread is used to read the processing status and / or processing progress of the first processing thread from the second storage space. Thus, the first management thread can manage the first processing thread according to the processing status and / or processing progress. Therefore, the first management thread and the first processing thread may also operate on the data in the second storage space at the same time. When the first processing thread writes data into the second storage space, the first management thread is prohibited from reading data from the second storage space, that is, the first processing thread obtains a mutex lock to prevent functional disorder of reading data between the first management thread and the first processing thread.

[0149] Step S630 : when one of the two first management threads reads the first old file data, the other one of the two first management threads is prohibited from reading the first old file data.

[0150] Specifically, if the first file update request includes first new file data and second new file data of the first target application, wherein the first new file data and the second new file data both correspond to first old file data, two first management threads are created through the first application program.

[0151] That is, please refer to Figure 7 again. The data processing method of the present application can also upgrade the first target application to different versions at the same time, and the first new file data and the second new file data are different versions of the first target application data respectively. Two first management threads are created through the first application. Among them, one first management thread 1 obtains a patch file of a version of the target application based on the first old file data and the first new file data. Another first management thread 2 obtains a patch file of another version of the target application based on the first old file data and the second new file data. Therefore, the two first management threads may read the first old file data at the same time, and the first management thread 2 is prohibited from reading the first old file data when reading the first old file data, that is, the first management thread that reads the first old file data first obtains a mutex lock to prevent functional disorder of reading data between the two management threads.

[0152] Step S640: When the first application thread calls the preset algorithm library, the second application thread is prohibited from calling the preset algorithm library.

[0153] It can be understood that if the first and second application threads simultaneously call the preset algorithm library to initialize preset parameters, and the preset parameters initialized by the first and second application threads are different, the first application thread is allowed to call the preset algorithm library first, while the second application thread is prohibited from calling the preset algorithm library. In other words, the first application thread obtains a mutex lock to prevent data read interruptions between the two application threads.

[0154] It is understandable that the order between step S610 to step S640 is not limited.

[0155] It's important to note that various open-source implementations of differential algorithms in related technologies focus on various factors, including patch file size, differential restoration time, memory or CPU usage, and file formats specific to each. These single-minded approaches often fail to adapt to complex and diverse application scenarios.

[0156] Compared to open-source implementations in related technologies, the design of application threads, processing threads, and management threads in some of the aforementioned embodiments adapts to different operating systems through independent interfaces. Initializing preset parameters allows for control of parameters such as the size of new and old file data blocks and the number of processing threads. N first processing threads simultaneously process N pairs of new and old file data blocks, enabling parallel processing of N pairs of new and old file data blocks. This shortens the differential processing time for a pair of new and old file data, effectively reducing memory usage. Mutexes prevent data read interruptions between threads, enabling a balanced approach to multiple features.

[0157] The present application also provides a data processing method, which is applied to a terminal device. Please refer to Figures 10 and 11. The data processing method includes the following steps:

[0158] S710: Receive an upgrade response from the server.

[0159] S720: Read at least one piece of reserved data from the first old file data according to the location information of the at least one piece of reserved data of the patch file in the first old file data and the data length of the at least one piece of reserved data.

[0160] S730: Reading, from the patch file, new data having the same length as the interval length between adjacent pieces of retained data in the at least one piece of retained data, and position information of the at least one piece of retained data in the first new file data.

[0161] S740: Generate first new file data of the first target application according to the newly added data, the location information of the at least one piece of reserved data in the first new file data, and the at least one reserved data block.

[0162] Specifically, an operating system-independent interface is defined for the restoration algorithm, and the restoration algorithm is adapted to different operating systems through the independent interface. Referring again to Figure 11, the terminal device receives an upgrade response including a patch file for the first target application, calls the restoration algorithm through the independent interface to initialize preset parameters, and executes the following steps:

[0163] Step c1: Load the patch file into the memory, and read the patch information of one new and old file data block from the patch file.

[0164] Step c2: Retrieve relevant information of the retained data from the patch information, and then read the retained data from the old file on the disk according to the starting position of the old file recorded in the relevant information and the data length of the retained data.

[0165] Step c3: Based on the interval length between adjacent retained data, read new data with the same length as the interval length from the patch information.

[0166] Step c4: Process all the retained data in sequence to restore all the new data, and generate a new file data block according to the new data, the position information of the at least one piece of retained data in the first new file data, and the at least one piece of retained data.

[0167] Step c5: Repeat steps c1-c4 until the entire first new file data is restored based on the new file data blocks.

[0168] It is understandable that the restoration algorithm involves a large number of input / output (I / O) operations, so the retained data and patch files of the first old file data can be read into the memory at one time, and the restored first new file data can be temporarily stored in the memory until it is written to the disk again after the restoration is completed.

[0169] It is understandable that, considering that the restoration algorithm often runs in an environment with less memory, during differential processing, the first management thread divides the new and old file data blocks into specified sizes to meet the memory requirements during restoration.

[0170] Please refer to Figure 12 and Figure 1. In another application scenario of the present application, the server 10 receives a file update request from the first device 20. The file update request includes new file data of the intelligent driving assistance application, obtains the old file data of the intelligent driving assistance application, and a data string set. Then, based on the data string set and the preset data string length threshold, the retained data set and the newly added data set of the new file data compared to the old file data are determined. Finally, based on the data length of at least one retained data, the location information of at least one newly added data in the new file data, and the location information of at least one retained data in the new file data and the old file data of the intelligent driving assistance application, a patch file for the new file data is generated.

[0171] Server 10 receives the upgrade request from vehicle 30 and sends an upgrade response to vehicle 30. Vehicle 30 reads at least one piece of retained data from the old file data based on the location information of the at least one piece of retained data in the old file data of the intelligent driving assistance application and the data length of the at least one piece of retained data in the patch file of the upgrade response. Next, based on the length of the interval between adjacent pieces of retained data in the at least one piece of retained data, vehicle 30 reads new data of the same length as the interval from the patch file, as well as the location information of the at least one piece of retained data in the new file data of the intelligent driving assistance application.

[0172] New file data of the intelligent driving assistance application is generated based on the newly added data, the location information of at least one retained data in the new file data, and at least one retained data block, thereby completing the upgrade of the intelligent driving assistance application deployed in the vehicle 30.

[0173] FIG13 is another flow chart of the data processing method provided in an embodiment of the present application. The execution subject of the embodiment of the present application can be the second terminal in FIG1 , or the processing unit, processor, control circuit, etc. in the second terminal, and this embodiment does not impose any particular restrictions on this. As shown in FIG13 , after the above step S710, the method includes:

[0174] S201: In response to receiving an upgrade task, creating at least one upgrade process corresponding to the upgrade task, wherein the upgrade process corresponds to the firmware to be upgraded.

[0175] In this step, the upgrade task can be sent by the server or by a terminal device such as a mobile phone or computer. The upgrade processes corresponding to the upgrade task can be created based on the content of the upgrade task or by executing the executable file corresponding to the upgrade task.

[0176] S202: Obtain the usage of at least one type of resource of the firmware to be upgraded and a first threshold corresponding to the at least one type of resource.

[0177] In this step, the usage of various resources of the firmware to be upgraded is obtained through a preset command line, script, etc. The first thresholds corresponding to various resources of the firmware to be upgraded can be obtained by searching for preset corresponding relationships.

[0178] Specifically, obtaining the first thresholds corresponding to various resources of the firmware to be upgraded may include reading corresponding resource-threshold correspondences according to the identifier of the firmware to be upgraded to obtain the first thresholds corresponding to various resources.

[0179] For example, there are firmware A, B, C, and D to be upgraded. Each firmware to be upgraded has a resource-threshold mapping relationship. The resource-threshold mapping relationship for firmware A to be upgraded includes "the first processor threshold is 70%," "the first I / O interface capacity threshold is 80%," and "the first storage threshold is 50%." The resource-threshold mapping relationship for firmware B to be upgraded includes "the first processor threshold is 50%," "the first I / O interface capacity threshold is 70%," and "the first storage threshold is 70%." The resource-threshold mapping relationships for firmware C and firmware D are not further described here. The resource-threshold mapping relationships for each firmware can be pre-set by the staff.

[0180] S203: If the usage of at least one type of resource is greater than the corresponding first threshold, suspending the upgrade process corresponding to the firmware to be upgraded.

[0181] In this step, if the usage of any type of resource of the firmware to be upgraded is greater than the corresponding first threshold, the upgrade process corresponding to the firmware to be upgraded may be suspended. In the case where there are multiple firmware to be upgraded, if any type of resource of any firmware to be upgraded exceeds the first threshold corresponding to this firmware to be upgraded and this type of resource, the upgrade process corresponding to this firmware to be upgraded may be suspended. The method of suspending the upgrade process corresponding to the firmware to be upgraded may include: using a preset program or script to suspend the upgrade process corresponding to the firmware to be upgraded; it may also include: obtaining the identifier of the upgrade process corresponding to the firmware to be upgraded, writing the obtained identifier of the upgrade process into a preset command template or program template, obtaining the target command or target program, and executing the target command or target program, thereby suspending the upgrade process corresponding to the firmware to be upgraded.

[0182] For example, the resource and threshold correspondence corresponding to the current firmware A to be upgraded includes "the first threshold of the processor is 70%", "the first threshold of the I / O interface capability is 80%", and "the first threshold of the storage is 50%", and the obtained processor occupancy of the firmware A to be upgraded is 72%, the I / O interface occupancy is 50%, and the storage occupancy is 30%, then the upgrade process corresponding to firmware A is suspended; for another example, the resource and threshold correspondence corresponding to the current firmware C to be upgraded includes "the first threshold of the processor is 70%", "the first threshold of the I / O interface capability is 80%", and "the first threshold of the storage is 90%", and the obtained processor occupancy of the firmware C to be upgraded is 60%, the I / O interface occupancy is 82%, and the storage occupancy is 91%, then the upgrade process corresponding to the firmware C to be upgraded is suspended.

[0183] From the description of the above embodiments, it can be seen that the embodiments of the present application create at least one upgrade process corresponding to the upgrade task after receiving the upgrade task, obtain the occupancy of various resources of the firmware to be upgraded and the first threshold corresponding to at least one type of resources of the firmware to be upgraded, and suspend the upgrade process of the firmware to be upgraded when the occupancy corresponding to at least one type of resource is greater than the first threshold, so as to realize firmware upgrade while ensuring the normal operation of the vehicle, avoid the firmware affecting the operation of other programs, and do not need to stop the vehicle operation when performing OTA upgrade, while improving resource utilization efficiency.

[0184] Figure 14 is a schematic diagram of the modular processing process of the data processing method provided in an embodiment of the present application. As shown in Figure 14, the firmware that needs to be upgraded includes a management module, an upgrade execution module and a monitoring module. The management module can run in the main processing unit or the main firmware, and the upgrade execution module and the monitoring module can be installed in each firmware. The management module is used to send control instructions to the upgrade execution module, thereby controlling each upgrade execution module and independently controlling each upgrade execution module. The monitoring module is used to detect the occupancy corresponding to each type of resource, and send the occupancy corresponding to each type of resource to the management module. The detection module is also used to detect the first process and / or the second process below.

[0185] In a possible implementation, after pausing the upgrade process corresponding to the firmware to be upgraded if the usage of at least one type of resource is greater than the corresponding first threshold in step S203, the method further includes:

[0186] S204: If the usage of various resources of the firmware to be upgraded is less than the corresponding second threshold, then continue the upgrade process corresponding to the firmware to be upgraded.

[0187] In this step, for example, the corresponding relationship between resources and thresholds corresponding to the current firmware D to be upgraded includes "the second threshold of the processor is 70%", "the second threshold of the I / O interface capability is 80%", and "the second threshold of the storage is 50%", and the obtained processor occupancy of firmware D is 62%, the I / O interface occupancy is 50%, and the storage occupancy is 30%, then the upgrade process corresponding to firmware D is resumed; for another example, the corresponding relationship between resources and thresholds corresponding to the current firmware E to be upgraded includes "the second threshold of the processor is 80%", "the second threshold of the I / O interface capability is 85%", and "the second threshold of the storage is 90%", and the obtained processor occupancy of firmware E is 60%, the I / O interface occupancy is 82%, and the storage occupancy is 71%, then the upgrade process corresponding to firmware E is continued.

[0188] The second threshold may be preset by the staff.

[0189] In a possible implementation, the second threshold may be smaller than the first threshold in step S202 .

[0190] From the description of the above embodiments, it can be seen that the embodiments of the present application continue the upgrade process corresponding to the firmware to be upgraded when the occupancy of various resources of the firmware to be upgraded is less than the corresponding second threshold value, thereby increasing resource utilization efficiency by continuing the upgrade process when the resource occupancy is small, and there is no need to stop the operation of the motor vehicle when performing the OTA upgrade.

[0191] In a possible implementation, after obtaining the usage of at least one type of resource of the firmware to be upgraded and the first threshold corresponding to the at least one type of resource in step S202, the method further includes:

[0192] S1310: If the usage of at least one type of resource of the firmware to be upgraded is greater than a first threshold corresponding to the target, obtain a first process running in the firmware to be upgraded.

[0193] In this step, the resource usage can be the same as described in the above embodiment, and the first threshold can correspond to the type of resource. The first process can include a process in a running state. The first process can be obtained by using a preset program, script, or command, or by sending a process acquisition request to the kernel and receiving the running process sent by the kernel.

[0194] S1311: Determine the priority of the first process.

[0195] In this step, the corresponding relationship between the process and the priority can be searched according to the first process to obtain the priority corresponding to each running process.

[0196] S1312: Determine the process to be terminated according to the priority of each first process.

[0197] In this step, the first process corresponding to the lowest priority may be determined as the process to be terminated.

[0198] For example, if the priorities of processes A, B, C, and D are 2, 4, 6, and 10, respectively, process A is determined to be the process to be terminated. For another example, if the priorities of processes E, F, G, and H are 0.32, 0.8, 0.66, and 0.2, respectively, process D is determined to be the process to be terminated.

[0199] S1313: Terminate the process to be terminated.

[0200] This step may include writing the identifier of the process to be terminated into a preset instruction template, command line template, or program template, and executing the obtained instruction, command line, or program, thereby terminating the process to be terminated.

[0201] After this step, the above step 203 may be executed again.

[0202] From the description of the above embodiments, it can be seen that the embodiments of the present application obtain the first process already running in the firmware to be upgraded when the resource occupancy in the firmware to be upgraded is greater than the corresponding first threshold, and determine the priority of each first process. The process to be terminated is determined by the priority, and the process to be terminated is terminated, thereby releasing resources to increase the OTA upgrade speed and ensure the smooth operation of the system.

[0203] In a possible implementation, in step S1311, determining the priority of each first process includes:

[0204] S13111: Obtain the final response time, current time, and preset priority score corresponding to each first process.

[0205] In this step, the final response time can be obtained by reading the log file, and the current time can be obtained by obtaining the timestamp. The preset priority score corresponding to each first process can be obtained by looking up the preset correspondence between the process and the priority score.

[0206] The correspondence between the process and the priority score can be preset by the staff and stored in the format of a table or key-value pair.

[0207] S13112: Calculate the time difference between the final response time corresponding to the target first process and the current time, where the target first process is any first process.

[0208] In this step, the current time may be subtracted from the final response time to obtain a time difference.

[0209] S13113: Determine the minimum value and the maximum value of the preset priority scores corresponding to each first process as input parameters.

[0210] In this step, for example, if there are currently five first processes and their corresponding priority scores are 2, 3, 5, 7, and 9, the minimum and maximum values ​​are 2 and 9, respectively. For another example, if there are currently six first processes and their corresponding priority scores are 0.2, 0.1, 3, 0.8, and 6, the minimum and maximum values ​​are 0.1 and 6, respectively.

[0211] S13114: Write the input parameters into the preset formula template to obtain the priority calculation formula.

[0212] In this step, the preset formula template is as follows:

[0213] In the formula, a1 represents the above minimum value, b1 represents the above maximum value, a2, b2, c, and d represent preset constants, x represents the preset priority score corresponding to the target first process, y represents the time difference corresponding to the target first process, and z represents the priority corresponding to the target first process.

[0214] S13115: Input the preset priority score and time difference corresponding to the target first process into the priority calculation formula to obtain the priority corresponding to the target first process.

[0215] In this step, the priority corresponding to the target first process can be calculated by inputting the preset priority score and time difference corresponding to the target first process into the formula obtained in the above step S2114, which will not be repeated here.

[0216] From the description of the above embodiments, it can be seen that the embodiments of the present application obtain the final response time, current time and preset priority score of the process, calculate the time difference, generate a priority calculation formula, input the preset priority score and time difference corresponding to the first process into the priority calculation formula, obtain the priority corresponding to the first process, and realize the priority sorting of each first process in combination with the time of application use and the priority set by the staff. At the same time, the formula used can make the obtained priority distribution within the preset range, which is convenient for priority sorting.

[0217] In a possible implementation, in step S1301, after creating each upgrade process corresponding to the upgrade task in response to receiving the upgrade task, the following steps may be further included:

[0218] S1320: Obtain a second process currently running in the firmware to be upgraded.

[0219] In this step, the second process running in the firmware to be upgraded may be obtained through a command, a program, or a script.

[0220] S1321: If the second process corresponding to the firmware to be upgraded includes the target process corresponding to the firmware to be upgraded, suspend the upgrade process corresponding to the firmware to be upgraded

[0221] In this step, the target process for the firmware to be upgraded can be pre-set by the operator or found based on the driving scenario. Examples of target processes include autonomous driving, object recognition, and user-triggered processes such as temperature control, seat heating, and video playback.

[0222] For example, if the second process corresponding to firmware A to be upgraded includes processes a, b, c, and d, and the target process corresponding to firmware A to be upgraded includes processes b and f, then because the already running process includes process b, the upgrade process corresponding to the firmware to be upgraded is suspended. For another example, if the already running processes corresponding to firmware C to be upgraded include processes d, e, f, g, and h, and the target process corresponding to firmware B to be upgraded includes processes a, c, and f, then because the second process includes process f, the upgrade processes corresponding to firmwares B and C to be upgraded are suspended. The method for temporarily suspending the upgrade process corresponding to the firmware to be upgraded in this step is similar to the method for suspending the upgrade process corresponding to the firmware to be upgraded in step S1303 above, and will not be repeated here.

[0223] As can be seen from the description of the above embodiment, the embodiment of the present application avoids important processes or programs from being affected and increases the security of firmware upgrade by pausing the upgrade process of the firmware to be upgraded when a target process is running in the firmware to be upgraded.

[0224] In a possible implementation, after suspending the upgrade process corresponding to the firmware to be upgraded in step S1321, the method further includes:

[0225] S1330: If the target process is in a stopped state, continue the upgrade process corresponding to the firmware to be suspended.

[0226] This step may include continuing the upgrade process corresponding to the firmware to be upgraded if the target process is no longer included in the running processes corresponding to the firmware to be upgraded. Continuing the upgrade process corresponding to the firmware to be upgraded may include reading the identifier of the upgrade process paused in step S1321, writing the read identifier into a preset resume command template or resume program template to obtain a resume command or resume program, and executing the resume command or resume program to thereby continue the upgrade process corresponding to the firmware to be upgraded.

[0227] From the description of the above embodiments, it can be seen that the embodiments of the present application continue the upgrade process corresponding to the firmware to be upgraded after the target process stops running, so that the upgrade can be continued after the firmware to be upgraded releases the occupation of the target process, thereby improving resource utilization efficiency and reducing the upgrade time.

[0228] In a possible implementation, after creating each upgrade process corresponding to the upgrade task in response to receiving the upgrade task in step S1301, the following steps may be further included:

[0229] S1340: Obtain running applications.

[0230] In this step, the running application may be obtained by reading a task manager, an activity monitor, a preset command line, calling an interface, etc. The running application may be an application that has been running before this step.

[0231] S1341: If the running applications include the target application, determine the firmware to be suspended corresponding to the target application.

[0232] In this step, the target application can be pre-set by the staff or determined based on the driving conditions or vehicle usage scenarios. The process of determining the target application based on the vehicle usage scenario can include searching for the application corresponding to the activated function as the target application based on the user's activation status of the function (usage scenario). Finding the firmware to be suspended corresponding to the target application can include searching for a preset application-firmware correspondence based on the target application to obtain the firmware to be suspended.

[0233] The corresponding relationship between the application and the firmware may be pre-set by the staff based on experimental data or empirical parameters.

[0234] For example, if the running applications include applications A, B, C, and D, and the target applications include applications D, U, and Y, then the firmware corresponding to application D is searched and the found firmware is used as the firmware to be suspended. For another example, if the running applications include applications E, F, G, and H, and the target applications include applications D, G, and H, then the firmware corresponding to applications G and H is searched and the found firmware is used as the firmware to be suspended.

[0235] S1342: Pause the upgrade process corresponding to the firmware to be suspended.

[0236] This step is similar to the method of pausing the upgrade process corresponding to the firmware to be upgraded in the above step S1321, and will not be repeated here.

[0237] From the description of the above embodiments, it can be seen that the embodiments of the present application obtain the running applications and, when a specific application is included in the running applications, suspend the upgrade process of the firmware corresponding to the specific application, thereby avoiding interference with the specific application and ensuring the smooth operation of important applications.

[0238] In a possible implementation, after the above step S1342, the method further includes: if the target application stops running, continuing the upgrade process corresponding to the firmware to be suspended.

[0239] In one possible implementation, after receiving the upgrade task, the above-mentioned management module controls the upgrade execution module to start flashing the firmware. During the flashing process, the management module can control the pause and continuation of the flashing process according to the resource usage of the firmware and the applications running in the firmware. After the flashing is completed, the old and new systems are switched to complete the flashing task.

[0240] Referring to FIG. 15 , which is another flow chart of a data processing method provided in an embodiment of the present application, the data processing method may be executed by a data processing device provided in an embodiment of the present application. The data processing device may be implemented in software and / or hardware. The data processing method provided in this embodiment includes:

[0241] Step S1510: setting priority rules for multiple downloaders.

[0242] In one embodiment, the multiple downloaders include a first downloader, a second downloader, and a third downloader; and setting priority rules for the multiple downloaders includes:

[0243] First priority usage rule: use the first downloader; second priority usage rule: use the second and third downloaders at the same time; third priority usage rule: only use the second downloader; fourth priority usage rule: only use the third downloader.

[0244] Preferably, the first downloader includes a telematics BOX (Tbox) downloader, the second downloader includes a cockpit domain controller (CDC) downloader, and the third downloader includes a driving domain controller (DDC) downloader.

[0245] Step S1520 , in response to a download instruction for downloading a target file, at least one target downloader is selected from the plurality of downloaders according to a preset identifier of the target file and a priority usage rule of the plurality of downloaders.

[0246] Step S1530: determining an expected download bandwidth of at least one target downloader based on the network bandwidth of each node of the distributed network where the multiple downloaders are located.

[0247] In one embodiment, determining the expected download bandwidth in at least one target downloader includes:

[0248] Determine the communication network bandwidth for the communication network in the in-vehicle network to which the vehicle is connected, the first Ethernet bandwidth for the Ethernet between the first downloader and the gateway, the second Ethernet bandwidth for the Ethernet between the gateway and the second downloader, and the third Ethernet bandwidth for the Ethernet between the gateway and the third downloader; when the first downloader is selected as the target downloader, determine the communication network bandwidth as the first expected download bandwidth; when the second downloader is selected as the target downloader, determine the smallest one among the communication network bandwidth, the first Ethernet bandwidth and the second Ethernet bandwidth as the second expected download bandwidth; when the third downloader is selected as the target downloader, determine the smallest one among the communication network bandwidth, the first Ethernet bandwidth and the third Ethernet bandwidth as the third expected download bandwidth; wherein, the first downloader includes a telematics processor downloader, the second downloader includes a cockpit domain controller downloader, and the third downloader includes a driving domain controller downloader.

[0249] Preferably, 5G network is the basic configuration of current cars with networking functions. In-vehicle Ethernet mainly includes Gigabit Ethernet, which is the backbone network between the telematics processor and the gateway, and between the gateway and the core domain controller (cockpit domain controller, driving domain controller).

[0250] It can be understood that the first downloader is connected to the second and third downloaders via a gateway. The first downloader is located in the upper network layer of the gateway, while the second and third downloaders are located in the lower network layer of the gateway, and the second and third downloaders share the same lower network layer. Therefore, the total bandwidth allocated to the second and third downloaders should not be greater than the smaller value of the communication network bandwidth and the first Ethernet bandwidth.

[0251] Step S1540: Download the target file using the expected download bandwidth through at least one target downloader.

[0252] In one embodiment, downloading a target file using a desired download bandwidth by at least one target downloader includes:

[0253] If the target file can be downloaded using the first downloader, the first downloader is selected to download the target file using the first expected download bandwidth; if the target file cannot be downloaded using the first downloader, but can be downloaded using the second downloader and the third downloader, and the third Ethernet bandwidth is determined as the third expected download bandwidth, the difference between the smaller of the communication network bandwidth and the first Ethernet bandwidth and the second expected download bandwidth is determined as the auxiliary download bandwidth, and the second downloader is selected to download the target file using the second expected download bandwidth, and the third downloader is selected to download the target file using the auxiliary download bandwidth.

[0254] Furthermore, if the target file cannot be downloaded using the first downloader and the third downloader but can be downloaded using the second downloader, or the target file cannot be downloaded using the first downloader but can be downloaded using the second downloader and the third downloader, and any one of the communication network bandwidth and the first Ethernet bandwidth is determined to be the third expected download bandwidth, then the second downloader is selected to download the target file using the second expected download bandwidth; if the target file cannot be downloaded using the first downloader and the second downloader but can be downloaded using the third downloader, then the third downloader is selected to download the target file using the third expected download bandwidth.

[0255] In one embodiment, after determining the expected download bandwidth in at least one target downloader, the method further includes:

[0256] The first expected download bandwidth, the second expected download bandwidth, the third expected download bandwidth and the download rate of the target file are periodically determined according to a preset time period; or the first expected download bandwidth, the second expected download bandwidth, the third expected download bandwidth and the download rate of the target file are dynamically determined according to the current connection status of the vehicle network.

[0257] In one embodiment, after downloading the target file using the desired download bandwidth by at least one target downloader, the method further includes:

[0258] If the vehicle network is disconnected, multiple downloaders are controlled to suspend downloading; if the vehicle network is restored, an updated expected download bandwidth of at least one target downloader is determined, and the target file is downloaded by the target downloader using the updated expected download bandwidth.

[0259] It can be understood that when the target file cannot be downloaded using the first downloader, but can be downloaded using the second downloader and the third downloader, the second expected download bandwidth is determined; if the second expected download bandwidth is the smaller value between the communication network bandwidth and the first Ethernet bandwidth, it means that there is no excess bandwidth to be allocated to the third downloader, and all the available bandwidth is allocated to the second downloader; if the second expected download bandwidth is the second Ethernet bandwidth, it means that there is excess bandwidth to be allocated to the third downloader, and after the available bandwidth that meets the second Ethernet bandwidth is allocated to the second downloader, the remaining bandwidth is allocated to the third downloader.

[0260] It can be understood that the present invention can also periodically detect the first expected download bandwidth, the second expected download bandwidth, and the third expected download bandwidth, dynamically adjust the status of each downloader, and determine the download rate of the target file; it can also adjust the status of each downloader and the download rate in real time according to network connection status change events and downloader status change events.

[0261] Preferably, the duration period is 10s.

[0262] Through the above method, during the download process, it is possible to control whether each downloader executes the download according to the network load status, the status of the downloader, and in a periodic or real-time manner, allocate available bandwidth to each downloader according to the preset priority usage rules, and adjust the download bandwidth of the downloader in real time.

[0263] Figure 16 is a schematic diagram of the structure of an embodiment of a data processing device for the data processing method provided herein. This device 40 can be integrated into or implemented by the server described in the aforementioned method embodiment. As shown in Figure 16 , the data processing device 40 includes a first receiving module 41, an acquisition module 42, a determination module 43, and a patch file generation module 44.

[0264] The first receiving module 41 is configured to receive a first file update request from a first device, where the first file update request includes first new file data of a first target application.

[0265] The acquisition module 42 is configured to acquire first old file data corresponding to the first new file data, and a first data string set, where the first data string set is data strings of different lengths created based on the first old file data.

[0266] The determination module 43 is used to determine, based on the first data string set and a preset data string length threshold, a retained data set and a newly added data set of the first new file data compared to the first old file data, the retained data set including at least one retained data, the newly added data set including at least one newly added data, and the data length of each retained data being greater than the data string length threshold.

[0267] The patch file generation module 44 is used to generate a patch file for the first new file data based on the data length of at least one retained data, the position information of at least one newly added data in the first new file data, and the position information of at least one retained data in the first new file data and the first old file data respectively. The patch file is used to update data of the first target application.

[0268] In some embodiments, determination module 43 is further configured to search, starting from the first byte of the first new file data, the first data string set for the longest data string beginning with the first byte. By comparing the length of the longest data string with a data string length threshold, it is determined whether to include the longest data string as a piece of retained data. After traversing all bytes of the first new file data, a retained data set is obtained. A newly added data set is determined based on the position of the retained data in the retained data set relative to the first new file data.

[0269] In some embodiments, the determination module 43 is also used to, if the length of the longest data string is greater than a data string length threshold, determine that the longest data string is to be retained as a piece of data, and starting from the target byte of the first new file data, search in the first data string set whether there is a longest data string starting with the target byte, wherein the target byte is the byte determined by adding the length of the longest data string starting with the first byte to the first byte; if the length of the longest data string is less than or equal to the data string length threshold, starting from the byte next to the first byte, continue to search in the first data string set whether there is a longest data string starting with the next byte.

[0270] In some embodiments, the data processing device 40 also includes a thread processing module 45, which is used to perform data segmentation on the first new file data and the first old file data according to a preset data volume threshold, respectively, to obtain N pairs of new and old file data blocks, where N is a positive integer greater than 1 and less than or equal to M, and M is the maximum number of processing threads executed in parallel; create N first processing threads, and the N first processing threads correspond one-to-one to the N pairs of new and old file data blocks; obtain patch files of N pairs of new and old file data blocks by executing data comparison of N pairs of new and old file data blocks in parallel through the N first processing threads; and generate a patch file of the first new file data based on the patch files of the N pairs of new and old file data blocks.

[0271] In some embodiments, the thread processing module 45 is further configured to, through a first application thread of the first target application, call a preset algorithm library to initialize preset parameters, the preset parameters including a data volume threshold and M; create a first management thread through the first application thread in response to the first file update request; and execute, through the first management thread, a step of splitting the first new file data and the first old file data according to the preset data volume threshold to obtain N pairs of new and old file data blocks; and execute, through the first management thread, a step of generating a patch file for the first new file data based on the patch files of the N pairs of new and old file data blocks.

[0272] In some embodiments, the thread processing module 45 is also used to: the first application thread is also used to write information of N first processing threads corresponding to the first file update request in the first storage space; the first management thread is also used to delete the information of N first processing threads after generating a patch file for the first new file data; when the first application thread writes data in the first storage space, the first management thread is prohibited from deleting data in the first storage space.

[0273] In some embodiments, the thread processing module 45 is also used to: the first processing thread is used to write the processing status and / or processing progress of the first processing thread in the second storage space, and the first management thread is used to read the processing status and / or processing progress of the first processing thread from the second storage space; when the first processing thread writes data in the second storage space, the first management thread is prohibited from reading data in the second storage space.

[0274] In some embodiments, the thread processing module 45 is further configured to create two first management threads through the first application; when one of the two first management threads reads the first old file data, the other first management thread is prohibited from reading the first old file data.

[0275] In some embodiments, the thread processing module 45 is also used to receive a second file update request from the first device at the same time as receiving the first file update request, the second file update request including the third new file data of the second target application; create a second application thread of the second target application according to the second file update request, the second application thread is used to initialize preset parameters by calling the preset algorithm library; create a second management thread through the second application thread; when the first application thread calls the preset algorithm library, prohibit the second application thread from calling the preset algorithm library.

[0276] In some embodiments, the first receiving module 41 is also used to receive an upgrade request from the second device, where the upgrade request is used to request an upgrade of the first target application; in response to the upgrade request, obtain the patch file of the first target application; and send an upgrade response to the second device, where the upgrade response includes the patch file of the first target application.

[0277] The data processing device 40 provided in this embodiment is used to execute the technical solution in the embodiment of the method executed by the aforementioned server. Its implementation principle and technical effects are similar and will not be repeated here.

[0278] Figure 17 is a schematic diagram of the structure of another embodiment of a data processing device for the data processing method provided herein. This device 50 can be integrated into or implemented by the terminal device described in the aforementioned method embodiment. As shown in Figure 17 , the data processing device 500 includes a second receiving module 501, a first reading module 502, a second reading module 503, and a new file data generation module 504.

[0279] The second receiving module 501 is configured to receive an upgrade response from a server, where the upgrade response includes a patch file of the first target application.

[0280] The first reading module 502 is configured to read at least one piece of reserved data from the first old file data according to the position information of the at least one piece of reserved data of the patch file in the first old file data and the data length of the at least one piece of reserved data.

[0281] The second reading module 503 is used to read, from the patch file, new data having the same length as the interval length between adjacent retained data in the at least one piece of retained data, and position information of the at least one piece of retained data in the first new file data.

[0282] The new file data generating module 504 is configured to generate first new file data of a first target application according to the newly added data, the location information of the at least one piece of reserved data in the first new file data, and the at least one reserved data block.

[0283] In a possible implementation, the data processing device 500 further includes: an upgrade suspension module 505 .

[0284] The upgrade suspension module 505 is used to create at least one upgrade process corresponding to the upgrade task in response to receiving an upgrade task, wherein the upgrade process corresponds to the firmware to be upgraded; obtain the occupancy of at least one type of resource of the firmware to be upgraded and the first threshold corresponding to at least one type of resource; if the occupancy of at least one type of resource is greater than the corresponding first threshold, suspend the upgrade process corresponding to the firmware to be upgraded.

[0285] In a possible implementation, the data processing device 500 further includes an upgrade recovery module 506 .

[0286] The upgrade recovery module 506 is configured to continue the upgrade process corresponding to the firmware to be upgraded if the usage of various resources of the firmware to be upgraded is less than the corresponding second threshold.

[0287] In a possible implementation, the data processing device 500 further includes: a process termination module 507 .

[0288] The process termination module 507 is used to obtain the first processes running in the firmware to be upgraded if the usage of at least one type of resource of the firmware to be upgraded is greater than the corresponding first threshold; determine the priority of each first process; determine the process to be terminated based on the priority of each first process; and terminate the process to be terminated.

[0289] In one possible implementation, the process termination module 507 is specifically used to obtain the final response time, current time and preset priority score corresponding to each first process; calculate the time difference between the final response time and current time corresponding to the target first process, where the target first process is any first process; determine the minimum and maximum values ​​of the preset priority scores corresponding to each first process as input parameters; write the input parameters into a preset formula template to obtain a priority calculation formula; input the preset priority score and time difference corresponding to the target first process into the priority calculation formula to obtain the priority corresponding to the target first process.

[0290] In a possible implementation, the data processing device 500 further includes: a process suspension module 508 .

[0291] The process suspension module 508 is configured to obtain the second process currently running in the firmware to be upgraded; if the second process corresponding to the firmware to be upgraded includes the target process corresponding to the firmware to be upgraded, then suspend the upgrade process corresponding to the firmware to be upgraded.

[0292] In a possible implementation, the data processing device 500 further includes: a process recovery module 509 .

[0293] The process recovery module 509 is configured to continue the upgrade process corresponding to the firmware to be upgraded if the target process is in a stopped state.

[0294] In a possible implementation, the process suspension module 508 is further configured to obtain running applications; if the running applications include a target application, determine the firmware to be suspended corresponding to the target application; and suspend the upgrade process corresponding to the firmware to be suspended.

[0295] In a possible implementation, the data processing device 500 further includes: a file download module 510 .

[0296] The file download module 510 is used to set priority usage rules for multiple downloaders; in response to a download instruction to download a target file, select at least one target downloader from the multiple downloaders according to a preset identifier of the target file and the priority usage rules of the multiple downloaders; determine the expected download bandwidth of at least one target downloader based on the network bandwidth of each node in the distributed network where the multiple downloaders are located; and download the target file through the at least one target downloader using the expected download bandwidth.

[0297] In one possible implementation, the multiple downloaders include a first downloader, a second downloader, and a third downloader; setting priority usage rules for the multiple downloaders includes: a first priority usage rule: using the first downloader; a second priority usage rule: using the second downloader and the third downloader at the same time; a third priority usage rule: only using the second downloader; and a fourth priority usage rule: only using the third downloader.

[0298] In one possible implementation, the file download module 510 is specifically used to determine the communication network bandwidth for the communication network in the in-vehicle network to which the vehicle is connected, the first Ethernet bandwidth for the Ethernet between the first downloader and the gateway, the second Ethernet bandwidth for the Ethernet between the gateway and the second downloader, and the third Ethernet bandwidth for the Ethernet between the gateway and the third downloader; when the first downloader is selected as the target downloader, the communication network bandwidth is determined as the first expected download bandwidth; when the second downloader is selected as the target downloader, the smallest one among the communication network bandwidth, the first Ethernet bandwidth and the second Ethernet bandwidth is determined as the second expected download bandwidth; when the third downloader is selected as the target downloader, the smallest one among the communication network bandwidth, the first Ethernet bandwidth and the third Ethernet bandwidth is determined as the third expected download bandwidth; wherein, the first downloader includes a telematics processor downloader, the second downloader includes a cockpit domain controller downloader, and the third downloader includes a driving domain controller downloader.

[0299] In one possible implementation, the file download module 510 is specifically configured to, if the target file can be downloaded using the first downloader, determine the first downloader as the target downloader, and use the first expected download bandwidth to download the target file; if the target file cannot be downloaded using the first downloader, but can be downloaded using the second downloader and the third downloader, and the third Ethernet bandwidth is determined to be the third expected download bandwidth, determine the second downloader and the third downloader as the target downloaders, determine the difference between the smaller of the communication network bandwidth and the first Ethernet bandwidth and the second expected download bandwidth as the auxiliary download bandwidth, select the second downloader to download the target file using the second expected download bandwidth, and simultaneously select the third downloader to download the target file using the auxiliary download bandwidth.

[0300] In one possible implementation, the file download module 510 is further configured to determine the second downloader as the target downloader and use the second expected download bandwidth to download the target file if the target file cannot be downloaded using the first downloader and the third downloader but can be downloaded using the second downloader, or if the target file cannot be downloaded using the first downloader but can be downloaded using the second downloader and the third downloader, and any one of the communication network bandwidth and the first Ethernet bandwidth is determined to be the third expected download bandwidth.

[0301] In one possible implementation, the file download module 510 is further configured to determine the third downloader as the target downloader and use the third expected download bandwidth to download the target file if the target file cannot be downloaded using the first downloader and the second downloader but can be downloaded using the third downloader.

[0302] In one possible implementation, the file download module 510 is further used to periodically determine the first expected download bandwidth, the second expected download bandwidth, the third expected download bandwidth, and the download rate of the target file based on a preset time period; or to dynamically determine the first expected download bandwidth, the second expected download bandwidth, the third expected download bandwidth, and the download rate of the target file based on the current connection status of the vehicle network.

[0303] In one possible implementation, the file download module 510 is also used to control multiple downloaders to suspend downloading if the vehicle network is disconnected; if the vehicle network is restored, determine the updated expected download bandwidth of at least one target downloader, and download the target file through the target downloader using the updated expected download bandwidth.

[0304] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail in this embodiment.

[0305] The present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the processor executes the computer-executable instructions, the technical solution of the data processing method in any of the above embodiments is implemented. Its implementation principles and beneficial effects are similar to those of the data processing method. Please refer to the implementation principles and beneficial effects of the data processing method, and no further details will be given here.

[0306] In the context of the present application, a machine-readable medium can be a tangible medium that can contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0307] The present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the technical solution of the data processing method in any of the above embodiments. Its implementation principles and beneficial effects are similar to those of the data processing method. Please refer to the implementation principles and beneficial effects of the data processing method, and they will not be repeated here.

[0308] Figure 18 is a schematic diagram of the structure of a server provided in this application. As shown in Figure 18, the server 60 includes: a processor 61, a memory 62, and a bus 63; the memory 62 is used to store computer program code of the processor 61; wherein the processor 61 is configured to execute the technical solution of the server in any of the aforementioned method embodiments by executing the computer program code. Optionally, the memory 62 can be independent or integrated with the processor 61. The memory 62 is connected to the processor 61 via the bus 63 and communicates with the processor 61. Optionally, the memory 62 may include random access memory (RAM) or non-volatile memory (non-volatile memory), such as at least one disk drive. The bus 63 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. Buses can be divided into address buses, data buses, control buses, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.

[0309] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0310] The server is used to execute the technical solution of the server in any of the aforementioned method embodiments, and its implementation principle and technical effects are similar and will not be repeated here.

[0311] Figure 19 is a schematic diagram of the structure of a terminal device provided in this application. As shown in Figure 19, the terminal device 70 includes: a processor 71, a memory 72, and a bus 73; the memory 72 is used to store computer program code of the processor 71; wherein the processor 71 is configured to execute the technical solution of the server in any of the aforementioned method embodiments by executing the computer program code. Optionally, the memory 72 can be independent or integrated with the processor 71. The memory 72 is connected to the processor 71 via the bus 73 and communicates with the processor 71. Optionally, the memory 72 may include random access memory (RAM) or non-volatile memory (non-volatile memory), such as at least one disk drive. The bus 73 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. Buses can be divided into address buses, data buses, control buses, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.

[0312] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0313] The terminal device is used to execute the technical solution of the terminal device in any of the aforementioned method embodiments, and its implementation principle and technical effects are similar and will not be repeated here.

[0314] An embodiment of the present application further provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the technical solution provided by any of the aforementioned embodiments is implemented.

[0315] An embodiment of the present application also provides a chip system, which is applied to a server or terminal device. The chip system includes one or more processors, and the one or more processors are used to call computer instructions to enable the server or terminal device to implement the technical solution provided by any of the aforementioned embodiments.

[0316] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, is used to implement the technical solution provided by any of the aforementioned method embodiments.

[0317] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0318] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A data processing method, characterized in that, Applied to a server, the method includes: Receiving a first file update request from a first device, the first file update request including first new file data of a first target application; Obtaining first old file data corresponding to the first new file data, and a first data string set, the first data string set being data strings of different lengths created based on the first old file data and the first new file data; Determining a retained data set and a new added data set of the first new file data compared to the first old file data according to the first data string set and a preset data string length threshold, the retained data set including at least one piece of retained data, the new added data set including at least one piece of new added data, and the data length of each piece of retained data being greater than the data string length threshold; Generating a patch file for the first new file data according to the data length of the at least one piece of retained data, the position information of the at least one piece of new added data in the first new file data, and the position information of the at least one piece of retained data in the first new file data and the first old file data respectively, the patch file being used for data update of the first target application.

2. The method according to claim 1, wherein The determining the retained data set and the new added data set of the first new file data compared to the first old file data according to the first data string set and the preset data string length threshold includes: Starting from the first byte of the first new file data, searching for the longest data string starting with the first byte in the first data string set; Determining whether to use the longest data string as a piece of retained data by comparing the length of the longest data string with the data string length threshold; After traversing all bytes of the first new file data, obtaining the retained data set; Determining the new added data set according to the positions of the retained data in the first new file data in the retained data set.

3. The method according to claim 2, wherein The determining whether to use the longest data string as a piece of retained data by comparing the length of the longest data string with the data string length threshold includes: If the length of the longest data string is greater than the data string length threshold, determining to use the longest data string as a piece of retained data, and starting from a target byte of the first new file data, searching for whether there is a longest data string starting with the target byte in the first data string set, where the target byte is the byte determined after adding the length of the longest data string starting with the first byte to the first byte; If the length of the longest data string is less than or equal to the data string length threshold, starting from the next byte of the first byte, continuing to search for whether there is a longest data string starting with the next byte in the first data string set.

4. The method according to any one of claims 1 to 3, characterized in that The method further includes: According to a preset data volume threshold, respectively performing data segmentation on the first new file data and the first old file data to obtain N pairs of old and new file data blocks, where N is a positive integer greater than 1 and less than or equal to M, and M is the maximum value of the processing threads executed in parallel; Create N first processing threads, where the N first processing threads correspond one-to-one to the N pairs of new and old file data blocks; Through the N first processing threads, perform parallel data comparison on the N pairs of new and old file data blocks to obtain patch files for the N pairs of new and old file data blocks; Generate a patch file for the first new file data according to the patch files of the N pairs of new and old file data blocks.

5. The method according to claim 4, wherein The method further includes: Initialize preset parameters by the first application thread of the first target application calling a preset algorithm library, where the preset parameters include the data volume threshold and the M; Create a first management thread through the first application thread according to the first file update request; The step of respectively performing data segmentation on the first new file data and the first old file data according to a preset data volume threshold to obtain N pairs of new and old file data blocks includes: Execute, by the first management thread, the step of respectively performing data segmentation on the first new file data and the first old file data according to a preset data volume threshold to obtain N pairs of new and old file data blocks; The step of creating N first processing threads includes: Create the N first processing threads by the first management thread; The step of generating a patch file for the new file data according to the patch files of the N pairs of new and old file data blocks includes: Execute, by the first management thread, the step of generating a patch file for the first new file data according to the patch files of the N pairs of new and old file data blocks.

6. The method according to claim 5, wherein The first application thread is further configured to write information of the N first processing threads corresponding to the first file update request in a first storage space; the first management thread is further configured to delete the information of the N first processing threads after generating the patch file for the first new file data; When the first application thread writes data in the first storage space, the first management thread is prohibited from deleting data in the first storage space.

7. The method according to claim 5, wherein The first processing thread is configured to write the processing status and / or processing progress of the first processing thread in a second storage space, and the first management thread is configured to read the processing status and / or processing progress of the first processing thread from the second storage space; When the first processing thread writes data in the second storage space, the first management thread is prohibited from reading data in the second storage space.

8. The method according to claim 5, wherein If the first file update request includes the first new file data and the second new file data of the first target application, and both the first new file data and the second new file data correspond to the first old file data; The step of creating a first management thread through the first application thread includes: Create two first management threads through the first application; When one of the two first management threads reads the first old file data, the other first management thread of the two first management threads is prohibited from reading the first old file data.

9. The method according to claim 5, wherein The method further includes: While receiving the first file update request, receive a second file update request from a first device, where the second file update request includes third new file data of a second target application; According to the second file update request, create a second application thread for the second target application, where the second application thread is used to initialize preset parameters by calling the preset algorithm library; Create a second management thread through the second application thread; When the first application thread calls the preset algorithm library, prohibit the second application thread from calling the preset algorithm library.

10. The method according to any one of claims 1 to 9, characterized in that The method further includes: Receive an upgrade request from a second device, where the upgrade request is used to request an upgrade of the first target application; In response to the upgrade request, obtain a patch file of the first target application; Send an upgrade response to the second device, where the upgrade response includes the patch file of the first target application.

11. A data processing method, characterized in that, Applied to a terminal device, the method includes: Receive an upgrade response from a server, where the upgrade response includes a patch file of a first target application; According to the position information of at least one piece of reserved data in the first old file data and the data length of the at least one piece of reserved data in the patch file, read at least one piece of reserved data from the first old file data; According to the interval length between adjacent reserved data in the at least one piece of reserved data, read new data with the same length as the interval length from the patch file, and the position information of the at least one piece of reserved data in the first new file data; Generate first new file data of the first target application according to the new data, the position information of the at least one piece of reserved data in the first new file data, and the at least one piece of reserved data block.

12. The method according to claim 11, wherein After receiving the upgrade response from the server, it further includes: In response to receiving an upgrade task, create at least one upgrade process corresponding to the upgrade task, where the upgrade process corresponds to the firmware to be upgraded; Obtain the occupancy of at least one type of resource of the firmware to be upgraded and a first threshold corresponding to the at least one type of resource; If the occupancy of the at least one type of resource is greater than the corresponding first threshold, suspend the upgrade process corresponding to the firmware to be upgraded.

13. The method according to claim 12, wherein After the step of if the occupancy of the at least one type of resource is greater than the corresponding first threshold, suspend the upgrade process corresponding to the firmware to be upgraded, it further includes: If the occupancy of each type of resource of the firmware to be upgraded is less than the corresponding second threshold, continue the upgrade process corresponding to the firmware to be upgraded.

14. The method according to claim 12, wherein After obtaining the occupancy of at least one type of resource of the firmware to be upgraded and the first threshold corresponding to the at least one type of resource, it further includes: If the occupancy of at least one type of resource of the firmware to be upgraded is greater than the corresponding first threshold, obtain a first process running in the firmware to be upgraded; Determine the priority of each first process; According to the priority of each first process, determine the process to be terminated; Terminate the process to be terminated.

15. The method according to claim 14, wherein The determining the priority of each first process includes: Obtain the final response time, current time of each first process, and a preset priority score corresponding to each first process; Calculate the time difference between the final response time of the target first process and the current time, where the target first process is any first process; Determine the minimum value and the maximum value among the preset priority scores corresponding to each first process as input parameters; Write the input parameters into a preset formula template to obtain a priority calculation formula; Input the preset priority score and the time difference corresponding to the target first process into the priority calculation formula to obtain the priority corresponding to the target first process.

16. The method according to any one of claims 12 to 15, characterized in that After creating at least one upgrade process corresponding to the upgrade task in response to receiving the upgrade task, it further includes: Obtain the second process that is running in the firmware to be upgraded; If the second process corresponding to the firmware to be upgraded includes the target process corresponding to the firmware to be upgraded, then pause the upgrade process corresponding to the firmware to be upgraded.

17. The method according to claim 16, wherein After pausing the upgrade process corresponding to the firmware to be upgraded, it further includes: If the target process is in a stopped state, then continue the upgrade process corresponding to the firmware to be upgraded.

18. The method according to any one of claims 12 to 15, characterized in that, After creating at least one upgrade process corresponding to the upgrade task in response to receiving the upgrade task, it further includes: Obtain the running application; If the running application includes the target application, then determine the firmware to be paused corresponding to the target application; Pause the upgrade process corresponding to the firmware to be paused.

19. The method according to any one of claims 11 to 18, characterized in that, After receiving the upgrade response from the server, it further includes: setting the priority usage rules for multiple downloaders; In response to a download instruction for downloading a target file, select at least one target downloader from the multiple downloaders according to the preset identifier of the target file and the priority usage rules of the multiple downloaders; Based on the network bandwidth of each node of the distributed network where the multiple downloaders are located, determine the expected download bandwidth in the at least one target downloader; Download the target file through the at least one target downloader using the expected download bandwidth.

20. The method according to claim 19, wherein The multiple downloaders include a first downloader, a second downloader, and a third downloader; The setting of the priority usage rules for multiple downloaders includes: The first priority usage rule: use the first downloader; the second priority usage rule: use the second downloader and the third downloader simultaneously; the third priority usage rule: only use the second downloader; the fourth priority usage rule: only use the third downloader.

21. The method according to claim 20, wherein The determination of the expected download bandwidth in the at least one target downloader includes: Determine the communication network bandwidth for the communication network in the vehicle-mounted network accessed by the vehicle, the first Ethernet bandwidth for the Ethernet between the first downloader and the gateway, the second Ethernet bandwidth for the Ethernet between the gateway and the second downloader, and the third Ethernet bandwidth for the Ethernet between the gateway and the third downloader; When selecting the first downloader as the target downloader, determine the communication network bandwidth as the first expected download bandwidth; When selecting the second downloader as the target downloader, determine the minimum value among the communication network bandwidth, the first Ethernet bandwidth, and the second Ethernet bandwidth as the second expected download bandwidth; When selecting the third downloader as the target downloader, determine the smallest one among the communication network bandwidth, the first Ethernet bandwidth, and the third Ethernet bandwidth as the third expected download bandwidth; Among them, the first downloader includes a remote information processor downloader, the second downloader includes a cockpit domain controller downloader, and the third downloader includes a driving domain controller downloader.

22. The method according to claim 21, wherein The downloading of the target file using the expected download bandwidth through the at least one target downloader includes: If the target file can be downloaded using the first downloader, determine the first downloader as the target downloader and download the target file using the first expected download bandwidth; If the target file cannot be downloaded using the first downloader, but can be downloaded using the second downloader and the third downloader, and the third Ethernet bandwidth is determined as the third expected download bandwidth, determine the second downloader and the third downloader as the target downloaders, determine the difference between the smaller one of the communication network bandwidth and the first Ethernet bandwidth and the second expected download bandwidth as the auxiliary download bandwidth, and select the second downloader to download the target file using the second expected download bandwidth, while selecting the third downloader to download the target file using the auxiliary download bandwidth.

23. The method according to claim 21, wherein The downloading of the target file using the expected download bandwidth through the at least one target downloader further includes: If the target file cannot be downloaded using the first downloader and the third downloader, but can be downloaded using the second downloader, or the target file cannot be downloaded using the first downloader, but can be downloaded using the second downloader and the third downloader, and any one of the communication network bandwidth and the first Ethernet bandwidth is determined as the third expected download bandwidth, determine the second downloader as the target downloader and download the target file using the second expected download bandwidth.

24. The method according to claim 21, wherein The downloading of the target file using the expected download bandwidth through the at least one target downloader further includes: If the target file cannot be downloaded using the first downloader and the second downloader, but can be downloaded using the third downloader, determine the third downloader as the target downloader and download the target file using the third expected download bandwidth.

25. The method according to any one of claims 22 to 24, characterized in that, The downloading of the target file using the expected download bandwidth through the at least one target downloader further includes: Periodically determine the first expected download bandwidth, the second expected download bandwidth, the third expected download bandwidth, and the download rate of the target file according to a preset duration period; Or, dynamically determine the first expected download bandwidth, the second expected download bandwidth, the third expected download bandwidth, and the download rate of the target file according to the current connection status of the vehicle-mounted network.

26. The method according to claim 25, wherein After the downloading of the target file using the expected download bandwidth through the at least one target downloader, the method further includes: If the vehicle-mounted network is disconnected, control the plurality of downloaders to suspend the download work; If the vehicle-mounted network resumes connection, determine the updated expected download bandwidth of the at least one target downloader, and use the updated expected download bandwidth through the target downloader to download the target file.

27. A data processing device, characterized in that, Applied to a server, including: A request receiving module, configured to receive a first file update request from a first device, where the first file update request includes first new file data of a first target application; A data acquisition module, configured to acquire first old file data corresponding to the first new file data, and a first data string set, where the first data string set is data strings of different lengths created based on the first old file data and the first new file data; A data determination module, configured to determine a reserved data set and a new data set of the first new file data compared with the first old file data according to the first data string set and a preset data string length threshold, where the reserved data set includes at least one piece of reserved data, the new data set includes at least one piece of new data, and the data length of each piece of reserved data is greater than the data string length threshold; A file generation module, configured to generate a patch file of the first new file data according to the data length of the at least one piece of reserved data, the position information of the at least one piece of new data in the first new file data, and the position information of the at least one piece of reserved data in the first new file data and the first old file data respectively, where the patch file is used to perform data update on the first target application.

28. A data processing device, characterized in that, Applied to a terminal device, including: A response receiving module, configured to receive an upgrade response from a server, where the upgrade response includes a patch file of a first target application; A reserved data reading module, configured to read at least one piece of reserved data from the first old file data according to the position information of the at least one piece of reserved data in the first old file data in the patch file and the data length of the at least one piece of reserved data; A new data reading module, configured to read new data with the same length as the interval length between adjacent reserved data in the at least one piece of reserved data from the patch file, and the position information of the at least one piece of reserved data in the first new file data; A file data generation module, configured to generate first new file data of the first target application according to the new data, the position information of the at least one piece of reserved data in the first new file data, and the at least one piece of reserved data block.

29. A server, characterized in that, Including: A processor and a memory; The memory is coupled to the processor, and the memory is used to store computer program code, and the processor calls the computer program code to cause the server to execute the method according to any one of claims 1 to 10.

30. A terminal device, characterized in that, Including: A processor and a memory; The memory is coupled to the processor, and the memory is used to store computer program code, and the processor calls the computer program code to cause the terminal device to execute the method according to any one of claims 11 to 26.

31. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which are used to implement the data processing method described in any one of claims 1 to 10 or claims 11 to 26 when executed by a processor.

Citation Information

Patent Citations

  • Firmware upgrading processing method and device, equipment and storage medium

    CN117857521A

  • Differential file generation method, reduction method and electronic equipment

    CN116028095A

  • File downloading method and device and vehicle

    CN118646747A

  • Data processing method, server and terminal equipment

    CN118916058A

  • Patching method, related apparatus, and system

    WO2021027630A1