Vehicle over-the-air upgrade method and system
Patent Information
- Application Number
- CN202510473087.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2026-10-23
AI Technical Summary
[0004]目前,传统的车辆OTA升级方式通常依赖集中式数据库存储和管理升级任务,但这种方式存在数据库压力较大、扩展性差、无法高效处理大规模数据等问题
[0008]本发明的有益效果在于:将灰度升级策略配置信息以键值对形式存储至缓存中,根据灰度升级策略配置信息筛选每一灰度批次对应的待升级车辆的入网序号集合,并使用缓存将每一灰度批次对应的待升级车辆的入网序号集合存储为位图缓存数据,获取与当前正在执行的灰度批次序号对应的位图缓存数据,并基于位图缓存数据下发灰度升级任务至待升级车辆,更新当前正在执行的灰度批次序号,并返回进行下一批次的升级,以此利用缓存的高效读写能力,大幅提升灰度升级策略的配置与执行效率,减少数据库访问压力,且使用缓存存储每一灰度批次对应的待升级车辆的入网序号集合,以便快速访问和动态修改,能够支持灵活配置灰度升级策略,并可根据实际需求进行个性化调整,从而有效提高了OTA升级的整体效率和灵活性。
Smart Images

Figure CN122963571A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of OTA upgrade technology, and in particular to a vehicle OTA upgrade method and system. Background Technology
[0002] As vehicles become increasingly intelligent, over-the-air (OTA) software updates have become one of the primary methods for upgrading in-vehicle systems. OTA upgrades allow vehicle manufacturers to push the latest software versions directly to vehicles via wireless networks, optimizing vehicle performance, adding new features, and even fixing known system vulnerabilities. This method reduces the frequency of owners visiting after-sales service centers, improving the convenience and efficiency of vehicle maintenance.
[0003] However, ensuring a smooth, safe, and efficient OTA upgrade process, especially when dealing with thousands of vehicles, remains a technical challenge. The vehicle upgrade process requires not only precise control of the upgrade time for each vehicle but also ensuring the reasonable allocation and batch execution of upgrade tasks to avoid the risk of system crashes or upgrade failures.
[0004] Currently, traditional vehicle OTA upgrade methods typically rely on centralized database storage and management of upgrade tasks. However, this approach suffers from problems such as high database pressure, poor scalability, and inability to efficiently handle large-scale data. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a vehicle OTA upgrade method and system that can effectively improve the overall efficiency and flexibility of OTA upgrades.
[0006] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: A vehicle OTA upgrade method includes the following steps: Determine the configuration information for the gray-scale upgrade strategy, and store the configuration information for the gray-scale upgrade strategy in the cache in the form of key-value pairs; The set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch is filtered according to the gray-scale upgrade strategy configuration information, and the set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch is stored as bitmap cache data using the cache. Get the sequence number of the currently executing grayscale batch; Obtain the bitmap cache data corresponding to the currently executing grayscale batch number, and issue the grayscale upgrade task to the vehicle to be upgraded based on the bitmap cache data; Update the currently executing grayscale batch number and determine whether the currently executing grayscale batch number exceeds the maximum grayscale batch number. If not, return to the step of obtaining the bitmap cache data corresponding to the currently executing grayscale batch number. If yes, complete the upgrade.
[0007] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows: A vehicle OTA upgrade system includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps: Determine the configuration information for the gray-scale upgrade strategy, and store the configuration information for the gray-scale upgrade strategy in the cache in the form of key-value pairs; The set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch is filtered according to the gray-scale upgrade strategy configuration information, and the set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch is stored as bitmap cache data using the cache. Get the sequence number of the currently executing grayscale batch; Obtain the bitmap cache data corresponding to the currently executing grayscale batch number, and issue the grayscale upgrade task to the vehicle to be upgraded based on the bitmap cache data; Update the currently executing grayscale batch number and determine whether the currently executing grayscale batch number exceeds the maximum grayscale batch number. If not, return to the step of obtaining the bitmap cache data corresponding to the currently executing grayscale batch number. If yes, complete the upgrade.
[0008] The beneficial effects of this invention are as follows: The gray-scale upgrade strategy configuration information is stored in the cache as key-value pairs. Based on the gray-scale upgrade strategy configuration information, the set of network access numbers of the vehicles to be upgraded corresponding to each gray-scale batch is filtered. The set of network access numbers of the vehicles to be upgraded corresponding to each gray-scale batch is stored as bitmap cache data using the cache. The bitmap cache data corresponding to the currently executing gray-scale batch number is obtained, and gray-scale upgrade tasks are issued to the vehicles to be upgraded based on the bitmap cache data. The currently executing gray-scale batch number is updated, and the process returns to perform the upgrade for the next batch. This utilizes the efficient read / write capabilities of the cache to significantly improve the configuration and execution efficiency of the gray-scale upgrade strategy, reduce database access pressure, and use the cache to store the set of network access numbers of the vehicles to be upgraded corresponding to each gray-scale batch for quick access and dynamic modification. This supports flexible configuration of the gray-scale upgrade strategy and allows for personalized adjustments according to actual needs, thereby effectively improving the overall efficiency and flexibility of OTA upgrades. Attached Figure Description
[0009] Figure 1This is a flowchart illustrating the steps of a vehicle OTA upgrade method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a vehicle OTA upgrade system according to an embodiment of the present invention; Figure 3 This is a flowchart illustrating a vehicle OTA upgrade method according to an embodiment of the present invention. Detailed Implementation
[0010] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0011] Please refer to Figure 1 A method for over-the-air (OTA) upgrade of a vehicle, comprising the following steps: Determine the configuration information for the gray-scale upgrade strategy, and store the configuration information for the gray-scale upgrade strategy in the cache in the form of key-value pairs; The set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch is filtered according to the gray-scale upgrade strategy configuration information, and the set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch is stored as bitmap cache data using the cache. Get the sequence number of the currently executing grayscale batch; Obtain the bitmap cache data corresponding to the currently executing grayscale batch number, and issue the grayscale upgrade task to the vehicle to be upgraded based on the bitmap cache data; Update the currently executing grayscale batch number and determine whether the currently executing grayscale batch number exceeds the maximum grayscale batch number. If not, return to the step of obtaining the bitmap cache data corresponding to the currently executing grayscale batch number. If yes, complete the upgrade.
[0012] As can be seen from the above description, the beneficial effects of the present invention are as follows: The gray-scale upgrade strategy configuration information is stored in the cache in key-value pairs; the set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch is filtered according to the gray-scale upgrade strategy configuration information; the set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch is stored as bitmap cache data using the cache; the bitmap cache data corresponding to the currently executing gray-scale batch serial number is obtained; and the gray-scale upgrade task is issued to the vehicles to be upgraded based on the bitmap cache data; the currently executing gray-scale batch serial number is updated; and the next batch upgrade is performed. This utilizes the efficient read / write capabilities of the cache to significantly improve the configuration and execution efficiency of the gray-scale upgrade strategy, reduce database access pressure, and use the cache to store the set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch for quick access and dynamic modification. This supports flexible configuration of the gray-scale upgrade strategy and allows for personalized adjustments according to actual needs, thereby effectively improving the overall efficiency and flexibility of OTA upgrades.
[0013] Furthermore, the gray-scale upgrade strategy configuration information includes all gray-scale upgrade tasks and the key parameters corresponding to the gray-scale upgrade tasks; The key parameters include the gray-scale batch number, the number of upgraded vehicles corresponding to the gray-scale batch number, and the gray-scale upgrade order strategy. The step of filtering the set of network access serial numbers of vehicles to be upgraded corresponding to each gray-scale batch according to the gray-scale upgrade strategy configuration information includes: According to the gray-scale upgrade order strategy, the set of network access serial numbers of vehicles to be upgraded corresponding to each gray-scale batch is selected based on the number of upgrade vehicles corresponding to the gray-scale batch serial number.
[0014] As described above, by following the gray-scale upgrade sequence strategy and filtering the set of network access serial numbers of vehicles to be upgraded corresponding to each gray-scale batch number, the number of vehicles to be upgraded in each gray-scale batch can be controlled. This avoids excessive pressure on server and network resources caused by a large number of vehicles being upgraded at the same time, improves system response speed, and thus improves upgrade efficiency.
[0015] Furthermore, before obtaining the currently executing grayscale batch number, the process also includes: Initialize the sequence number of the currently executing grayscale batch; The cache is used to store the sequence number of the currently executing grayscale batch.
[0016] As described above, the current grayscale batch number is initialized and stored in a cache for future reference to determine which batch needs to be upgraded.
[0017] Furthermore, the bitmap cache data includes the network access number of the vehicle to be upgraded and the bitmap data corresponding to the network access number; The step of sending the gray-scale upgrade task to the vehicle to be upgraded based on the bitmap cache data includes: If the vehicle to be upgraded is determined to be online based on its network access serial number, then the bitmap data corresponding to the network access serial number is queried. If the bitmap data is a first preset value, then the grayscale upgrade task is sent to the vehicle to be upgraded. If the vehicle to be upgraded is determined to be offline based on its network access serial number, the gray-scale upgrade task will not be sent to the vehicle to be upgraded. It will also determine whether an upgrade task detection request has been received from the vehicle to be upgraded. If so, the bitmap data corresponding to the network access serial number will be queried. If the bitmap data is a first preset value, the gray-scale upgrade task will be sent to the vehicle to be upgraded.
[0018] As described above, the system can accurately push upgrade tasks to eligible online vehicles and does not issue upgrade tasks when the vehicle is offline. This avoids potential conflicts and errors that may occur when multiple upgrade tasks are processed simultaneously after the vehicle comes online. By issuing tasks in an orderly manner based on the vehicle status and upgrade conditions, the stability and reliability of OTA upgrades are guaranteed.
[0019] Furthermore, updating the currently executing grayscale batch number includes: Obtain the upgrade information reported by the vehicle to be upgraded, the upgrade information including the upgrade status; The number of successful upgrades and the number of failed upgrades corresponding to the currently executing grayscale batch number are determined based on the upgrade status. The success rate is calculated based on the number of successful upgrades and the number of failed upgrades corresponding to the currently executing grayscale batch number. If the success rate reaches the preset success rate, then the sequence number of the currently executing grayscale batch is incremented by one.
[0020] As described above, by acquiring the upgrade information of each vehicle to be upgraded, the upgrade status of vehicles in the current gray-scale batch can be accurately grasped, the gray-scale batch upgrade can be gradually promoted, and the decision to enter the next batch can be made based on the success rate. This can control the losses caused by upgrade failures to a small extent, ensure the reliability of OTA upgrades, and automatically decide whether to increment the sequence number of the currently executing gray-scale batch based on the success rate, thus realizing the automated advancement of the upgrade process.
[0021] Please refer to Figure 2 A vehicle OTA upgrade system includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps: Determine the configuration information for the gray-scale upgrade strategy, and store the configuration information for the gray-scale upgrade strategy in the cache in the form of key-value pairs; The set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch is filtered according to the gray-scale upgrade strategy configuration information, and the set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch is stored as bitmap cache data using the cache. Get the sequence number of the currently executing grayscale batch; Obtain the bitmap cache data corresponding to the currently executing grayscale batch number, and issue the grayscale upgrade task to the vehicle to be upgraded based on the bitmap cache data; Update the currently executing grayscale batch number and determine whether the currently executing grayscale batch number exceeds the maximum grayscale batch number. If not, return to the step of obtaining the bitmap cache data corresponding to the currently executing grayscale batch number. If yes, complete the upgrade.
[0022] As can be seen from the above description, the beneficial effects of the present invention are as follows: The gray-scale upgrade strategy configuration information is stored in the cache in key-value pairs; the set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch is filtered according to the gray-scale upgrade strategy configuration information; the set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch is stored as bitmap cache data using the cache; the bitmap cache data corresponding to the currently executing gray-scale batch serial number is obtained; and the gray-scale upgrade task is issued to the vehicles to be upgraded based on the bitmap cache data; the currently executing gray-scale batch serial number is updated; and the next batch upgrade is performed. This utilizes the efficient read / write capabilities of the cache to significantly improve the configuration and execution efficiency of the gray-scale upgrade strategy, reduce database access pressure, and use the cache to store the set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch for quick access and dynamic modification. This supports flexible configuration of the gray-scale upgrade strategy and allows for personalized adjustments according to actual needs, thereby effectively improving the overall efficiency and flexibility of OTA upgrades.
[0023] Furthermore, the gray-scale upgrade strategy configuration information includes all gray-scale upgrade tasks and the key parameters corresponding to the gray-scale upgrade tasks; The key parameters include the gray-scale batch number, the number of upgraded vehicles corresponding to the gray-scale batch number, and the gray-scale upgrade order strategy. The step of filtering the set of network access serial numbers of vehicles to be upgraded corresponding to each gray-scale batch according to the gray-scale upgrade strategy configuration information includes: According to the gray-scale upgrade order strategy, the set of network access serial numbers of vehicles to be upgraded corresponding to each gray-scale batch is selected based on the number of upgrade vehicles corresponding to the gray-scale batch serial number.
[0024] As described above, by following the gray-scale upgrade sequence strategy and filtering the set of network access serial numbers of vehicles to be upgraded corresponding to each gray-scale batch number, the number of vehicles to be upgraded in each gray-scale batch can be controlled. This avoids excessive pressure on server and network resources caused by a large number of vehicles being upgraded at the same time, improves system response speed, and thus improves upgrade efficiency.
[0025] Furthermore, before obtaining the currently executing grayscale batch number, the process also includes: Initialize the sequence number of the currently executing grayscale batch; The cache is used to store the sequence number of the currently executing grayscale batch.
[0026] As described above, the current grayscale batch number is initialized and stored in a cache for future reference to determine which batch needs to be upgraded.
[0027] Furthermore, the bitmap cache data includes the network access number of the vehicle to be upgraded and the bitmap data corresponding to the network access number; The step of sending the gray-scale upgrade task to the vehicle to be upgraded based on the bitmap cache data includes: If the vehicle to be upgraded is determined to be online based on its network access serial number, then the bitmap data corresponding to the network access serial number is queried. If the bitmap data is a first preset value, then the grayscale upgrade task is sent to the vehicle to be upgraded. If the vehicle to be upgraded is determined to be offline based on its network access serial number, the gray-scale upgrade task will not be sent to the vehicle to be upgraded. It will also determine whether an upgrade task detection request has been received from the vehicle to be upgraded. If so, the bitmap data corresponding to the network access serial number will be queried. If the bitmap data is a first preset value, the gray-scale upgrade task will be sent to the vehicle to be upgraded.
[0028] As described above, the system can accurately push upgrade tasks to eligible online vehicles and does not issue upgrade tasks when the vehicle is offline. This avoids potential conflicts and errors that may occur when multiple upgrade tasks are processed simultaneously after the vehicle comes online. By issuing tasks in an orderly manner based on the vehicle status and upgrade conditions, the stability and reliability of OTA upgrades are guaranteed.
[0029] Furthermore, updating the currently executing grayscale batch number includes: Obtain the upgrade information reported by the vehicle to be upgraded, the upgrade information including the upgrade status; The number of successful upgrades and the number of failed upgrades corresponding to the currently executing grayscale batch number are determined based on the upgrade status. The success rate is calculated based on the number of successful upgrades and the number of failed upgrades corresponding to the currently executing grayscale batch number. If the success rate reaches the preset success rate, then the sequence number of the currently executing grayscale batch is incremented by one.
[0030] As described above, by acquiring the upgrade information of each vehicle to be upgraded, the upgrade status of vehicles in the current gray-scale batch can be accurately grasped, the gray-scale batch upgrade can be gradually promoted, and the decision to enter the next batch can be made based on the success rate. This can control the losses caused by upgrade failures to a small extent, ensure the reliability of OTA upgrades, and automatically decide whether to increment the sequence number of the currently executing gray-scale batch based on the success rate, thus realizing the automated advancement of the upgrade process.
[0031] The vehicle OTA upgrade method and system described above are applicable to OTA upgrade scenarios, and are further illustrated below through specific embodiments: Please refer to Figure 1 and Figure 3 Embodiment 1 of the present invention is as follows: A vehicle OTA upgrade method includes the following steps: S1. Determine the gray-scale upgrade strategy configuration information and store the gray-scale upgrade strategy configuration information in the cache in the form of key-value pairs.
[0032] The cache is a Redis cache. The gray-scale upgrade strategy configuration information includes all gray-scale upgrade tasks and key parameters corresponding to each task. The key parameters include the gray-scale batch number, the number of vehicles to be upgraded corresponding to the batch number, the preset success rate, and the gray-scale upgrade order strategy. The gray-scale upgrade order strategy refers to the upgrade order of the vehicles, such as sorting by vehicle network access time in descending / ascending order or by vehicle uptime. Each gray-scale upgrade task corresponds to a gray-scale batch number, a number of vehicles to be upgraded, a preset success rate, and a gray-scale upgrade order strategy.
[0033] Administrators can configure canary rollout strategy settings through the system interface or API (Application Programming Interface), such as... Figure 3 As shown.
[0034] The step of filtering the set of network access serial numbers of vehicles to be upgraded corresponding to each gray-scale batch according to the gray-scale upgrade strategy configuration information includes: According to the gray-scale upgrade order strategy, the set of network access serial numbers of vehicles to be upgraded corresponding to each gray-scale batch is selected based on the number of upgrade vehicles corresponding to the gray-scale batch serial number.
[0035] In one alternative implementation, it further includes: Each vehicle to be upgraded is assigned a unique network access number, which is then compressed and stored using the Redis cached RoaringBitmap (an efficient data structure). This ensures the continuity and uniqueness of the vehicle IDs. For example, the network access number of a vehicle to be upgraded can start from 0 and increment sequentially.
[0036] S2. Based on the gray-scale upgrade strategy configuration information, filter the set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch, and use the cache to store the set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch as bitmap cache data, such as... Figure 3 As shown.
[0037] The bitmap cache data includes the network access number of the vehicle to be upgraded and the bitmap data corresponding to the network access number.
[0038] Specifically, Lua scripts are used to execute the SETBIT (a command for manipulating bitmap data structures) operation in batches, mapping the set of network access serial numbers of the vehicles to be upgraded corresponding to each grayscale batch into the bitmap data, thus obtaining bitmap cache data. This optimizes space utilization and search speed.
[0039] The Redis cache data structure is as follows: key: Gray-scale batch number; value: Network access sequence number distribution bitmap cache data. In one alternative implementation, an example of bitmap cache data for a certain grayscale batch is as follows: Network access number: 0123456789; Bitmap data: 1011010100.
[0040] Bitmap data of 1 indicates that the vehicle corresponding to the network access number belongs to the current grayscale batch, and 0 indicates that the vehicle corresponding to the network access number does not belong to the current grayscale batch.
[0041] RoaringBitmap uses block storage, storing only existing entry sequence numbers and optimizing continuous ID ranges to reduce space usage and improve query efficiency.
[0042] S3. Initialize the sequence number of the currently executing grayscale batch.
[0043] For example, initialize the current grayscale batch number to 1.
[0044] S4. Use the cache to store the sequence number of the currently executing grayscale batch.
[0045] Specifically, the SET set cached in Redis is used to store the sequence number of the currently executing grayscale batch.
[0046] The characteristic of the SET set is that it does not allow the storage of duplicate elements. Therefore, it can ensure that there will be no duplicates when storing the sequence number of the currently executing grayscale batch. It ensures that each executing grayscale batch sequence number is recorded only once, avoiding confusion and errors caused by duplicate records, and ensuring the reliability of the upgrade.
[0047] S5. Get the sequence number of the currently executing grayscale batch.
[0048] Specifically, the SMEMBERS command (a command in the Redis database used to manipulate collection data structures) cached in Redis is used to obtain the sequence number of the currently executing grayscale batch.
[0049] There are one or more grayscale batches currently being executed, because as long as a certain upgrade rate is met, the next grayscale batch can be entered, and the previous batch may not have been fully executed.
[0050] S6. Obtain the bitmap cache data corresponding to the currently executing grayscale batch number, and issue the grayscale upgrade task to the vehicle to be upgraded based on the bitmap cache data, such as... Figure 3 As shown, specifically including S61-S63: S61. Obtain the bitmap cache data corresponding to the currently executing grayscale batch number.
[0051] S62. If the vehicle to be upgraded is determined to be online based on its network access number, then query the bitmap data corresponding to the network access number. If the bitmap data is a first preset value, then send the grayscale upgrade task to the vehicle to be upgraded.
[0052] Specifically, querying the bitmap data corresponding to the network entry sequence number involves using the GETBIT command cached in Redis to query the bitmap data corresponding to the network entry sequence number.
[0053] In one alternative implementation, the first preset value is 1.
[0054] S63. If the vehicle to be upgraded is determined to be offline based on its network access serial number, the gray-scale upgrade task will not be sent to the vehicle to be upgraded. It will also determine whether an upgrade task detection request has been received from the vehicle to be upgraded. If so, the bitmap data corresponding to the network access serial number will be queried. If the bitmap data is a first preset value, the gray-scale upgrade task will be sent to the vehicle to be upgraded.
[0055] S7. Update the currently executing grayscale batch number, and determine whether the currently executing grayscale batch number exceeds the maximum grayscale batch number. If not, return to the step of obtaining the bitmap cache data corresponding to the currently executing grayscale batch number. If yes, complete the upgrade, specifically including S71-S75: S71. Obtain the upgrade information reported by the vehicle to be upgraded, the upgrade information including the upgrade status.
[0056] The upgrade status is either successful or failed. In an optional implementation, the upgrade information also includes the current upgrade progress.
[0057] S72. Determine the number of successful upgrades and the number of failed upgrades corresponding to the currently executing grayscale batch number based on the upgrade status.
[0058] Specifically, the INCR command cached in Redis (used to perform an auto-increment operation on the numeric value stored in the specified key) is used to determine the number of successful upgrades and the number of failed upgrades corresponding to the currently executing grayscale batch number based on the upgrade status.
[0059] In one optional implementation, the cache structure for the number of successful upgrades is: KEY: fail_progress_grayscale batch number, VAL: number; the cache structure for the number of failed upgrades is: KEY: suc_progress_grayscale batch number, VAL: number.
[0060] S73. Calculate the success rate based on the number of successful upgrades and the number of failed upgrades corresponding to the currently executing grayscale batch number.
[0061] Specifically, the success rate is calculated using a timed trigger based on the number of successful upgrades and the number of failed upgrades corresponding to the currently executing grayscale batch sequence number, such as... Figure 3 As shown.
[0062] The success rate is calculated as follows: Success rate = Number of successful upgrades / (Number of successful upgrades + Number of failed upgrades).
[0063] S74. If the success rate reaches the preset success rate, the sequence number of the currently executing grayscale batch is incremented by one; otherwise, the current batch is monitored. If the monitoring exceeds the preset time, the next batch is started manually.
[0064] The system will reserve an operation entry point, and write the sequence number of the next gray-scale batch into the SET set of S4 through the SADD command cached in Redis, thereby starting the next gray-scale batch.
[0065] S75. Determine whether the currently executing grayscale batch number exceeds the maximum grayscale batch number. If not, return to execute S6. If yes, it means that the upgrade of all batches has been completed.
[0066] In one alternative implementation, such as Figure 3 As shown, S7 also includes: The Redis cache uses the SET command to cache the maximum gray-scale batch number from the gray-scale upgrade strategy configuration information. This is used to determine whether the upgrade is complete.
[0067] In an alternative implementation, S75 further includes: Clean up the Redis cache associated with the currently running canary batch; Use the SREM command to remove the corresponding currently executing grayscale batch set cache; Use the DEL command to delete the RoaringBitmap cache of the currently executing grayscale batch, thus freeing up system resources.
[0068] In particular, each time a batch is completed, the batch information in Redis is updated and cleaned up in a timely manner to ensure the real-time and accuracy of the system status.
[0069] This invention significantly improves the configuration and execution efficiency of canary upgrade strategies by leveraging the high-efficiency read and write capabilities of Redis caching, reducing database access pressure. It supports flexible configuration of canary upgrade strategies and allows for personalized adjustments based on actual needs, enhancing upgrade flexibility and enabling intelligent management. Furthermore, it records upgrade progress and status in real time, achieving full control and visualization. Utilizing Redis's rich data structure features (such as RoaringBitmap, sets, and hashes), it achieves efficient space utilization and fast lookup, providing a solid foundation for system expansion. Redis's persistence mechanism and disaster recovery capabilities ensure reliable storage and rapid recovery of upgrade strategies and status information, improving system stability and reliability. This invention has significant technical effects and practical value, and can be widely applied in the field of remote vehicle upgrades, promoting the development of intelligent vehicle upgrade technology.
[0070] Please refer to Figure 2 Embodiment two of the present invention is as follows: A vehicle OTA upgrade system includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the various steps of the vehicle OTA upgrade method in Embodiment 1.
[0071] In summary, this invention provides a vehicle OTA upgrade method and system. It stores the gray-scale upgrade strategy configuration information in a cache as key-value pairs. Based on the gray-scale upgrade strategy configuration information, it filters the set of network access serial numbers of vehicles to be upgraded corresponding to each gray-scale batch. The cache stores the set of network access serial numbers of vehicles to be upgraded corresponding to each gray-scale batch as bitmap cache data. It retrieves the bitmap cache data corresponding to the serial number of the currently executing gray-scale batch and issues gray-scale upgrade tasks to the vehicles to be upgraded based on the bitmap cache data. It updates the serial number of the currently executing gray-scale batch and returns to proceed with the upgrade of the next batch. This leverages the efficient read / write capabilities of the cache to significantly improve the configuration and execution efficiency of the gray-scale upgrade strategy, reduce database access pressure, and uses a cache to store the set of network access serial numbers of vehicles to be upgraded corresponding to each gray-scale batch for quick access and dynamic modification, supporting flexible configuration of gray-scale upgrades. The upgrade strategy can be customized according to actual needs, effectively improving the overall efficiency and flexibility of OTA upgrades. Furthermore, it can accurately push upgrade tasks to eligible online vehicles, refraining from issuing upgrade tasks when vehicles are offline. This avoids potential conflicts and errors that might arise from processing multiple upgrade tasks simultaneously after a vehicle comes online. By issuing tasks in an orderly manner based on vehicle status and upgrade conditions, the stability and reliability of OTA upgrades are guaranteed. Moreover, by acquiring upgrade information for each vehicle to be upgraded, the upgrade status of vehicles in the current gray-scale batch can be accurately grasped, allowing for the gradual advancement of gray-scale batch upgrades. The success rate determines whether to proceed to the next batch, minimizing losses from upgrade failures and ensuring the reliability of OTA upgrades. The system also automatically increments the current gray-scale batch number based on the success rate, automating the upgrade process.
[0072] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A vehicle OTA upgrade method, characterized in that, Including the following steps: Determine the configuration information for the gray-scale upgrade strategy, and store the configuration information for the gray-scale upgrade strategy in the cache in the form of key-value pairs; The set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch is filtered according to the gray-scale upgrade strategy configuration information, and the set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch is stored as bitmap cache data using the cache. Get the sequence number of the currently executing grayscale batch; Obtain the bitmap cache data corresponding to the currently executing grayscale batch number, and issue the grayscale upgrade task to the vehicle to be upgraded based on the bitmap cache data; Update the currently executing grayscale batch number and determine whether the currently executing grayscale batch number exceeds the maximum grayscale batch number. If not, return to the step of obtaining the bitmap cache data corresponding to the currently executing grayscale batch number. If yes, complete the upgrade.
2. The vehicle OTA upgrade method according to claim 1, characterized in that, The gray-scale upgrade strategy configuration information includes all gray-scale upgrade tasks and the key parameters corresponding to the gray-scale upgrade tasks; The key parameters include the gray-scale batch number, the number of upgraded vehicles corresponding to the gray-scale batch number, and the gray-scale upgrade order strategy. The step of filtering the set of network access serial numbers of vehicles to be upgraded corresponding to each gray-scale batch according to the gray-scale upgrade strategy configuration information includes: According to the gray-scale upgrade order strategy, the set of network access serial numbers of vehicles to be upgraded corresponding to each gray-scale batch is selected based on the number of upgrade vehicles corresponding to the gray-scale batch serial number.
3. The vehicle OTA upgrade method according to claim 1, characterized in that, Before obtaining the currently executing grayscale batch number, the process also includes: Initialize the sequence number of the currently executing grayscale batch; The cache is used to store the sequence number of the currently executing grayscale batch.
4. The vehicle OTA upgrade method according to claim 1, characterized in that, The bitmap cache data includes the network access number of the vehicle to be upgraded and the bitmap data corresponding to the network access number; The step of sending the gray-scale upgrade task to the vehicle to be upgraded based on the bitmap cache data includes: If the vehicle to be upgraded is determined to be online based on its network access serial number, then the bitmap data corresponding to the network access serial number is queried. If the bitmap data is a first preset value, then the grayscale upgrade task is sent to the vehicle to be upgraded. If the vehicle to be upgraded is determined to be offline based on its network access serial number, the gray-scale upgrade task will not be sent to the vehicle to be upgraded. It will also determine whether an upgrade task detection request has been received from the vehicle to be upgraded. If so, the bitmap data corresponding to the network access serial number will be queried. If the bitmap data is a first preset value, the gray-scale upgrade task will be sent to the vehicle to be upgraded.
5. A vehicle OTA upgrade method according to claim 1, characterized in that, The update of the currently executing grayscale batch number includes: Obtain the upgrade information reported by the vehicle to be upgraded, the upgrade information including the upgrade status; The number of successful upgrades and the number of failed upgrades corresponding to the currently executing grayscale batch number are determined based on the upgrade status. The success rate is calculated based on the number of successful upgrades and the number of failed upgrades corresponding to the currently executing grayscale batch number. If the success rate reaches the preset success rate, then the sequence number of the currently executing grayscale batch is incremented by one.
6. A vehicle OTA upgrade system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it performs the following steps: Determine the configuration information for the gray-scale upgrade strategy, and store the configuration information for the gray-scale upgrade strategy in the cache in the form of key-value pairs; The set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch is filtered according to the gray-scale upgrade strategy configuration information, and the set of network access serial numbers of the vehicles to be upgraded corresponding to each gray-scale batch is stored as bitmap cache data using the cache. Get the sequence number of the currently executing grayscale batch; Obtain the bitmap cache data corresponding to the currently executing grayscale batch number, and issue the grayscale upgrade task to the vehicle to be upgraded based on the bitmap cache data; Update the currently executing grayscale batch number and determine whether the currently executing grayscale batch number exceeds the maximum grayscale batch number. If not, return to the step of obtaining the bitmap cache data corresponding to the currently executing grayscale batch number. If yes, complete the upgrade.
7. A vehicle OTA upgrade system according to claim 6, characterized in that, The gray-scale upgrade strategy configuration information includes all gray-scale upgrade tasks and the key parameters corresponding to the gray-scale upgrade tasks; The key parameters include the gray-scale batch number, the number of upgraded vehicles corresponding to the gray-scale batch number, and the gray-scale upgrade order strategy. The step of filtering the set of network access serial numbers of vehicles to be upgraded corresponding to each gray-scale batch according to the gray-scale upgrade strategy configuration information includes: According to the gray-scale upgrade order strategy, the set of network access serial numbers of vehicles to be upgraded corresponding to each gray-scale batch is selected based on the number of upgrade vehicles corresponding to the gray-scale batch serial number.
8. A vehicle OTA upgrade system according to claim 6, characterized in that, Before obtaining the currently executing grayscale batch number, the process also includes: Initialize the sequence number of the currently executing grayscale batch; The cache is used to store the sequence number of the currently executing grayscale batch.
9. A vehicle OTA upgrade system according to claim 6, characterized in that, The bitmap cache data includes the network access number of the vehicle to be upgraded and the bitmap data corresponding to the network access number; The step of sending the gray-scale upgrade task to the vehicle to be upgraded based on the bitmap cache data includes: If the vehicle to be upgraded is determined to be online based on its network access serial number, then the bitmap data corresponding to the network access serial number is queried. If the bitmap data is a first preset value, then the grayscale upgrade task is sent to the vehicle to be upgraded. If the vehicle to be upgraded is determined to be offline based on its network access serial number, the gray-scale upgrade task will not be sent to the vehicle to be upgraded. It will also determine whether an upgrade task detection request has been received from the vehicle to be upgraded. If so, the bitmap data corresponding to the network access serial number will be queried. If the bitmap data is a first preset value, the gray-scale upgrade task will be sent to the vehicle to be upgraded.
10. A vehicle OTA upgrade system according to claim 6, characterized in that, The update of the currently executing grayscale batch number includes: Obtain the upgrade information reported by the vehicle to be upgraded, the upgrade information including the upgrade status; The number of successful upgrades and the number of failed upgrades corresponding to the currently executing grayscale batch number are determined based on the upgrade status. The success rate is calculated based on the number of successful upgrades and the number of failed upgrades corresponding to the currently executing grayscale batch number. If the success rate reaches the preset success rate, then the sequence number of the currently executing grayscale batch is incremented by one.