Method and device for saving vehicle upgrade progress data, electronic device and storage medium
By caching and compressing vehicle upgrade progress data in the Internet of Vehicles OTA platform and persisting it when necessary, the problem of upgrading progress data occupying a large amount of storage space in the Internet of Vehicles OTA platform is solved, and efficient utilization of data storage is achieved.
Patent Information
- Application Number
- CN202510129856.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-05
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2045-02-05
AI Technical Summary
When the Internet of Vehicles OTA platform processes a large amount of storage space, it occupies a lot of storage space, resulting in excessive storage space.
By obtaining the vehicle reporting data of the target vehicle upgrade task, the task identification data and upgrade progress data in the original vehicle reporting data are saved to the cache, and when determining the data reported by all vehicles, these data are saved permanently, and data compression and encoding technologies are used to reduce storage space requirements.
It effectively reduces the amount of data saved in persistently, reduces the storage space usage, and solves the problem that upgrade progress data occupies a large amount of storage space in the OTA platform of the Internet of Vehicles.
Smart Images

Figure CN119576372B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and in particular, to a method and device for saving vehicle upgrade progress data, an electronic device, and a storage medium. Background Art
[0002] The vehicle networking OTA (Over The Air) platform is an important part of modern intelligent vehicles. It is a technical platform that realizes functions such as vehicle software update, remote fault diagnosis, data collection and analysis, and security management through the Internet and wireless communication networks. The vehicle networking OTA platform plays an important role in ensuring the timely update and optimization of vehicle software. It realizes the remote upgrade and repair of vehicle software through wireless communication technology, thereby improving vehicle performance and safety. At the same time, it can monitor the vehicle operation status in real time, collect and analyze vehicle data, and quickly detect and solve vehicle faults through the remote diagnosis function. At the same time, the vehicle networking OTA platform also provides personalized configuration services, making customized settings according to user needs and driving habits, and providing a more intelligent and convenient driving experience for vehicle owners.
[0003] In the vehicle networking OTA platform, one of the important business functions is to provide monitoring of the download and upgrade progress for operation and maintenance personnel. It is mainly that the upgraded vehicle reports the current upgrade status (controller download / upgrade progress) at a certain time interval during the upgrade process. Since the number of upgraded vehicles is huge in actual commercial scenarios, the OTA platform will receive a large amount of upgrade progress data reports. As a result, the above-mentioned upgrade progress data will occupy a large amount of storage space in the vehicle networking OTA platform.
[0004] Therefore, in the related technology, there is a problem that the upgrade progress data will also occupy a large amount of storage space in the vehicle networking OTA platform. Summary of the Invention
[0005] This application provides a method and device for saving vehicle upgrade progress data, an electronic device, and a storage medium, so as to at least solve the problem that the upgrade progress data will occupy a large amount of storage space in the vehicle networking OTA platform in the related technology.
[0006] According to one aspect of the embodiments of the present application, a method for saving vehicle upgrade progress data is provided, including:
[0007] Obtain at least one piece of vehicle-reported data of a target vehicle upgrade task;
[0008] Save the target task identification data in the original vehicle reported data and the upgrade progress data in each vehicle reported data to the cache, where the original vehicle reported data is the first obtained vehicle reported data in the at least one vehicle reported data, and the target task identification data is used to indicate the target vehicle upgrade task;
[0009] When it is determined that all vehicle reported data for the target vehicle upgrade task has been obtained based on the upgrade progress data, persistently save the upgrade progress data and the target task identification data.
[0010] Optionally, as in the foregoing method, saving the upgrade progress data in each vehicle reported data to the cache includes:
[0011] Extract target field information that meets the preset field type from each vehicle reported data;
[0012] Generate the upgrade progress data based on the target field information;
[0013] Save the upgrade progress data to the cache.
[0014] Optionally, as in the foregoing method, generating the upgrade progress data based on the target field information includes:
[0015] Determine the time difference between the timestamp in the target field information and the timestamp of the original vehicle reported data;
[0016] Determine the upgrade progress value corresponding to each target electronic control unit identification in the target field information, where the target electronic control unit identification is the identification of the electronic control unit for which data upgrade is required for the target vehicle upgrade task;
[0017] Based on the time difference and the upgrade progress value corresponding to each target electronic control unit identification, obtain the upgrade progress data corresponding to each target electronic control unit identification.
[0018] Optionally, as in the foregoing method, when it is determined that all vehicle reported data for the target vehicle upgrade task has been obtained based on the upgrade progress data, persistently saving the upgrade progress data and the target task identification data includes:
[0019] When it is determined based on the upgrade progress data that the upgrade progress of each target electronic control unit identification is completed, determine that all vehicle reported data for the target vehicle upgrade task has been obtained, where the target electronic control unit identification is the identification of the electronic control unit for which data upgrade is required for the target vehicle upgrade task;
[0020] Data compression processing is respectively performed on the current upgrade progress information corresponding to each of the target electronic control unit identifiers to obtain compressed data corresponding to each of the target electronic control unit identifiers, wherein the current upgrade progress information corresponding to each of the target electronic control unit identifiers includes all upgrade progress data corresponding to each of the target electronic control unit identifiers;
[0021] The valid data body composed of the corresponding target electronic control unit identifier, the compressed data, and the target task identifier data is stored in a database.
[0022] Optionally, in the method as described above, the preset field types include: electronic control unit identifier and upgrade progress value.
[0023] Optionally, in the method as described above, the method further includes:
[0024] Obtain specified task identifier data;
[0025] When the specified valid data body corresponding to the specified task identifier data is queried in the database according to the specified task identifier data, data decompression processing is performed on the specified compressed data in the specified valid data body to obtain specified upgrade progress information;
[0026] Display the specified upgrade progress information.
[0027] Optionally, in the method as described above, the task identifier data includes: task identifier and vehicle identification code.
[0028] According to another aspect of the embodiments of the present application, there is also provided a vehicle upgrade progress data saving device, including:
[0029] An obtaining module, configured to obtain at least one piece of vehicle reported data of a target vehicle upgrade task;
[0030] A caching module, configured to save the target task identifier data in the original vehicle reported data and the upgrade progress data in each piece of vehicle reported data to a cache, wherein the original vehicle reported data is the first obtained vehicle reported data in the at least one piece of vehicle reported data, and the target task identifier data is used to indicate the target vehicle upgrade task;
[0031] A saving module, configured to perform persistent saving on the upgrade progress data and the target task identifier data when it is determined based on the upgrade progress data that all vehicle reported data of the target vehicle upgrade task has been obtained.
[0032] According to another aspect of the embodiments of the present application, an electronic device is further provided, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus. Among them, the memory is used to store a computer program. The processor is used to execute the method steps in any of the above embodiments by running the computer program stored on the memory.
[0033] According to another aspect of the embodiments of the present application, a computer-readable storage medium is further provided. A computer program is stored in the storage medium. Among them, the computer program is set to execute the method steps in any of the above embodiments when running.
[0034] In the embodiments of the present application, a method of only persistently saving the task identification data and upgrade progress data in the cache is adopted. By saving the task identification data in the original vehicle reporting data, the upgrade progress data in each vehicle reporting data, and the target task identification data to the cache, where the original vehicle reporting data is the vehicle reporting data first obtained in the at least one vehicle reporting data, and the target task identification data is used to indicate the target vehicle upgrade task. In the case of determining that all vehicle reporting data of the target vehicle upgrade task has been obtained based on the at least one vehicle reporting data, the upgrade progress data and the target task identification data are persistently saved. Since each vehicle reporting data contains at least the same task identification data in addition to the upgrade progress data, the method of only saving the task identification data and upgrade progress data in the original vehicle reporting data can achieve the purpose of only saving one task identification data on the basis of saving all upgrade progress data, achieving the technical effect of effectively reducing the amount of data to be persistently saved and reducing the storage space occupation, and further solving the problem that vehicle reporting data in the related art will occupy a large amount of storage space in the vehicle networking OTA platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained according to these drawings without creative efforts.
[0037] Figure 1 It is a schematic flowchart of an optional method for saving vehicle upgrade progress data according to an embodiment of the present application;
[0038] Figure 2 is an alternative implementation according to another embodiment of the present application Figure 1 The schematic flowchart of step S106 in the vehicle upgrade progress data saving method shown;
[0039] Figure 3 is the schematic flowchart of a method for displaying specified upgrade progress information according to an alternative implementation of an embodiment of the present application;
[0040] Figure 4 is the structural block diagram of an alternative vehicle upgrade progress data saving device according to an embodiment of the present application;
[0041] Figure 5 is the structural block diagram of an alternative electronic device according to an embodiment of the present application. Detailed implementation manners
[0042] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0043] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data used may be interchanged under appropriate circumstances so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily need to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0044] According to one aspect of the embodiments of the present application, a vehicle upgrade progress data method is provided. Optionally, in this embodiment, the above vehicle upgrade progress data method may be applied to a hardware environment composed of a terminal and a server. The server is connected to the terminal through a network and can be used to provide services (such as game services, application services, etc.) for the terminal or the client installed on the terminal. A database may be set up on the server or independently of the server to provide data storage services for the server.
[0045] The above network may include, but is not limited to, at least one of the following: a wired network, a wireless network. The above wired network may include, but is not limited to, at least one of the following: a wide area network, a metropolitan area network, a local area network. The above wireless network may include, but is not limited to, at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal is not limited to a PC, a mobile phone, a tablet computer, etc.
[0046] The method for saving vehicle upgrade progress data in the embodiments of the present application can be executed by a server, or can be executed by a terminal, or can also be jointly executed by the server and the terminal. Among them, when the terminal executes the method for saving vehicle upgrade progress data in the embodiments of the present application, it can also be executed by a client installed thereon.
[0047] Taking the execution of the method for saving vehicle upgrade progress data in this embodiment by the server as an example, Figure 1 A method for saving vehicle upgrade progress data provided by an embodiment of the present application includes the following steps:
[0048] Step S102, obtain at least one piece of vehicle reported data of a target vehicle upgrade task.
[0049] The method for saving vehicle upgrade progress data in this embodiment can be applied to scenarios where it is necessary to save the vehicle reported data of a vehicle in a vehicle networking OTA platform.
[0050] The target vehicle upgrade task may be a task of performing program upgrade on one or more ECUs (Electronic Control Units) in the target vehicle.
[0051] When the target vehicle is upgrading according to the target vehicle upgrade task, it will upload its own vehicle reported data to the vehicle networking OTA platform in real time. Optionally, the vehicle reported data can be uploaded at a fixed frequency. For example, it is uploaded once every N seconds, where N can be 1, 2, 3, etc., and no specific limitation is made here; in addition, the vehicle reported data can also be uploaded according to a fixed upgrade progress. For example, it is uploaded once every time M% more of the upgrade progress is completed, where M can be 1, 2, 3, etc., and no specific limitation is made here. It can be seen that in the case where at least one piece of vehicle reported data contains multiple pieces of vehicle reported data, each piece of vehicle reported data is received in sequence.
[0052] Each piece of vehicle reported data will include: at the moment corresponding to each piece of vehicle reported data of the target vehicle, the upgrade progress of each ECU that needs to be upgraded, and the target task identification data of the target vehicle upgrade task.
[0053] Step S104, save the target task identification data in the original vehicle reported data and the upgrade progress data in each piece of vehicle reported data to the cache. The original vehicle reported data is the first obtained vehicle reported data among at least one piece of vehicle reported data, and the target task identification data is used to indicate the target vehicle upgrade task.
[0054] After obtaining at least one piece of vehicle reported data, based on the first received vehicle reported data, that is, the original vehicle reported data, the task identification data corresponding to the target vehicle upgrade task can be determined and cached in the cache. And for the same target vehicle upgrade task, the task identification data in all the vehicle reported data corresponding to it is the same. The task identification data includes: a task identifier and a vehicle identification code. Further, it can also include a sessionId (a unique identifier used to identify a user session in network communication). The task identifier can be a task ID. For example, the task ID can be represented by data with "taskId" as a variable. In one optional example, the task ID can be: "taskId":"6a2a6b2a-57ea-4f78-b103-5b3e12fc1b04"; the vehicle identification code can be the vehicle VIN (Vehicle Identification Number), which is a unique code composed of multiple letters or numbers used to uniquely identify each vehicle. The vehicle VIN contains important information about the vehicle, such as the manufacturer, model, production year, configuration, etc. For example, the vehicle identification code can be represented by data with "vin" as a variable. In one optional example, the vehicle identification code can be: "vin":"ca490d9cf77927be0c1b0eff4313abb747ac77d0a99cf5570898d3553996de03".
[0055] In addition, after obtaining at least one piece of vehicle reported data, the upgrade progress data in each piece of vehicle reported data can be determined. The upgrade progress data can include the upgrade progress value corresponding to any one ECU in the vehicle at the reporting moment of the vehicle reported data. And when there are multiple ECUs to be upgraded in the target vehicle upgrade task, each piece of vehicle reported data includes multiple upgrade progress data, and each ECU has a corresponding upgrade progress data to represent the upgrade progress corresponding to each ECU.
[0056] As an alternative implementation, as in the foregoing method, the upgrade progress data in each vehicle reported data can be saved to the cache through the following steps: extract the target field information that meets the preset field type from each vehicle reported data; generate the upgrade progress data according to the target field information; save the upgrade progress data to the cache. That is to say, after obtaining each vehicle reported data, the upgrade progress data can be extracted therefrom according to the preset field type specified in advance. Further, the preset field type includes: electronic control unit identifier and upgrade progress value. Therefore, the target field information extracted from each vehicle reported data can include the corresponding electronic control unit identifier and upgrade progress value, and the data format can be, for example: "electronic control unit identifier": "upgrade progress value".
[0057] As an alternative implementation, as in the foregoing method, the following steps can be adopted to generate the upgrade progress data according to the target field information: determine the time stamp difference between the time stamp in the target field information and the time stamp of the original vehicle reported data; determine the upgrade progress value corresponding to each target electronic control unit identifier in the target field information, where the target electronic control unit identifier is the identifier of the electronic control unit that needs to perform data upgrade for the target vehicle upgrade task; obtain the upgrade progress data based on the time stamp difference and the upgrade progress value corresponding to each target electronic control unit identifier. That is to say, for any target field information, it includes the time stamp reported by the corresponding vehicle reported data and the upgrade progress value corresponding to each electronic control unit identifier, so that the time stamp difference between the time stamp in the target field information and the time stamp of the original vehicle reported data can be calculated. Optionally, the time stamp difference and the upgrade progress value can be concatenated to obtain the upgrade progress information. And, in order to accurately distinguish the time stamp difference and the upgrade progress value, the time stamp difference and the upgrade progress value can be concatenated through a preset first concatenation character. The first concatenation character can be, for example, "=", "~", etc. Exemplarily, when the upgrade progress value in the target field information is 4 and the time stamp difference is 2, the upgrade progress information after concatenation through the concatenation character "=" can be "2=4". When the target electronic control unit identifier is "XXXXX", then the upgrade progress data includes: the corresponding "XXXXX" and "2=4".
[0058] After obtaining the upgrade progress data, the upgrade progress data can be cached. The same target electronic control unit identifier in the upgrade progress data can be queried from the cache, and then the historical upgrade progress information corresponding to the target electronic control unit identifier stored in the cache is updated through the upgrade progress information in the upgrade progress data, so as to achieve the purpose of caching the upgrade progress data. Optionally, the update method can be to connect the upgrade progress information after the historical upgrade progress information. When the target electronic control unit identifier identical to the upgrade progress data does not exist in the cache, it indicates that the upgrade progress data is the upgrade progress data of the target electronic control unit indicated by the first target electronic control unit identifier. Therefore, the target electronic control unit identifier and the upgrade progress information can be correspondingly stored in the cache.
[0059] Optionally, in order to accurately distinguish the upgrade progress information corresponding to each timestamp difference, it can be connected through a preset second connection character. The second information connection character can be, for example, "&", "#", etc. Exemplarily, when the target electronic control unit identifier is "XXXXX", the latest upgrade progress information is "2=4", and the historical upgrade progress information is "0=2", connecting the upgrade progress information "2=4" and the historical upgrade progress information "0=2" through the second connection character "&", the connected upgrade progress information "0=2&2=4" can be obtained, and then the target electronic control unit identifier and the upgrade progress information are connected through a third connection character (such as ":"), and then the upgrade progress data can be obtained: "XXXXX" and "0=2&2=4". Optionally, when caching the upgrade progress data through the data with "progress" as a variable, in one optional example, when the upgrade progress data includes two: and the first upgrade progress data includes "H5_2108011-RM05-2215_0x0002" and "0=1", and the second upgrade progress data includes "H5_2108010-RM02-2311_0x0200" and "0=2":
[0060] "progress": {
[0061] "H5_2108011-RM05-2215_0x0002": “0=1”,
[0062] "H5_2108010-RM02-2311_0x0200": “0=2”
[0063] }
[0064] The upgrade progress information is used to represent the upgrade progress corresponding to two ECUs. That is, the upgrade progress of "H5_2108011-RM05-2215_0x0002" at a timestamp difference of 0 is 1, and the upgrade progress of "H5_2108010-RM02-2311_0x0200" at a timestamp difference of 0 is 2.
[0065] In the cache, the upgrade progress information is cached in the following format:
[0066] deltaTime1=progressValue1&deltaTime2=progressValue2&deltaTime3=progressValue3...
[0067] deltaTimeX is the difference between the timestamp of the Xth reported vehicle data and the timestamp of the first reported vehicle data. And since there is no other vehicle-reported data before the first vehicle-reported data, the deltaTime1 of the first vehicle-reported data is 0. If the difference between the timestamp of the second vehicle-reported data and the reported timestamp of the first vehicle-reported data is 2, then deltaTime2 = 2. progressValueX is the upgrade progress value corresponding to deltaTimeX. Optionally, the upgrade progress value can be a value between 0 and 100, used to represent the upgrade progress between 0% and 100%. When the upgrade progress data is: "H5_2108011-RM05-2215_0x0002": "0=1", it can be used to represent that the electronic control unit identifier is H5_2108011-RM05-2215_0x0002, and "0=1" represents that the upgrade progress value at a timestamp difference of 0 is 1. And since it only contains the upgrade progress value at a timestamp difference of 0, this upgrade progress data is generated when only one vehicle-reported data is received. Therefore, the above upgrade progress data can be directly saved in the cache. When the upgrade progress data is: "H5_2108011-RM05-2215_0x0002" and "2=2", "H5_2108011-RM05-2215_0x0002": "0=1&2=2", it can be used to represent that the electronic control unit identifier is H5_2108011-RM05-2215_0x0002, and "0=1&2=2" represents that the upgrade progress value at a timestamp difference of 0 is 1 and the upgrade progress value at a timestamp difference of 2 is 2. Therefore, this upgrade progress data is generated when only 2 vehicle-reported data are received.
[0068] After generating the upgrade progress data based on the above method, the upgrade progress data can be saved to the cache.
[0069] Step S106: When it is determined, based on the upgrade progress data, that all vehicle report data for the target vehicle upgrade task has been obtained, persistently store the upgrade progress data and the target task identification data.
[0070] After obtaining at least one piece of vehicle report data, it can be determined whether the target vehicle upgrade task has been completed based on this. Optionally, it can be determined whether each ECU has completed 100% upgrade according to the upgrade progress data in the last obtained vehicle report data. When each ECU has completed 100% upgrade, it is determined that all vehicle report data for the target vehicle upgrade task has been obtained, and then the upgrade progress data and the target task identification data in the cache can be persistently stored.
[0071] As Figure 2 shown, as an optional implementation manner, for the method as described above, step S106 of persistently storing the upgrade progress data and the target task identification data when it is determined, based on the upgrade progress data, that all vehicle report data for the target vehicle upgrade task has been obtained can be implemented through the following steps:
[0072] Step S202: When it is determined, according to the upgrade progress data, that the upgrade progress of each target electronic control unit is completed, it is determined that all vehicle report data for the target task has been obtained, where the target electronic control unit identification is the identification of the electronic control unit that needs to perform data upgrade for the target vehicle upgrade task.
[0073] After obtaining at least one piece of vehicle report data, it can be determined whether all vehicle report data for the target task has been obtained by determining whether the upgrade progress of each target electronic control unit is completed. For example, when the upgrade progress value is 100, it indicates that the upgrade is completed, and it is determined whether the upgrade progress value of each target electronic control unit is 100.
[0074] Step S204: Perform data compression processing on the current upgrade progress information corresponding to each target electronic control unit identification respectively to obtain compressed data corresponding to each target electronic control unit identification, where the current upgrade progress information corresponding to each target electronic control unit includes all upgrade progress data corresponding to each of the target electronic control units.
[0075] After determining that all vehicle report data for the target task has been obtained, the current upgrade progress information corresponding to each target electronic control unit can be obtained. For the current upgrade progress information corresponding to any one target electronic control unit, it can be composed of all upgrade progress data corresponding to the target electronic control unit. And, data compression processing can be performed on each current upgrade progress information, so as to obtain the compressed data corresponding to each target electronic control unit.
[0076] Further, for each current upgrade progress information, the zlib compression algorithm can be used to compress the combined current upgrade progress information, and data compression processing can be performed in a way of encoding with base64, so as to facilitate storage and transmission.
[0077] For example, after the upgrade progress data of the task is completely reported, the current upgrade progress information of the ECU (H5_2108011-RM05-2215_0x0002) is as follows (100 progress data, reported every two seconds):
[0078] The sample code (python) for adopting the above data compression processing method is as follows:
[0079] import gzip
[0080] import base64
[0081] # Sample data
[0082] data="0=0&2=2&4=3&6=5&8=9&10=11&12=14&14=18&16=19&18=20&20=20&22=21&24=22&26=25&28=27&30=29&32=30&34=31&36=35&38=35&40=35&42=36&44=38&46=39&48=41&50=41&52=43&54=43&56=46&58=49&60=50&62=51&64=54&66=57&68=58&70=60&72=60&74=61&76=62&78=63&80=67&82=69&84=71&86=72&88=74&90=77&92=79&94=80&96=82&98=84&100=86&102=86&104=88&106=89&108=89&110=90&112=91&114=92&116=93&118=94&120=94&122=94&124=94&126=96&128=98&130=100&132=100&134=100&136=100&138=100&140=100&142=100&144=100&146=100&148=100&150=100&152=100&154=100&156=100&158=100&160=100&162=100&164=100&166=100&168=100&170=100&172=100&174=100&176=100&178=100&180=100&182=100&184=100&186=100&188=100&190=100&192=100&194=100&196=100&198=100&200=100"
[0083] # Use gzip compression
[0084] compressed_data = gzip.compress(data.encode('utf-8'))
[0085] # Use Base64 encoding
[0086] encoded_data = base64.b64encode(compressed_data).decode('utf-8')
[0087] print(encoded_data)
[0088] The compressed string (i.e., compressed data) is as follows:
[0089] H4sIAEw / X2UC / 2NkYGBgZOBmZWBgYGDwwAuwYGDABwDwoGyBz0fnkm+dpmUMYIMGAfcIE8SYEGGZA4IUDKZmBgDOQSViYPKpMoVgYQGlDEINULYoNMx4jEwKi2ZBZoZRfyaTmZTEmWYAZFZOI5uWnhuZX6JRkAO+JiW5kpRmZIEklmYiD4CSM8 / AfTgbWEF0OqOAc9RnEMBeDoDU0EEAAtOEn1YwAAAA==
[0090] It can be clearly seen from this that the amount of data has been greatly reduced.
[0091] Step S206: Store the valid data body composed of the corresponding target electronic control unit identifier, compressed data, and target task identifier data in the database.
[0092] After the compressed data corresponding to each target electronic control unit identifier, a one-to-one correspondence between the target electronic control unit identifier and the compressed data can be established. Furthermore, a valid data body can be formed based on this one-to-one correspondence and the target task identifier data, and the valid data body can be stored in the database to achieve persistent storage of the above data.
[0093] When the original valid data body in the cache is composed of the corresponding target electronic control unit identifier, the current upgrade progress information, and the target task identifier data, the compressed data can be used to replace the current upgrade progress information in the original valid data body. After obtaining the new data, it is saved to the database.
[0094] As an optional example, the valid data body before being replaced by the compressed data is as follows:
[0095] {
[0096] "vin": " ca490d9cf77927be0c1b0eff4313abb747ac77d0a99cf5570898d3553996de03",
[0097] "baseTimestamp": 1719459678,
[0098] "progress": {
[0099] "H5_2108011-RM05-2215_0x0002": "0=0&2=2&4=3&6=5&8=9&10=11&12=14&14=18&16=19&18=20&20=20&22=21&24=22&26=25&28=27&30=29&32=30&34=31&36=35&38=35&40=35&42=36&44=38&46=39&48=41&50=41&52=43&54=43&56=46&58=49&60=50&62=51&64=54&66=57&68=58&70=60&72=60&74=61&76=62&78=63&80=67&82=69&84=71&86=72&88=74&90=77&92=79&94=80&96=82&98=84&100=86&102=86&104=88&106=89&108=89&110=90&112=91&114=92&116=93&118=94&120=94&122=94&124=94&126=96&128=98&130=100&132=100&134=100&136=100&138=100&140=100&142=100&144=100&146=100&148=100&150=100&152=100&154=100&156=100&158=100&160=100&162=100&164=100&166=100&168=100&170=100&172=100&174=100&176=100&178=100&180=100&182=100&184=100&186=100&188=100&190=100&192=100&194=100&196=100&198=100&200=100"
[0100] },
[0101] "sessionId": "5ebf686a-b250-40e5-813c-3fb8df5b4b47",
[0102] "taskId": "6a2a6b2a-57ea-4f78-b103-5b3e12fc1b04"
[0103] }
[0104] The effective data body after replacing with compressed data is as follows:
[0105] {
[0106] "vin": "ca490d9cf77927be0c1b0eff4313abb747ac77d0a99cf5570898d3553996de03",
[0107] "baseTimestamp": 1719459678,
[0108] "progress": {
[0109] "H5_2108011-RM05-2215_0x0002": “H4sIAEw / X2UC / 2NkYGBgZOBmZWBgYGDwwAuwYGDABwDwoGyBz0fnkm+dpmUMYIMGAfcIE8SYEGGZA4IUDKZmBgDOQSViYPKpMoVgYQGlDEINULYoNMx4jEwKi2ZBZoZRfyaTmZTEmWYAZFZOI5uWnhuZX6JRkAO+JiW5kpRmZIEklmYiD4CSM8 / AfTgbWEF0OqOAc9RnEMBeDoDU0EEAAtOEn1YwAAAA==”
[0110] },
[0111] "sessionId": "5ebf686a-b250-40e5-813c-3fb8df5b4b47",
[0112] "taskId": "6a2a6b2a-57ea-4f78-b103-5b3e12fc1b04"
[0113] }
[0114] In the embodiment of the present application, a method of only persistently saving the task identification data and the upgrade progress data in the cache is adopted. By saving the task identification data in the original vehicle reporting data, the upgrade progress data in each vehicle reporting data, and the target task identification data to the cache, wherein the original vehicle reporting data is the first obtained vehicle reporting data in the at least one vehicle reporting data, and the target task identification data is used to indicate the target vehicle upgrade task; in the case of determining that all the vehicle reporting data of the target vehicle upgrade task has been obtained based on the at least one vehicle reporting data, the upgrade progress data and the target task identification data are persistently saved. Since each vehicle reporting data contains at least the same task identification data in addition to the upgrade progress data, the method of only saving the task identification data and the upgrade progress data in the original vehicle reporting data can achieve the purpose of only saving one task identification data on the basis of saving all the upgrade progress data, achieving the technical effect of effectively reducing the amount of data to be persistently saved and reducing the storage space occupation, and further solving the problem that the vehicle reporting data in the related art occupies a large amount of storage space in the vehicle network OTA platform.
[0115] As Figure 3 shown, as an optional implementation manner, for the method as described above, the method further includes the following steps:
[0116] Step S302, obtain the specified task identification data;
[0117] Step S304, when the specified valid data body corresponding to the specified task identification data is queried in the database according to the specified task identification data, perform data decompression processing on the specified compressed vehicle reporting data in the specified valid data body to obtain the specified upgrade progress information;
[0118] Step S306, display the specified upgrade progress information.
[0119] When the upgrade progress information needs to be displayed, since the valid data body stored in the database contains the electronic control unit identifier and the compressed data corresponding to each task identification data and corresponding to each other, therefore, the specified task identification data corresponding to the specified task to be displayed can be obtained through query in the database, and then the specified electronic control unit identifier and the specified compressed data contained in the specified valid data body and corresponding to each other can be obtained. Since the specified compressed data is obtained after data compression processing, the specified compressed data can be decompressed by the data decompression processing corresponding to the data compression processing to restore the corresponding specified upgrade progress information. Furthermore, the specified upgrade progress information can be displayed.
[0120] For example, when the task identification data includes a task ID and a VIN code, a specified valid data body can be queried from the database by specifying the task ID and the VIN code as parameters. At this time, the specified compressed data corresponding to each ECU is compressed and encoded. The corresponding reverse function can be used to perform data decompression processing to restore the specified compressed data to the specified upgrade progress information in the following format:
[0121] deltaTime1=progressValue1&deltaTime2=progressValue2&deltaTime3=progressValue3...
[0122] For such a format, at this time, zlib can be used for decompression and base64 inverse encoding. The example code (python) is as follows:
[0123] import gzip
[0124] import base64
[0125] # Compressed and encoded data
[0126] encoded_data="H4sIAEw / X2UC / 2NkYGBgZOBmZWBgYGDwwAuwYGDABwDwoGyBz0fnkm+dpmUMYIMGAfcIE8SYEGGZA4IUDKZmBgDOQSViYPKpMoVgYQGlDEINULYoNMx4jEwKi2ZBZoZRfyaTmZTEmWYAZFZOI5uWnhuZX6JRkAO+JiW5kpRmZIEklmYiD4CSM8 / AfTgbWEF0OqOAc9RnEMBeDoDU0EEAAtOEn1YwAAAA=="
[0127] # Use Base64 decoding
[0128] compressed_data = base64.b64decode(encoded_data)
[0129] # Use gzip decompression
[0130] decompressed_data = gzip.decompress(compressed_data).decode('utf-8')
[0131] print(decompressed_data)
[0132] At this time, the original progress data can be obtained and used as the specified upgrade progress information:
[0133] 0=0&2=2&4=3&6=5&8=9&10=11&12=14&14=18&16=19&18=20&20=20&22=21&24=22&26=25&28=27&30=29&32=30&34=31&36=35&38=35&40=35&42=36&44=38&46=39&48=41&50=41&52=43&54=43&56=46&58=49&60=50&62=51&64=54&66=57&68=58&70=60&72=60&74=61&76=62&78=63&80=67&82=69&84=71&86=72&88=74&90=77&92=79&94=80&96=82&98=84&100=86&102=86&104=88&106=89&108=89&110=90&112=91&114=92&116=93&118=94&120=94&122=94&124=94&126=96&128=98&130=100&132=100&134=100&136=100&138=100&140=100&142=100&144=100&146=100&148=100&150=100&152=100&154=100&156=100&158=100&160=100&162=100&164=100&166=100&168=100&170=100&172=100&174=100&176=100&178=100&180=100&182=100&184=100&186=100&188=100&190=100&192=100&194=100&196=100&198=100&200=100
[0134] In the service, the specified upgrade progress information needs to be disassembled into the interface return result and displayed.
[0135] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0136] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation manner. Based on such an understanding, the technical solution of this application, in essence, or the part that makes a contribution to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM (Read-Only Memory), RAM (Random Access Memory), magnetic disk, optical disk), and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of this application.
[0137] According to another aspect of the embodiments of this application, there is also provided a vehicle upgrade progress data saving device for implementing the above vehicle upgrade progress data saving method. Figure 4 is a structural block diagram of an optional vehicle upgrade progress data saving device according to the embodiments of this application, as Figure 4 shown. The device may include:
[0138] An acquisition module 41, configured to acquire at least one piece of vehicle reported data of a target vehicle upgrade task;
[0139] A cache module 42, configured to save the target task identification data in the original vehicle reported data and the upgrade progress data in each piece of vehicle reported data to the cache, where the original vehicle reported data is the first acquired vehicle reported data among at least one piece of vehicle reported data, and the target task identification data is used to indicate the target vehicle upgrade task;
[0140] A saving module 43, configured to perform persistent saving on the upgrade progress data and the target task identification data when it is determined based on the upgrade progress data that all the vehicle reported data of the target vehicle upgrade task have been acquired.
[0141] It should be noted that the acquisition module 41 in this embodiment can be used to execute the above step S102, the cache module 42 in this embodiment can be used to execute the above step S204, and the storage module 43 in this embodiment can be used to execute the above step S206.
[0142] Through the above modules, by adopting the method of only persistently storing the task identification data and the upgrade progress data in the cache, by storing the task identification data in the original vehicle reported data, the upgrade progress data in each vehicle reported data, and the target task identification data in the cache, wherein the original vehicle reported data is the first obtained vehicle reported data in the at least one vehicle reported data, and the target task identification data is used to indicate the target vehicle upgrade task; in the case of determining that all the vehicle reported data of the target vehicle upgrade task have been obtained based on the at least one vehicle reported data, the upgrade progress data and the target task identification data are persistently stored. Since each vehicle reported data contains at least the same task identification data in addition to the upgrade progress data, the method of only storing the task identification data and the upgrade progress data in the original vehicle reported data can achieve the purpose of only storing one task identification data on the basis of storing all the upgrade progress data, achieving the technical effect of effectively reducing the amount of data to be persistently stored and reducing the storage space occupation, and further solving the problem that the vehicle reported data in the related art will occupy a large amount of storage space in the vehicle networking OTA platform.
[0143] According to another aspect of the embodiments of the present application, there is also provided a vehicle upgrade progress data storage device, including:
[0144] As an optional implementation manner, for the foregoing device, the cache module 42 includes:
[0145] An extraction unit, configured to extract target field information that meets a preset field type from each vehicle reported data;
[0146] A generation unit, configured to generate upgrade progress data according to the target field information;
[0147] A storage unit, configured to store the upgrade progress data in the cache.
[0148] As an optional implementation manner, for the foregoing device, the generation unit is configured to:
[0149] Determine the time stamp difference between the time stamp in the target field information and the time stamp of the original vehicle reported data;
[0150] Determine the upgrade progress value corresponding to each target electronic control unit identifier in the target field information, where the target electronic control unit identifier is the identifier of the electronic control unit that needs to perform data upgrade for the target vehicle upgrade task;
[0151] Based on the time stamp difference and the upgrade progress value corresponding to each target electronic control unit identifier, obtain the upgrade progress data corresponding to each target electronic control unit identifier.
[0152] As an optional implementation manner, for the foregoing device, the storage module 43 is configured as:
[0153] When it is determined according to the upgrade progress data that the upgrade progress of each target electronic control unit identifier is completed, it is determined that all vehicle report data of the target vehicle upgrade task have been obtained, where the target electronic control unit identifier is the identifier of the electronic control unit that needs to perform data upgrade for the target vehicle upgrade task;
[0154] Perform data compression processing on the current upgrade progress information corresponding to each target electronic control unit identifier respectively to obtain the compressed data corresponding to each target electronic control unit identifier, where the current upgrade progress information corresponding to each target electronic control unit identifier includes all upgrade progress data corresponding to each target electronic control unit identifier;
[0155] Store the valid data body composed of the target electronic control unit identifier and the compressed data that correspond to each other, and the target task identifier data in the database.
[0156] As an optional implementation manner, for the foregoing device, the preset field types include: electronic control unit identifier and upgrade progress value.
[0157] As an optional implementation manner, for the foregoing device, it further includes:
[0158] An acquisition module, configured to acquire specified task identifier data;
[0159] A decompression module, configured to perform data decompression processing on the specified compressed data in the specified valid data body when querying in the database according to the specified task identifier data to obtain the specified valid data body corresponding to the specified task identifier data, so as to obtain the specified upgrade progress information;
[0160] A display module, configured to display the specified upgrade progress information.
[0161] As an optional implementation manner, for the foregoing device, the task identifier data includes: task identifier and vehicle identification code.
[0162] In addition to the above modules, the device in this embodiment may further include a module for executing any method in the embodiments of the vehicle upgrade progress data saving method described above.
[0163] It should be noted here that the examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the content disclosed in the above embodiments. It should be noted that the above modules, as a part of the device, can run in the hardware environment for implementing the method as Figure 1 shown, and can be implemented by software or by hardware. Among them, the hardware environment includes a network environment.
[0164] According to another aspect of the embodiments of the present application, an electronic device for implementing the above vehicle upgrade progress data saving method is further provided. The electronic device may be a server, a terminal, or a combination thereof.
[0165] According to another embodiment of the present application, an electronic device is further provided, including: as Figure 5 shown, the electronic device may include a processor 1501, a communication interface 1502, a memory 1503, and a communication bus 1504. Among them, the processor 1501, the communication interface 1502, and the memory 1503 communicate with each other through the communication bus 1504.
[0166] The memory 1503 is used to store a computer program;
[0167] When the processor 1501 is used to execute the program stored in the memory 1503, the following steps are implemented:
[0168] Step S102, obtaining at least one piece of vehicle reported data of a target vehicle upgrade task.
[0169] Step S104, saving the target task identification data in the original vehicle reported data and the upgrade progress data in each piece of vehicle reported data to a cache, where the original vehicle reported data is the first obtained vehicle reported data in at least one piece of vehicle reported data, and the target task identification data is used to indicate the target vehicle upgrade task.
[0170] Step S106, when it is determined based on the upgrade progress data that all the vehicle reported data of the target vehicle upgrade task has been obtained, performing persistent storage on the upgrade progress data and the target task identification data.
[0171] Optionally, in this embodiment, the communication bus described above may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience in representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used for communication between the above-mentioned electronic device and other devices.
[0172] The memory may include a random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.
[0173] As an example, the above-mentioned memory 1503 may but is not limited to include the acquisition module 41, the cache module 42, and the storage module 43 in the above-mentioned vehicle upgrade progress data storage device. In addition, it may also include but is not limited to other module units in the above-mentioned vehicle upgrade progress data storage device, which will not be elaborated in this example.
[0174] The above-mentioned processor may be a general-purpose processor, which may include but is not limited to: a CPU (Central Processing Unit), an NP (Network Processor), etc.; it may also be a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0175] The embodiment of the present application also provides a computer-readable storage medium, and the storage medium includes a stored program, wherein when the program runs, it executes the method steps of the above-mentioned method embodiment.
[0176] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: various media that can store program codes, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disc.
[0177] The serial numbers of the embodiments of the present application above are only for description and do not represent the superiority or inferiority of the embodiments.
[0178] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage media. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in the storage medium and includes several instructions for causing one or more computer devices (which can be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0179] In the above embodiments of the present application, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0180] In the several embodiments provided by the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the units or modules can be in electrical or other forms.
[0181] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.
[0182] In addition, the functional units in the various embodiments of the present application can be integrated in one processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0183] The above are only the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A method for preserving vehicle upgrade progress data, characterized in that: include: Obtain at least one vehicle reporting data of the target vehicle upgrade task; The target task identification data in the original vehicle report data and the upgrade progress data in each vehicle report data are saved in a cache, wherein the original vehicle report data is the vehicle report data obtained for the first time in the at least one vehicle report data, and the target task identification data is used to indicate the target vehicle upgrade task; the upgrade progress data includes a timestamp difference between the timestamp in each vehicle report data and the timestamp of the original vehicle report data, an upgrade progress value, and an electronic control unit identifier, wherein the timestamp difference and the upgrade progress value are connected by a first connecting character to form upgrade progress information, different upgrade progress information are connected by a second connecting character, and the upgrade progress information and the electronic control unit identifier are connected by a third character; When it is determined based on the upgrade progress data that all vehicle reporting data of the target vehicle upgrade task has been acquired, the upgrade progress data and the target task identification data are persistently stored.
2. The method according to claim 1, characterized in that After determining that all vehicle reporting data for the target vehicle upgrade task has been obtained, the method further includes: Constructing a valid data body according to the target electronic control unit identification, the current upgrade progress data and the target task identification data; The current upgrade progress data in the valid data body is subjected to data compression processing.
3. The method according to claim 1, characterized in that Save the upgrade progress data in each vehicle report data to the cache, including: Extracting target field information that meets a preset field type from each piece of vehicle reported data; Generate the upgrade progress data according to the target field information; The upgrade progress data is saved in the cache.
4. The method according to claim 3, characterized in that The step of generating the upgrade progress data according to the target field information includes: Determine the timestamp difference between the timestamp in the target field information and the timestamp of the original vehicle reported data; Determine an upgrade progress value corresponding to each target electronic control unit identifier in the target field information, wherein the target electronic control unit identifier is an identifier of an electronic control unit for which data upgrade is required for the target vehicle upgrade task; Based on the timestamp difference and the upgrade progress value corresponding to each target electronic control unit identifier, the upgrade progress data corresponding to each target electronic control unit identifier is obtained.
5. The method according to claim 1, characterized in that When it is determined based on the upgrade progress data that all vehicle reporting data of the target vehicle upgrade task has been acquired, the upgrade progress data and the target task identification data are persistently saved, including: When it is determined according to the upgrade progress data that the upgrade progress of each target electronic control unit identifier is completed, it is determined that all vehicle reported data of the target vehicle upgrade task has been acquired, wherein the target electronic control unit identifier is the identifier of the electronic control unit for which data upgrade is required for the target vehicle upgrade task; respectively compressing the current upgrade progress data corresponding to each target electronic control unit identifier to obtain compressed data corresponding to each target electronic control unit identifier, wherein the current upgrade progress data corresponding to each target electronic control unit identifier includes all upgrade progress data corresponding to each target electronic control unit identifier; The valid data body consisting of the target electronic control unit identification and the compressed data, and the target task identification data corresponding to each other is stored in a database.
6. The method according to claim 3, characterized in that The preset field types include: electronic control unit identification and upgrade progress value.
7. The method according to any one of claims 1 or 2, characterized in that: The method further comprises: Get the specified task identification data; In the case where a designated valid data body corresponding to the designated task identification data is obtained by querying in a database according to the designated task identification data, decompressing designated compressed data in the designated valid data body to obtain designated upgrade progress information; The specified upgrade progress information is displayed.
8. The method according to any one of claims 1 to 6, characterized in that: The task identification data includes: a task identification and a vehicle identification code.
9. A vehicle upgrade progress data storage device, characterized in that: include: An acquisition module, used to acquire at least one vehicle reporting data of a target vehicle upgrade task; A cache module, used for saving target task identification data in original vehicle reporting data and upgrade progress data in each vehicle reporting data into a cache, wherein the original vehicle reporting data is the vehicle reporting data obtained for the first time in the at least one vehicle reporting data, and the target task identification data is used to indicate the target vehicle upgrade task; the upgrade progress data includes a timestamp difference between the timestamp in each vehicle reporting data and the timestamp of the original vehicle reporting data, an upgrade progress value, and an electronic control unit identifier, wherein the timestamp difference and the upgrade progress value are connected by a first connecting character to form upgrade progress information, different upgrade progress information are connected by a second connecting character, and the upgrade progress information and the electronic control unit identifier are connected by a third character; The saving module is used to persistently save the upgrade progress data and the target task identification data when it is determined based on the upgrade progress data that all vehicle reporting data of the target vehicle upgrade task has been obtained.
10. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein: The processor, the communication interface and the memory communicate with each other via the communication bus, wherein: The memory is used to store computer programs; The processor is configured to execute the method according to any one of claims 1 to 8 by running the computer program stored in the memory.
11. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 8 when executed.
Citation Information
Patent Citations
Wire tightener
CA130100A
Time series data storage method and device, computer equipment and storage medium
CN110633277A
Data compression storage method and device, vehicle and storage medium
CN115225725A
Vehicle data processing method and device, electronic equipment and storage medium
CN116955422A