An upgrade method, an upgrade device, a user equipment and a storage medium
By bundling the upgrade files of the application and boot program and performing compatibility verification, the incompatibility problems in user equipment caused by individual upgrades are solved, system stability and upgrade efficiency are improved, and different system architectures are adapted to different system architectures.
Patent Information
- Application Number
- CN202411202803.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2044-08-29
AI Technical Summary
In the prior art, user equipment may easily lead to incompatibility problems when upgrading applications and boot programs separately, affecting system stability and maintainability.
By obtaining the upgrade file of the first target program and the upgrade file of the second target program, performing bundled upgrades to ensure high compatibility between the application and the boot program, and upgrading in a dual-partition or single-partition system, combining the driver configuration compatibility check and message configuration consistency check to ensure the upgrade is successful.
Improves the system stability and maintainability of user equipment, reduces upgrade time, avoids unpredictable errors caused by configuration conflicts, and improves upgrade efficiency and adaptability.
Smart Images

Figure CN118708212B_ABST
Abstract
Description
Technical Field
[0001] This application relates to, but is not limited to, the field of software upgrade, and particularly relates to an upgrade method, an upgrade device, a user equipment, and a storage medium. Background Art
[0002] With the rapid development of software technology, software-defined devices have become a mainstream trend. To adapt to this trend, user equipment needs to achieve continuous evolution and upgrade through continuous software updates.
[0003] In related technologies, when performing software upgrade on user equipment, a solution of separately upgrading the application program and the boot program is usually adopted. In this way, it is easy to cause incompatibility problems between the application program and the boot program in the user equipment. Summary of the Invention
[0004] In view of this, embodiments of this application provide an upgrade method, an upgrade device, a user equipment, and a storage medium.
[0005] The technical solution of this application is implemented as follows:
[0006] In a first aspect, an embodiment of this application provides an upgrade method. The upgrade method is applied to a user equipment, and a boot program and at least one application program are installed on the user equipment. The upgrade method includes: in response to an upgrade request for a first target program, obtaining a first upgrade file of the first target program from a server; the first target program is the boot program or a first application program, and the first application program is any one of the at least one application program; determining a compatibility result between the first upgrade file and a preset program of the current version, and determining a preset program with an incompatible compatibility result in the preset program of the current version as a second target program; wherein, if the type of the first target program is an application program, the type of the preset program of the current version is the boot program, and if the type of the first target program is the boot program, the type of the preset program of the current version is the application program; determining a compatible version identifier of the second target program based on the version identifier of the first target program in the upgrade request; obtaining a second upgrade file of the second target program based on the compatible version identifier of the second target program; and upgrading the first target program and the second target program based on the first upgrade file and the second upgrade file.
[0007] In the embodiments of the present application, first, by obtaining the first upgrade file of the first target program and the second upgrade file of the second target program, the bundled upgrade of the first target program and the second target program can be realized to ensure the high compatibility between the application program and the boot program in the user device. In this way, not only can the incompatibility problem between the application program and the boot program caused by separately upgrading the application program or the boot program be avoided, but also the system stability and maintainability of the user device can be improved; second, by determining the compatibility result between the first upgrade file and the preset program of the current version, the second target program can be obtained by screening the preset program of the current version based on different compatibility results. In this way, the number of programs to be upgraded during the bundled upgrade of the boot program and the application program can be reduced, thereby reducing the upgrade time and improving the upgrade efficiency.
[0008] In some embodiments, upgrading the first target program and the second target program based on the first upgrade file and the second upgrade file includes: determining the system state of the dual-partition system of the user device; the system state includes an active state or an inactive state; the dual-partition system includes an active area and an inactive area; when the system state of the dual-partition system is in the active state, after writing the first upgrade file and the second upgrade file into the program storage area in the inactive area, perform a partition switch between the inactive area and the active area to complete the upgrade of the first target program and the second target program; when the system state of the dual-partition system is in the inactive state, after writing the first upgrade file and the second upgrade file into the program storage area of the single-partition system of the user device, reset the single-partition system to complete the upgrade of the first target program and the second target program.
[0009] In the embodiments of the present application, by determining the system state of the dual-partition system, the first upgrade file and the second upgrade file can be written into the dual-partition system or the single-partition system according to the different system states of the dual-partition system, so as to complete the upgrade of the first target program and the second target program in the dual-partition system or the single-partition system. In this way, by unifying the bundled upgrade schemes of the two different architectures of the dual-partition system and the single-partition system, the adaptability of the bundled upgrade of the application program and the boot program to the dual-partition system and the single-partition system can be effectively improved without adding additional program control, thereby significantly improving the flexibility and processing efficiency of the user device.
[0010] In some embodiments, the upgrade method further includes: performing a driver configuration compatibility check and / or a message configuration consistency check on the written first upgrade file and the written second upgrade file; when the check passes, restart the operating system of the user device so that the operating system of the user device starts based on the first upgrade file and the second upgrade file.
[0011] In the embodiments of the present application, by first performing a driver configuration compatibility check and / or a message configuration consistency check on the first upgraded file after writing and the second upgraded file after writing, and then restarting, it is possible to identify and troubleshoot in advance possible driver configuration incompatibility problems and message configuration inconsistency problems, ensuring that there will be no fault problems caused by driver configuration incompatibility and / or message configuration inconsistency between the first target program and the second target program after the upgrade is successful. In this way, the reliability, stability, and maintainability of the software upgrade of the user device can be effectively improved, and a series of unpredictable errors caused by potential configuration conflicts can be avoided.
[0012] In some embodiments, performing a driver configuration compatibility check on the first upgraded file after writing and the second upgraded file after writing includes: obtaining the first driver configuration information of the first upgraded file after writing and the second driver configuration information of the second upgraded file after writing; if the first driver configuration information is compatible with the second driver configuration information, determining that the check result of the driver configuration compatibility check passes; if the first driver configuration information is not compatible with the second driver configuration information, determining that the check result of the driver configuration compatibility check fails.
[0013] In the embodiments of the present application, by determining whether the first driver configuration information of the first upgraded file after writing is compatible with the second driver configuration information of the second upgraded file after writing, it is possible to determine whether the check result of the driver configuration compatibility check passes according to different compatibility results. In this way, an accurate determination of the check result of the driver configuration compatibility check can be achieved, and possible driver configuration incompatibility problems can be identified and troubleshot in advance, providing a solid guarantee for the stable upgrade and normal operation of the system.
[0014] In some embodiments, performing a message configuration consistency check on the first upgraded file after writing and the second upgraded file after writing includes: obtaining the first message configuration information of the first upgraded file after writing and the second message configuration information of the second upgraded file after writing; if the first message configuration information is consistent with the second message configuration information, determining that the check result of the message configuration consistency passes; if the first message configuration information is not consistent with the second message configuration information, determining that the check result of the message configuration consistency fails.
[0015] In the embodiments of the present application, by determining whether the first message configuration information of the first upgraded file after writing is consistent with the second message configuration information of the second upgraded file after writing, it is possible to determine whether the check result of the message configuration consistency check passes according to different consistency results. In this way, an accurate determination of the check result of the message configuration consistency check can be achieved, and possible message configuration inconsistency problems can be identified and troubleshot in advance, providing a solid guarantee for the stable upgrade and normal operation of the system.
[0016] In some embodiments, to determine the compatibility result between the first upgrade file and the preset program of the current version, and determine the preset program with an incompatible compatibility result in the preset program of the current version as the second target program, the method includes: when the type of the first target program is a bootloader, determine the compatibility result between the first upgrade file and each application in at least one application of the current version; determine the application with an incompatible compatibility result in the at least one application as the second target program; when the type of the first target program is an application, determine the compatibility result between the first upgrade file and the bootloader of the current version; if the compatibility result between the first upgrade file and the bootloader of the current version is incompatible, determine the bootloader as the second target program.
[0017] In the embodiments of the present application, when the type of the first target program is a bootloader, by determining the compatibility result between the first upgrade file and each application in at least one application, it is possible to screen at least one application or at least one preset application based on different compatibility results to obtain the second target program; when the type of the first target program is an application, by determining the compatibility result between the first upgrade file and the bootloader, it is possible to determine whether the second target program is a bootloader based on different compatibility results. In this way, by determining different second target programs according to different types of the first target program, the upgrade efficiency of bundling and upgrading the bootloader and the application can be improved, and the upgrade requirements in different upgrade scenarios can be met.
[0018] In some embodiments, the upgrade method further includes: when the type of the first target program is a bootloader and the compatibility result between the first upgrade file and each application in at least one application of the current version is compatible, or when the type of the first target program is an application and the compatibility result between the first upgrade file and the bootloader of the current version is compatible, upgrade the first target program based on the first upgrade file.
[0019] In the embodiments of the present application, by determining whether the conditions that the type of the first target program is a bootloader and the compatibility result between the first upgrade file and each application in at least one application of the current version is compatible, and the type of the first target program is an application and the compatibility result between the first upgrade file and the bootloader of the current version is compatible are met, the first target program can be upgraded separately in the above two cases. In this way, not only can the upgrade efficiency be improved, but also unnecessary changes and updates to the second target program can be avoided, thereby maximizing the overall stability of the system.
[0020] In some embodiments, the upgrade method further includes: determining a compatibility result between a first upgrade file and a preset program of the current version, and the historical flashing times of the preset program of the current version; wherein, if the type of the first target program is an application program, the type of the preset program of the current version is a bootloader, and if the type of the first target program is a bootloader, the type of the preset program of the current version is an application program; determining a preset program in the preset program of the current version with an incompatible compatibility result and a historical flashing times less than a first threshold as a second target program.
[0021] In the embodiments of the present application, by determining the compatibility result between the first upgrade file and the preset program of the current version and the historical flashing times of the preset program of the current version, it is possible to screen the preset program of the current version based on different compatibility results and different historical flashing times to obtain a second target program. In this way, the stability risk faced by the user device can be appropriately reduced, the probability of errors and failures of the user device can be minimized as much as possible, and it helps to improve the performance and stability of the user device.
[0022] In a second aspect, the embodiments of the present application provide an upgrade device. The upgrade device is deployed on a user device, and a bootloader and at least one application program are installed on the user device. The upgrade device includes:
[0023] A first acquisition unit, configured to obtain a first upgrade file of a first target program from a server in response to an upgrade request of the first target program; the first target program is a bootloader or a first application program, and the first application program is any one of the at least one application program;
[0024] A first determination unit, configured to determine a compatibility result between the first upgrade file and a preset program of the current version, and determine a preset program with an incompatible compatibility result in the preset program of the current version as a second target program; wherein, if the type of the first target program is an application program, the type of the preset program of the current version is a bootloader, and if the type of the first target program is a bootloader, the type of the preset program of the current version is an application program;
[0025] A second determination unit, configured to determine a compatible version identifier of the second target program based on the version identifier of the first target program in the upgrade request; if the type of the first target program is an application program, the type of the second target program is a bootloader, and if the type of the first target program is a bootloader, the type of the second target program is an application program;
[0026] A second acquisition unit, configured to obtain a second upgrade file of the second target program based on the compatible version identifier of the second target program;
[0027] An upgrade unit, configured to upgrade a first target program and a second target program based on a first upgrade file and a second upgrade file.
[0028] In a third aspect, an embodiment of the present application provides a user device, which includes a memory and a processor. A computer program or instruction is stored on the memory. When the computer program or instruction is executed by the processor, the upgrade method provided in the first aspect above is implemented.
[0029] In a fourth aspect, an embodiment of the present application provides a storage medium, on which a computer program or instruction is stored. When the computer program or instruction is executed by the processor, the upgrade method provided in the first aspect above is implemented.
[0030] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program or instruction. When the computer program or instruction is executed by the processor, the upgrade method provided in the first aspect above is implemented.
[0031] It should be noted that the technical effects of the second aspect to the fifth aspect can refer to the detailed description of the first aspect above, and will not be elaborated here one by one.
[0032] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit the technical solutions of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings herein are incorporated into the specification and form a part of the specification. These drawings illustrate embodiments consistent with the present application and, together with the specification, are used to explain the technical solutions of the present application.
[0034] Figure 1 It is the first optional flowchart of the upgrade method provided by the embodiment of the present application;
[0035] Figure 2 It is the second optional flowchart of the upgrade method provided by the embodiment of the present application;
[0036] Figure 3 It is the third optional flowchart of the upgrade method provided by the embodiment of the present application;
[0037] Figure 4 It is the fourth optional flowchart of the upgrade method provided by the embodiment of the present application;
[0038] Figure 5 It is the fifth optional flowchart of the upgrade method provided by the embodiment of the present application;
[0039] Figure 6 It is the sixth optional flowchart of the upgrade method provided by the embodiment of the present application;
[0040] Figure 7 It is the seventh optional process schematic diagram of the upgrade method provided by the embodiments of the present application;
[0041] Figure 8 It is the eighth optional process schematic diagram of the upgrade method provided by the embodiments of the present application;
[0042] Figure 9 It is the ninth optional process schematic diagram of the upgrade method provided by the embodiments of the present application;
[0043] Figure 10 It is a schematic diagram of the use of the storage area in the update method of the application program provided in the related art;
[0044] Figure 11 It is an optional schematic diagram of partition management in the upgrade method provided by the embodiments of the present application;
[0045] Figure 12 It is a schematic diagram of the use of the storage area in the upgrade method provided by the embodiments of the present application;
[0046] Figure 13 It is an optional structural schematic diagram of the upgrade device provided by the embodiments of the present application;
[0047] Figure 14 It is an optional structural schematic diagram of the user equipment provided by the embodiments of the present application. Detailed implementation manners
[0048] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will further describe the specific technical solutions of the present application in detail with reference to the accompanying drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application but are not used to limit the scope of the present application.
[0049] Unless otherwise defined, all technical and scientific terms used in the present application have the same meanings as those commonly understood by those skilled in the technical field to which the present application belongs. The terms used in the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0050] In the following descriptions, references to "some embodiments", "this embodiment", "embodiments of the present application", and examples, etc., describe subsets of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with each other without conflict.
[0051] If similar descriptions such as "first / second" appear in the application documents, the following description shall be added. In the following description, the terms "first / second / third" involved are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second / third" can be interchanged in a specific order or sequence when permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0052] In the related art, a solution of separately updating the bootloader and the application for in-vehicle controllers has been implemented. Currently, in a real vehicle environment, in-vehicle controllers often encounter incompatibility problems between the updated application and the old bootloader in the board after a single flash of the application software package. For example, reset problems may occur due to incompatible system basis chip (SBC) driver configurations, and abnormal normal flashing may occur due to inconsistent controller area network (CAN) message configurations, etc. The same incompatibility problems also exist after a single flash of the bootloader software package.
[0053] Based on this, the embodiments of the present application provide an upgrade method, an upgrade device, a user device, a storage medium, and a computer program product. In practical applications, the upgrade method can be implemented by the upgrade device, and each functional entity in the upgrade device can be cooperatively implemented by the hardware resources of the user device, such as computing resources of a processor, etc., and communication resources (such as various communication methods used to support optical cables, cellular, etc.).
[0054] Next, the embodiments of the upgrade method, upgrade device, user device, storage medium, and computer program product provided by the embodiments of the present application will be described.
[0055] The embodiments of the present application provide an upgrade method. The functions implemented by this method can be achieved by a processor in the user device calling program code. Of course, the program code can be stored in a computer storage medium. It can be seen that the user device at least includes a processor and a storage medium.
[0056] The upgrade method provided by the embodiments of the present application is applied to a user device, and a bootloader and at least one application are installed on the user device.
[0057] The embodiments of the present application do not limit the specific type of the user device, which can be set according to the actual situation. Exemplarily, the user device can be a vehicle, a computer, a mobile phone, a watch, a tablet, a TV, etc.
[0058] The bootstrap program refers to the program that runs first when the user device starts up, which is used to complete system initialization and prepare for the running of application programs. Exemplarily, system initialization may include detecting whether the hardware devices are normal, establishing a basic running environment, loading necessary system configuration information, etc.; preparing for the running of application programs may include loading necessary driver programs, allocating memory space for application programs, configuring access permissions and encryption mechanisms for application programs, and so on.
[0059] An application program refers to a program that runs on top of an operating system and is used to execute specific tasks or provide specific functions. Exemplarily, application programs installed on vehicle devices can be used to implement auxiliary driving functions, intelligent cockpit adjustment functions, infotainment functions, and so on.
[0060] Next, taking the user device as the execution subject as an example, the upgrade method provided by the embodiments of the present application will be described.
[0061] Refer to Figure 1 the content shown, when applied to a user device, this process may include but is not limited to the following S101 to S105.
[0062] S101. In response to an upgrade request for a first target program, obtain a first upgrade file of the first target program from the server.
[0063] The first target program is a bootstrap program or a first application program, and the first application program is any one of at least one application program.
[0064] The upgrade request refers to a request used to indicate an upgrade of the first target program. The embodiments of the present application do not limit the specific type and content of the upgrade request, which can be set according to actual situations. Exemplarily, in addition to carrying request information used to indicate an upgrade of the first target program, the upgrade request may also carry a version identifier to be upgraded of the first target program. The information carried in the upgrade request will vary according to different protocols, and specific details can be referred to the descriptions in related technologies, which will not be elaborated here.
[0065] In practical applications, after the user device receives an upgrade instruction for the first target program, it will enter the upgrade process of the first target program and start upgrading the first target program.
[0066] The first target program can be a bootstrap program installed on the user device or any application program.
[0067] The first upgrade file refers to the file to be upgraded corresponding to the first target program.
[0068] Exemplarily, a plurality of files to be upgraded for the first target program are pre-stored in the server. Correspondingly, S101 can be implemented as: receiving an upgrade request for the first target program; in response to the upgrade request for the first target program, obtaining the version identifier of the first target program in the upgrade request; searching for the version identifier among the plurality of files to be upgraded in the server, and determining the file to be upgraded corresponding to the version identifier as the first upgrade file of the first target program.
[0069] S102. Determine the compatibility result between the first upgrade file and the preset program of the current version, and determine the preset program with an incompatible compatibility result in the preset program of the current version as the second target program.
[0070] Among them, if the type of the first target program is an application program, the type of the preset program of the current version is a boot program; if the type of the first target program is a boot program, the type of the preset program of the current version is an application program.
[0071] The preset program of the current version refers to the program of the current version with a different type from the first target program that has been installed on the user device. The specific type and quantity of the preset program of the current version in the embodiments of the present application are not limited, and can be set according to actual situations. Exemplarily, when the type of the first target program is a boot program, the preset program of the current version can be all the application programs that have been installed on the user device, or can be some of the application programs that have been installed on the user device. The user can specify some application programs from all the application programs that have been installed on the user device in advance, or can screen some application programs from all the application programs that have been installed on the user device based on specific rules. When the type of the first target program is an application program, the preset program of the current version can be the boot program that has been installed on the user device.
[0072] The second target program can be a program with a different type from the first target program installed on the user device. The specific type and quantity of the second target program in the embodiments of the present application are not limited, and can be set according to actual situations. Exemplarily, if the first target program is any one of at least one application program, the second target program can be a boot program; if the first target program is a boot program, the second target program can be any one of at least one application program.
[0073] It can be understood that if the type of the first target program is an application program, the type of the second target program is a boot program; if the type of the first target program is a boot program, the type of the second target program is an application program.
[0074] Here, the compatibility result is used to characterize whether the first upgrade file is compatible with the preset program of the current version. It can be understood that the compatibility result includes compatible or incompatible.
[0075] Here, whether the first upgrade file is compatible or incompatible with the application program means that after upgrading the first target program with the first upgrade file, the upgraded first target program is compatible or incompatible with the preset program of the current version already installed in the user device.
[0076] Here, since the preset compatibility mapping relationship is used to characterize the corresponding relationship between the application program version identifier and the boot program version identifier, the compatibility result between the first upgrade file and the preset program of the current version can be determined based on the preset compatibility mapping relationship.
[0077] Exemplarily, S102 can be implemented as: searching for the version identifier of the first upgrade file in the preset compatibility mapping relationship; if the version identifier corresponding to the version identifier of the first upgrade file found includes the version identifier of the preset program of the current version, determining that the compatibility result between the first upgrade file and the preset program of the current version is compatible; if the version identifier corresponding to the version identifier of the first upgrade file is not found, or the version identifier corresponding to the version identifier of the first upgrade file found does not include the version identifier of the preset program of the current version, determining that the compatibility result between the first upgrade file and the preset program of the current version is incompatible; determining the preset program with an incompatible compatibility result in the preset program of the current version as the second target program.
[0078] S103. Determine the compatible version identifier of the second target program based on the version identifier of the first target program in the upgrade request.
[0079] The compatible version identifier refers to the version identifier of the second target program that is compatible with the first upgrade file. The specific content and determination method of the compatible version identifier in the embodiments of the present application are not limited and can be set according to actual situations.
[0080] Here, the second target program being compatible with the first upgrade file means that after upgrading the first target program with the first upgrade file, the upgraded first target program and the second target program can run stably and work together in the same system environment, without conflicts or errors with each other, and without causing problems such as system crashes, function abnormalities, or data corruption.
[0081] In practical applications, the preset compatibility mapping relationship can be determined in advance and stored in the user device. The preset compatibility mapping relationship is used to characterize the compatibility relationship between at least one version identifier of each application program in at least one application program and at least one version identifier of the boot program.
[0082] For example, assume that there is 1 boot program and 20 application programs installed on a user device. The boot program has 1 version identifier, and each application program has 3 version identifiers. Then, when the version identifier of the boot program is compatible with each version identifier of each application program, the preset compatibility mapping relationship includes 60 records.
[0083] Here, the preset compatibility mapping relationship can be obtained by performing compatibility tests on application programs of multiple versions and boot programs of multiple versions in advance through human experience, specific algorithms, or specific models. Exemplarily, assume that it is necessary to perform a compatibility test on an application program with version identifier A and a boot program with version identifier B. Then, the application program with version identifier A and the boot program with version identifier B can be installed together on the user device. If either one fails to be installed successfully due to incompatibility issues, it means they are incompatible; if both can be installed successfully, compatibility tests, function tests, performance tests, security tests, etc. can continue to be performed on the user device. If the tests fail due to incompatibility issues, it means they are incompatible; if the tests pass, it means they are compatible with each other. At this time, a corresponding relationship between application program version identifier A and application program version identifier B is established to obtain a preset compatibility mapping relationship. It can be understood that if there is a corresponding relationship between the version identifier A of the application program and the version identifier B of the boot program, it means that the application program with version identifier A and the boot program with version identifier B are compatible with each other.
[0084] Exemplarily, S103 can be implemented as: obtaining the preset compatibility mapping relationship from local or the cloud; the preset compatibility mapping relationship is used to represent the corresponding relationship between the application program version identifier and the boot program version identifier; querying the preset compatibility mapping relationship based on the version identifier of the first target program in the upgrade request to obtain the compatible version identifier of the second target program.
[0085] It can be understood that by pre-determining the compatibility mapping relationship used to represent the corresponding relationship between the application program version identifier and the boot program version identifier, it is possible to determine, based on the compatibility mapping relationship, the compatible version identifier of the second target program that is compatible with the version identifier of the first target program in the upgrade request, and then obtain the second upgrade file of the second target program. In this way, it can provide strong support for implementing the bundled upgrade of the application program and the boot program, and ensure a high degree of compatibility between the application program and the boot program.
[0086] S104. Obtain the second upgrade file of the second target program based on the compatible version identifier of the second target program.
[0087] The second upgrade file refers to the file to be upgraded corresponding to the second target program.
[0088] Exemplarily, a plurality of to-be-upgraded files of the second target program are pre-stored in the user equipment or the server. Correspondingly, S104 may be implemented as: searching for a compatible version identifier among the plurality of to-be-upgraded files in the local or the server, and determining the to-be-upgraded file corresponding to the compatible version identifier as the second upgrade file of the second target program.
[0089] S105. Upgrade the first target program and the second target program based on the first upgrade file and the second upgrade file.
[0090] In a possible implementation manner, S105 may be implemented as: when the system state of the dual-partition system of the user equipment is in an active state, the user equipment writes the first upgrade file and the second upgrade file into the program storage area in the non-active area of the dual-partition system, and resets the dual-partition system, so as to complete the upgrade of the first target program and the second target program.
[0091] It should be noted that the system state of the dual-partition system being in an active state may mean that the dual-partition system can be used safely and normally; on the contrary, the system state of the dual-partition system being in a non-active state may mean that the dual-partition system cannot be used safely and normally.
[0092] In practical applications, according to different functional uses, the dual-partition system of the user equipment may include an active area and a non-active area. The active area refers to the area that is currently in use or in an active state, and the programs or data stored therein are being executed or accessed by the Central Processing Unit (CPU). The non-active area refers to the area that is currently not in use or in a non-active state, and the non-active area is not directly executed or accessed by the CPU, and can be used to store backup programs, backup data, or as a target area for upgrade and switching. In addition, according to different storage plans, the dual-partition system may also include a program storage area for storing program files and a data storage area for storing data files.
[0093] In another possible implementation manner, S105 may be implemented as: when the system state of the dual-partition system of the user equipment is in a non-active state, the user equipment writes the first upgrade file and the second upgrade file into the program storage area of the single-partition system of the user equipment, and resets the single-partition system, so as to complete the upgrade of the first target program and the second target program.
[0094] In practical applications, the single-partition system of the user equipment may also include a program storage area for storing program files and a data storage area for storing data files.
[0095] In the embodiments of the present application, first, by obtaining the first upgrade file of the first target program and the second upgrade file of the second target program, it is possible to implement bundled upgrades for the first target program and the second target program to ensure high compatibility between the application programs and the boot programs in the user device. In this way, not only can the incompatibility problems between the application programs and the boot programs caused by separately upgrading the application programs or the boot programs be avoided, but also the system stability and maintainability of the user device can be improved. Second, by determining the compatibility result between the first upgrade file and the preset program of the current version, it is possible to screen the preset program of the current version based on different compatibility results to obtain the second target program. In this way, the number of programs to be upgraded when bundling upgrades for the boot program and the application program can be reduced, thereby reducing the upgrade time and improving the upgrade efficiency.
[0096] Next, the process of upgrading the first target program and the second target program based on the first upgrade file and the second upgrade file in S105 will be described.
[0097] Refer to Figure 2 the content shown. This process may include but is not limited to the following S201 to S203.
[0098] S201. Determine the system state of the dual - partition system of the user device.
[0099] The system state includes an active state or an inactive state.
[0100] The dual - partition system includes an active area and an inactive area.
[0101] It can be understood that after the user device obtains the first upgrade file and the second upgrade file, it is necessary to first determine the system state of the dual - partition system, and then, according to the different system states of the dual - partition system, select to upgrade the first target program and the second target program in the dual - partition system or the single - partition system.
[0102] Exemplarily, S201 can be implemented as: obtaining a reference field for recording the system state of the dual - partition system; if the reference field represents an active state, determining that the system state of the dual - partition system is the active state; if the reference field represents an inactive state, determining that the system state of the dual - partition system is the inactive state.
[0103] S202. When the system state of the dual - partition system is in the active state, after writing the first upgrade file and the second upgrade file into the program storage area in the inactive area, perform a partition switch between the inactive area and the active area to complete the upgrade of the first target program and the second target program.
[0104] Here, the program storage area in the inactive area of the dual - partition system refers to the area in the inactive area of the dual - partition system used to store program files. It should be noted that since the dual - partition system can include a program storage area for storing program files and a data storage area for storing data files, the inactive area of the dual - partition system can also be divided into a program storage area and a data storage area, and the active area of the dual - partition system is the same.
[0105] Here, when the system state of the dual - partition system is the active state, it means that the dual - partition system can be used safely and normally at present. At this time, the user device can complete the upgrade of the first target program and the second target program in the dual - partition system by writing the first upgrade file and the second upgrade file into the program storage area in the inactive area of the dual - partition system.
[0106] Exemplarily, S202 can be implemented as follows: when the system state of the dual - partition system is the active state, first erase the program storage area in the inactive area of the dual - partition system; then write the first upgrade file and the second upgrade file into the erased program storage area in the inactive area; finally, perform a partition switch between the inactive area and the active area so that the dual - partition system starts based on the first upgrade file and the second upgrade file the next time it starts, thus completing the upgrade of the first target program and the second target program.
[0107] S203: When the system state of the dual - partition system is the inactive state, after writing the first upgrade file and the second upgrade file into the program storage area of the single - partition system of the user device, reset the single - partition system to complete the upgrade of the first target program and the second target program.
[0108] Here, the program storage area of the single - partition system refers to the area in the single - partition system used to store program files. It should be noted that the single - partition system can also include a data storage area for storing data files.
[0109] Here, when the system state of the dual - partition system is the inactive state, it means that the dual - partition system cannot be used safely and normally at present. At this time, the user device can complete the upgrade of the first target program and the second target program in the single - partition system by writing the first upgrade file and the second upgrade file into the program storage area of the single - partition system.
[0110] Exemplarily, S203 can be implemented as follows: When the system state of the dual-partition system is in an inactive state, first erase the program storage area of the single-partition system; then write the first upgrade file and the second upgrade file into the erased program storage area of the single-partition system; finally, restart or reset the single-partition system so that the single-partition system is started based on the first upgrade file and the second upgrade file the next time it is started, thereby completing the upgrade of the first target program and the second target program.
[0111] In the embodiments of the present application, by determining the system state of the dual-partition system, it is possible to write the first upgrade file and the second upgrade file into the dual-partition system or the single-partition system according to the different system states of the dual-partition system, thereby completing the upgrade of the first target program and the second target program in the dual-partition system or the single-partition system. In this way, by unifying the bundling upgrade solutions for the two different architectures of the dual-partition system and the single-partition system, the adaptability of the bundling upgrade of the application program and the boot program to the dual-partition system and the single-partition system can be effectively improved, without adding additional program control, thereby significantly improving the flexibility and processing efficiency of the user device.
[0112] The embodiments of the present application may further include a verification process for the written first upgrade file and the written second upgrade file.
[0113] Referring to Figure 3 the content shown, this process may include but is not limited to the following S301 and S302.
[0114] S301. Perform a driver configuration compatibility check and / or a message configuration consistency check on the written first upgrade file and the written second upgrade file.
[0115] The driver configuration compatibility check is used to verify whether the driver configuration information of the two files is compatible. The specific check content and check method for the driver configuration compatibility check in the embodiments of the present application are not limited and can be set according to the actual situation. Exemplarily, the driver configuration compatibility check may be a deep analysis and comparison of the driver configuration information such as hardware specification descriptions, driver versions, interface parameters, function feature settings, and operating system requirements included in the two files to determine whether these driver configuration information are compatible.
[0116] Message configuration consistency check is used to verify whether the message configuration information of two files is consistent. The specific check content and check method of the message configuration consistency check in the embodiments of the present application are not limited and can be set according to actual situations. Exemplarily, the message configuration consistency check can be to deeply analyze and compare the message configuration information such as message format definition, field length, data type, encoding rule, check bit setting, transmission rate, sending / receiving frequency, etc. included in the two files to determine whether these message configuration information are consistent.
[0117] It can be understood that if the driver configuration compatibility check passes and the message configuration consistency check passes, it means that after upgrading the first target program and the second target program based on the first upgrade file and the second upgrade file, there will be no failure problems caused by driver configuration incompatibility between the upgraded first target program and the second target program, such as function disorder, system crash, device unable to work properly, etc., nor will there be failure problems caused by inconsistent message configuration, such as communication anomaly, data transmission error, data corruption, etc.
[0118] In one possible implementation manner, S301 can be implemented as: obtaining the driver configuration information in the written first upgrade file and the driver configuration information in the written second upgrade file; performing a compatibility check on the above two driver configuration information to obtain a driver configuration compatibility check result.
[0119] In another possible implementation manner, S301 can be implemented as: obtaining the message configuration information in the written first upgrade file and the message configuration information in the written second upgrade file; performing a consistency check on the above two message configuration information to obtain a message configuration consistency check result.
[0120] In another possible implementation manner, S301 can be implemented as: obtaining the driver configuration information and message configuration information in the written first upgrade file and the driver configuration information and message configuration information in the written second upgrade file; performing a compatibility check on the above two driver configuration information to obtain a driver configuration compatibility check result, and performing a consistency check on the above two message configuration information to obtain a message configuration consistency check result.
[0121] S302. In the case where the check passes, restart the operating system of the user device so that the operating system is started based on the first upgrade file and the second upgrade file.
[0122] Here, passing the verification means that both the driver configuration compatibility verification and the message configuration consistency verification are passed. The following three situations, namely, the driver configuration compatibility verification is passed but the message configuration consistency verification is not passed, the driver configuration compatibility verification is not passed but the message configuration consistency verification is passed, and both the driver configuration compatibility verification and the message configuration consistency verification are not passed, are all regarded as failing the verification.
[0123] It can be understood that after the upgrade file is successfully written and the verification is passed, it is also necessary to restart the operating system of the user device. The restart operation can make the configurations and changes in the newly written upgrade file take effect, ensuring that the system can operate according to the latest optimizations and fixes.
[0124] Exemplarily, S302 can be implemented as follows: when both the driver configuration compatibility verification and the message configuration consistency verification are passed, restart the operating system of the user device; when the operating system of the user device restarts, it identifies and loads the first upgrade file and the second upgrade file for startup.
[0125] In the embodiments of the present application, by first performing driver configuration compatibility verification and / or message configuration consistency verification on the written first upgrade file and the written second upgrade file and then restarting, it is possible to identify and troubleshoot in advance possible driver configuration incompatibility problems and message configuration inconsistency problems, ensuring that there will be no failure problems caused by driver configuration incompatibility and / or message configuration inconsistency between the first target program and the second target program after the upgrade is successful. In this way, the reliability, stability, and maintainability of the software upgrade of the user device can be effectively improved, and a series of unpredictable errors caused by potential configuration conflicts can be avoided.
[0126] Next, the process of S301 performing driver configuration compatibility verification on the written first upgrade file and the written second upgrade file will be described.
[0127] Referring to Figure 4 the content shown, the method may include but is not limited to the following S401 to S403.
[0128] S401: Obtain the first driver configuration information of the written first upgrade file and the second driver configuration information of the written second upgrade file.
[0129] The first driver configuration information refers to the driver configuration information included in the first upgrade file.
[0130] The second driver configuration information refers to the driver configuration information included in the second upgrade file.
[0131] The embodiments of the present application do not limit the specific content and quantity of the first drive configuration information and the second drive configuration information, which can be determined according to the actual situation. Exemplarily, the drive configuration information may include hardware specification descriptions, drive versions, interface parameters, function characteristic settings, operating system requirements, and so on.
[0132] In a possible implementation manner, when the upgrade file includes a drive configuration file specifically for storing drive configuration information, S401 may be implemented as: reading the drive configuration file in the written first upgrade file, and determining the content read as the first drive configuration information of the first upgrade file; the user device reads the drive configuration file in the written second upgrade file, and determines the content read as the second drive configuration information of the second upgrade file.
[0133] In another possible implementation manner, when the upgrade file does not include a drive configuration file specifically for storing drive configuration information, S401 may be implemented as: searching for content related to drive configuration in the first upgrade file, analyzing and integrating the found content, and determining the content after analysis and integration as the first drive configuration information of the first upgrade file; the user device searches for content related to drive configuration in the second upgrade file, analyzes and integrates the found content, and determines the content after analysis and integration as the second drive configuration information of the second upgrade file.
[0134] S402, if the first drive configuration information and the second drive configuration information are mutually compatible, the user device determines that the verification result of the drive configuration compatibility verification is verification passed.
[0135] S403, if the first drive configuration information and the second drive configuration information are mutually incompatible, the user device determines that the verification result of the drive configuration compatibility verification is verification failed.
[0136] Here, exemplarily, a correspondence relationship between the first drive configuration information and the second drive configuration information is pre-stored in the user device, and this correspondence relationship is obtained by pre-conducting compatibility tests on multiple first drive configuration information and multiple second drive configuration information through human experience or specific algorithms or specific models. Among them, if there is a correspondence relationship between the first drive configuration information and the second drive configuration information, it means that the first drive configuration information and the second drive configuration information are mutually compatible.
[0137] Correspondingly, S402 may be implemented as: searching for the drive configuration information corresponding to the first drive configuration information in this correspondence relationship; if the found drive configuration information corresponding to the first drive configuration information is the second drive configuration information, it is determined that the first drive configuration information and the second drive configuration information are mutually compatible, and the verification result of the drive configuration compatibility verification is verification passed.
[0138] Correspondingly, S403 may be implemented as: searching for the drive configuration information corresponding to the first drive configuration information in this correspondence relationship; if the drive configuration information corresponding to the first drive configuration information is not found, or the drive configuration information corresponding to the first drive configuration information found is not the second drive configuration information, it is determined that the first drive configuration information and the second drive configuration information are incompatible with each other, and the verification result of the drive configuration compatibility verification fails.
[0139] In the embodiments of the present application, by determining whether the first drive configuration information of the first upgrade file after writing is compatible with the second drive configuration information of the second upgrade file after writing, it is possible to determine whether the verification result of the drive configuration compatibility verification passes according to different compatibility results. In this way, it is possible to accurately determine the verification result of the drive configuration compatibility verification, identify and troubleshoot possible drive configuration incompatibility problems in advance, and provide a solid guarantee for the stable upgrade and normal operation of the system.
[0140] Next, the process of S301 performing message configuration consistency verification on the first upgrade file after writing and the second upgrade file after writing will be described.
[0141] Refer to Figure 5 As shown in the content, this method may include but is not limited to the following S501 to S503.
[0142] S501. Obtain the first message configuration information of the first upgrade file after writing, and the second message configuration information of the second upgrade file after writing.
[0143] The first message configuration information refers to the message configuration information included in the first upgrade file.
[0144] The second message configuration information refers to the message configuration information included in the second upgrade file.
[0145] In the embodiments of the present application, the specific content and quantity of the first message configuration information and the second message configuration information are not limited, and can be determined according to the actual situation. Exemplarily, the message configuration information may include message format definition, field length, data type, encoding rule, check bit setting, transmission rate, sending / receiving frequency, etc.
[0146] In a possible implementation manner, when the upgrade file includes a message configuration file specifically used to store message configuration information, S501 may be implemented as: reading the message configuration file in the first upgrade file after writing, and determining the read content as the first message configuration information of the first upgrade file; the user device reads the message configuration file in the second upgrade file after writing, and determines the read content as the second message configuration information of the second upgrade file.
[0147] In another possible implementation, when the upgrade file does not include a message configuration file specifically for storing message configuration information, S501 can be implemented as follows: Search for content related to message configuration in the first upgrade file, analyze and integrate the found content, and determine the first message configuration information of the first upgrade file based on the analyzed and integrated content; the user device searches for content related to message configuration in the second upgrade file, analyzes and integrates the found content, and determines the second message configuration information of the second upgrade file based on the analyzed and integrated content.
[0148] S502: If the first message configuration information is the same as the second message configuration information, the user device determines that the verification result of the message configuration consistency verification passes.
[0149] Exemplarily, S502 can be implemented as follows: Use a comparison and analysis tool to analyze and compare the first message configuration information and the second message configuration information one by one to determine whether they are the same; if they are the same, determine that the verification result of the message configuration consistency verification passes.
[0150] S503: If the first message configuration information is different from the second message configuration information, the user device determines that the verification result of the message configuration consistency verification fails.
[0151] Exemplarily, S503 can be implemented as follows: Use a comparison and analysis tool to analyze and compare the first message configuration information and the second message configuration information one by one to determine whether they are the same; if they are different, determine that the verification result of the message configuration consistency verification fails.
[0152] In the embodiments of the present application, by determining whether the first message configuration information of the first upgrade file after writing is the same as the second message configuration information of the second upgrade file after writing, it is possible to determine whether the verification result of the message configuration consistency verification passes according to different consistency results. In this way, it is possible to accurately determine the verification result of the message configuration consistency verification, identify and troubleshoot possible message configuration inconsistency problems in advance, and provide a solid guarantee for the stable upgrade and normal operation of the system.
[0153] Next, the process of determining the compatibility result between the first upgrade file and the preset program of the current version in S102 and determining the preset program with an incompatible compatibility result in the preset program of the current version as the second target program will be described.
[0154] This process may include the following Case 1 and Case 2.
[0155] Case 1: The case where the type of the first target program is a boot program.
[0156] Case 2: The first target program is an application program.
[0157] Next, the process of determining the compatibility result between the first upgrade file and the preset program of the current version in Case 1, and determining the preset program with an incompatible compatibility result in the preset program of the current version as the second target program will be described.
[0158] Refer to Figure 6 As shown in the content, this process may include but is not limited to the following S601.
[0159] S601. When the type of the first target program is a boot program, determine the compatibility result between the first upgrade file and each application program in at least one application program of the current version; determine the application program with an incompatible compatibility result in at least one application program as the second target program.
[0160] Here, the compatibility result is used to represent whether the first upgrade file is compatible with the application program. It can be understood that the compatibility result includes compatible or incompatible.
[0161] Here, whether the first upgrade file is compatible or incompatible with the application program means that after upgrading the first target program using the first upgrade file, the upgraded first target program (i.e., the boot program) is compatible or incompatible with the old application programs in the user device.
[0162] Here, by screening the application programs with an incompatible compatibility result in at least one application program, multiple second target programs can be obtained. It can be understood that in this case, the second target program is all or part of the application programs installed in the user device, and the number of second target programs is less than or equal to the total number of application programs installed in the user device.
[0163] Here, since the preset compatibility mapping relationship is used to represent the corresponding relationship between the application program version identifier and the boot program version identifier, the compatibility result between the first upgrade file and each application program in at least one application program can be determined based on the preset compatibility mapping relationship.
[0164] Exemplarily, S601 may be implemented as follows: traverse at least one application; for each application, look up the version identifier of the first upgrade file in a preset compatibility mapping relationship; if the version identifier corresponding to the version identifier of the first upgrade file found includes the version identifier of the application, determine that the compatibility result between the first upgrade file and the application is compatible; if the version identifier corresponding to the version identifier of the first upgrade file is not found, or the version identifier corresponding to the version identifier of the first upgrade file found does not include the version identifier of the application, determine that the compatibility result between the first upgrade file and the application is incompatible; after the traversal is completed, obtain at least one compatibility result; determine the applications with incompatible compatibility results among the at least one application as the second target programs.
[0165] In actual application, the process of determining the compatibility result between the first upgrade file and the preset program of the current version in Case 1 and determining the preset program with an incompatible compatibility result in the preset program of the current version as the second target program may further include the following steps: the user device obtains at least one preset application included in the preset application list; the user device determines the compatibility result between the first upgrade file and each preset application in the at least one preset application; the user device determines the preset applications with incompatible compatibility results among the at least one preset application as the second target programs.
[0166] Here, the preset application list is used to store the applications that need to be mutually compatible with the bootloader. The specific content of the preset application list in the embodiments of the present application is not limited and may be determined according to actual situations. Exemplarily, at least one preset application that needs to be mutually compatible with the bootloader may be determined among all the applications installed on the user device in advance through human experience or a specific algorithm or a specific model, and a preset application list is formed.
[0167] For example, assume that a total of 5 applications A to E are installed on the user device, and the user only cares about whether applications A, C, and E are mutually compatible with the bootloader, and does not care about whether application B is mutually compatible with the bootloader. Then, the preset application list may include applications A, C, and E, but not include application B.
[0168] It can be understood that the number of preset applications is less than or equal to the total number of applications installed in the user device.
[0169] Exemplarily, this step can be implemented as follows: read the preset application list to obtain at least one preset application included in the preset application list; the user device traverses at least one preset application; for each preset application, look up the version identifier of the first upgrade file in the preset compatibility mapping relationship; if the found version identifier corresponding to the version identifier of the first upgrade file includes the version identifier of this preset application, determine that the compatibility result between the first upgrade file and this preset application is compatible; if the version identifier corresponding to the version identifier of the first upgrade file is not found, or the found version identifier corresponding to the version identifier of the first upgrade file does not include the version identifier of this preset application, determine that the compatibility result between the first upgrade file and this preset application is incompatible; after the traversal is completed, obtain at least one compatibility result; determine the preset applications with incompatible compatibility results among the at least one preset application as the second target programs.
[0170] Next, the process of determining the compatibility result between the first upgrade file and the preset program of the current version in Case 2, and determining the preset programs with incompatible compatibility results among the preset programs of the current version as the second target programs will be described.
[0171] Refer to Figure 7 the content shown, this process may include but is not limited to the following S701.
[0172] S701. When the type of the first target program is an application program, determine the compatibility result between the first upgrade file and the boot program of the current version; if the compatibility result between the first upgrade file and the boot program of the current version is incompatible, determine the boot program as the second target program.
[0173] Here, the compatibility result is used to represent whether the first upgrade file and the boot program are compatible. It can be understood that the compatibility result includes compatible or incompatible.
[0174] Here, whether the first upgrade file and the boot program are compatible or incompatible means that after upgrading the first target program with the first upgrade file, the upgraded first target program (i.e., the application program) and the old boot program in the controller are compatible or incompatible with each other.
[0175] Here, since the preset compatibility mapping relationship is used to represent the corresponding relationship between the application program version identifier and the boot program version identifier, the compatibility result between the first upgrade file and the boot program can be determined based on the preset compatibility mapping relationship.
[0176] Exemplarily, S701 may be implemented as follows: The controller searches for the version identifier of the first upgrade file in a preset compatibility mapping relationship; if the version identifier corresponding to the version identifier of the first upgrade file found includes the version identifier of the bootloader, it is determined that the compatibility result between the first upgrade file and the bootloader is compatible; if the version identifier corresponding to the version identifier of the first upgrade file is not found, or the version identifier corresponding to the version identifier of the first upgrade file found does not include the version identifier of the bootloader, it is determined that the compatibility result between the first upgrade file and the bootloader is incompatible; it is determined whether the compatibility result between the first upgrade file and the bootloader is incompatible; if so, the bootloader is determined as the second target program.
[0177] In the embodiments of the present application, when the type of the first target program is a bootloader, by determining the compatibility result between the first upgrade file and each of at least one application program, the second target program can be obtained by screening at least one application program or at least one preset application program based on different compatibility results; when the type of the first target program is an application program, by determining the compatibility result between the first upgrade file and the bootloader, it can be determined whether the second target program is the bootloader based on different compatibility results. In this way, by determining different second target programs according to different types of the first target program, the upgrade efficiency when bundling and upgrading the bootloader and application programs can be improved, and the upgrade requirements in different upgrade scenarios can be met.
[0178] The embodiments of the present application may further include the process of upgrading the first target program.
[0179] Referring to Figure 8 the content shown, this process may include but is not limited to the following S801.
[0180] S801. When the type of the first target program is a bootloader and the compatibility result between the first upgrade file and each of at least one application program of the current version is compatible, or when the type of the first target program is an application program and the compatibility result between the first upgrade file and the bootloader of the current version is compatible, the user device upgrades the first target program based on the first upgrade file.
[0181] Here, when the type of the first target program is a boot program and the compatibility result between the first upgrade file and each application in at least one application of the current version is compatible, or when the type of the first target program is an application and the compatibility result between the first upgrade file and the boot program of the current version is compatible, it means that there is no incompatibility problem between the first upgrade file and the programs already installed in the user device. At this time, the first target program can be upgraded separately without bundling the upgrade of the application and the boot program.
[0182] Exemplarily, S801 can be implemented as follows: when the type of the first target program is a boot program, determine whether the compatibility result between the first upgrade file and each application in at least one application of the current version is compatible. If so, upgrade the first target program based on the first upgrade file; or when the type of the first target program in the user device is an application, determine whether the compatibility result between the first upgrade file and the boot program of the current version is compatible. If so, upgrade the first target program based on the first upgrade file.
[0183] In the embodiments of the present application, by determining whether the conditions that the type of the first target program is a boot program and the compatibility result between the first upgrade file and each application in at least one application of the current version is compatible, and the type of the first target program is an application and the compatibility result between the first upgrade file and the boot program of the current version is compatible are met, the first target program can be upgraded separately in the above two cases. In this way, not only can the upgrade efficiency be improved, but also unnecessary changes to the second target program can be avoided, ensuring the overall stability of the system.
[0184] The embodiments of the present application may further include a process of determining a second target program based on the compatibility result and the historical flashing times.
[0185] Refer to Figure 9 the content shown, this process may include but is not limited to the following S901 and S902.
[0186] S901. Determine the compatibility result between the first upgrade file and the preset program of the current version and the historical flashing times of the preset program of the current version.
[0187] Wherein, if the type of the first target program is an application, the type of the preset program of the current version is a boot program; if the type of the first target program is a boot program, the type of the preset program of the current version is an application.
[0188] Here, the historical flashing times refer to the cumulative number of data writing operations performed on the preset program of the current version.
[0189] It is understandable that the more historical flashing times a certain program has, the higher the stability risk it may face, and the greater the probability of errors and failures. Conversely, the fewer historical flashing times a certain program has, the relatively lower the probability of errors and failures, and it is more likely to maintain good performance and stability.
[0190] Exemplarily, the user device can be pre-configured with a historical flashing times field for recording the historical flashing times of the preset program of the current version. After each successful upgrade of the preset program of the current version, the user device increments the historical flashing times field by 1. Correspondingly, S901 can be implemented as: determining the compatibility result between the first upgrade file and the preset program of the current version; reading the historical flashing times field to obtain the historical flashing times of the preset program of the current version.
[0191] S902: Determine the preset programs in the preset program of the current version with an incompatible compatibility result and a historical flashing times less than the first threshold as the second target programs.
[0192] The first threshold is used to assist in determining the second target programs. The specific value of the first threshold in the embodiments of the present application is not limited and can be determined according to actual situations.
[0193] Exemplarily, S902 can be implemented as: traversing multiple preset programs of the current version, and for each preset program of the current version, determining whether the compatibility result of the preset program of the current version is incompatible and whether the historical flashing times is less than the first threshold. If so, determining the preset program of the current version as a second target program; after the traversal is completed, multiple second target programs are obtained.
[0194] In the embodiments of the present application, by determining the compatibility result between the first upgrade file and the preset program of the current version and the historical flashing times of the preset program of the current version, it is possible to screen the preset program of the current version to obtain the second target programs based on different compatibility results and different historical flashing times. In this way, the stability risk faced by the user device can be appropriately reduced, the probability of errors and failures of the user device can be minimized as much as possible, and it helps to improve the performance and stability of the user device.
[0195] In practical applications, application programs and boot programs are installed on user devices. The software upgrade methods of user devices can include a separate upgrade method and a bundled upgrade method. The separate upgrade method refers to the method of separately upgrading the application program or the boot program, and the bundled upgrade method refers to the method of bundling and upgrading the application program and the boot program. When a separate upgrade request for the application program or the boot program is received, the compatibility result between the application program and the boot program can be determined. If the compatibility result is compatible, the application program or the boot program is separately upgraded based on the separate upgrade method. If the compatibility result is incompatible, the application program and the boot program are bundled and upgraded based on the bundled upgrade method. Alternatively, the compatibility result between the application program and the boot program and the historical flashing times of the boot program can be determined. If the compatibility result is compatible, or the compatibility result is incompatible and the historical flashing times are greater than or equal to the first threshold, the application program or the boot program is separately upgraded based on the separate upgrade method. If the compatibility result is incompatible and the historical flashing times are less than the first threshold, the application program and the boot program are bundled and upgraded based on the bundled upgrade method.
[0196] Furthermore, since the preset compatibility mapping relationship is used to represent the correspondence between the application program version identifier and the boot program version identifier, the compatibility result between different version identifiers of the application program and different version identifiers of the boot program can be determined based on the preset compatibility mapping relationship.
[0197] Next, through a complete embodiment, the upgrade method provided in the embodiments of the present application will be described.
[0198] At present, regardless of whether the in-vehicle controller on the market supports the partition swap (A / B Swap) function, when a new version of the application program (Application, hereinafter referred to as Appl) or a new version of the boot program (Bootloader, hereinafter referred to as Boot) needs to be updated, the corresponding area in the controller memory is directly erased and then written, and Appl and Boot are updated separately.
[0199] For example, the memory layout of the random access memory (Random Access Memory, RAM) mode of the current Xinchi E3430 chip is shown in Figure 10, in a controller supporting the partition swapping function, when the Central Processing Unit (CPU) 1001 is working, it reads data from the Static Random Access Memory (SRAM) 1002. The SRAM 1002 exchanges data with the Non-Volatile Random Access Memory Flash (NOR Flash) 1004 through the Extended Serial Peripheral Interface (XSPI) 1003. The NOR Flash 1004 is divided into an old bootloader area 10041, an old application area 10042, a current bootloader area 10043, and a current application area 10044. The old bootloader area 10041 is used to store the old version of the bootloader 10045, the old application area 10042 is used to store the old version of the application 10046, the current bootloader area 10043 is used to store the current version of the bootloader 10047, and the current application area 10044 is used to store the current version of the application 10048. During the separate update process of the application, the software identifies the application or the bootloader, erases the old application area 10042 and writes the latest version of the application 10049. The boot startup direction of the controller operating system also switches from the current version of the application 10048 to the latest version of the application 10049.
[0200] To solve the above problems, based on the combination of the Over-the-Air Technology (OTA), the embodiments of the present application implement bundling OTA for the application and the bootloader to avoid the incompatibility with the real vehicle environment after separately upgrading the Appl software or the Boot software. By combining the bundled software package and partition management, the entire bundled software package is OTA updated for the non-active area each time, which can ensure that a software group in one partition of the controller can always run normally.
[0201] Considering that the bundled software package may be large, the means of seamless upgrade is used to implement bundling OTA for the application and the bootloader. In this way, not only can the incompatibility with the real vehicle environment after separately releasing the Appl software and the Boot software be avoided, but also the upgrade efficiency can be improved and seamless upgrade can be achieved. The upgrade method provided by the embodiments of the present application mainly includes: 1) Adding the partition concept, setting the active area and the non-active area, and the software runs in the active area and performs erase and write operations on the non-active area. See Figure 11, the NOR Flash 1004 is divided into an inactive area 1005 and an active area 1006. Among them, the old boot program area 10041 and the old application program area 10042 are located in the inactive area 1005, and the current boot program area 10043 and the current application program area 10044 are located in the active area 1006. 2) Each software package for seamless flashing consists of Appl + Boot, and it is released to test whether Appl and Boot are compatible.
[0202] Next, in combination with Figure 12 , the specific steps of the upgrade method provided by the embodiments of the present application will be described.
[0203] Step 1: When seamless flashing of the current version application program 10048 in the active area 1006 is required, erase the old version boot program 10045 and the old version application program 10046 in the inactive area 1005, and set the valid flags of the old boot program area 10041 and the old application program area 10042 to invalid.
[0204] Step 2: Write the latest version application program 10049 and the latest version boot program 100410 into the inactive area 1005 in sequence.
[0205] Step 3: Verify whether the signature of the flashed software package is correct. If so, set the valid flags of the newly flashed boot program and application program, and finally perform a partition swap between the inactive area 1005 and the active area 1006.
[0206] The embodiments of the present application provide an upgrade device. The upgrade device is deployed on a user device, and a boot program and at least one application program are installed on the user device. As Figure 13 shown, the upgrade device 130 includes: a first acquisition unit 1301, a first determination unit 1302, a second determination unit 1303, a second acquisition unit 1304, and an upgrade unit 1305. Among them:
[0207] The first acquisition unit 1301 is configured to obtain a first upgrade file of a first target program from a server in response to an upgrade request of the first target program; the first target program is a boot program or a first application program, and the first application program is any one of the at least one application programs;
[0208] The first determination unit 1302 is configured to determine a compatibility result between the first upgrade file and a preset program of the current version, and determine a preset program with an incompatible compatibility result in the preset program of the current version as a second target program; wherein, if the type of the first target program is an application program, the type of the preset program of the current version is a boot program, and if the type of the first target program is a boot program, the type of the preset program of the current version is an application program;
[0209] A second determination unit 1303, configured to determine a compatible version identifier of a second target program based on the version identifier of the first target program in the upgrade request;
[0210] A second acquisition unit 1304, configured to acquire a second upgrade file of the second target program based on the compatible version identifier of the second target program;
[0211] An upgrade unit 1305, configured to upgrade the first target program and the second target program based on the first upgrade file and the second upgrade file.
[0212] In some embodiments, the upgrade unit 1305 is specifically configured to: determine the system state of the dual - partition system of the user device; the system state includes an active state or an inactive state; the dual - partition system includes an active area and an inactive area; when the system state of the dual - partition system is the active state, after writing the first upgrade file and the second upgrade file into the program storage area in the inactive area, perform a partition switch between the inactive area and the active area to complete the upgrade of the first target program and the second target program; when the system state of the dual - partition system is the inactive state, after writing the first upgrade file and the second upgrade file into the program storage area of the single - partition system of the user device, reset the single - partition system to complete the upgrade of the first target program and the second target program.
[0213] In some embodiments, the upgrade device 130 further includes a verification unit, and the verification unit is configured to: perform a driver configuration compatibility verification and / or a message configuration consistency verification on the written first upgrade file and the written second upgrade file; when the verification passes, restart the operating system of the user device so that the operating system of the user device is started based on the first upgrade file and the second upgrade file.
[0214] In some embodiments, the verification unit is further configured to: acquire first driver configuration information of the written first upgrade file and second driver configuration information of the written second upgrade file; if the first driver configuration information is compatible with the second driver configuration information, determine that the verification result of the driver configuration compatibility verification passes; if the first driver configuration information is not compatible with the second driver configuration information, determine that the verification result of the driver configuration compatibility verification fails.
[0215] In some embodiments, the verification unit is further configured to: acquire first message configuration information of the written first upgrade file and second message configuration information of the written second upgrade file; if the first message configuration information is consistent with the second message configuration information, determine that the verification result of the message configuration consistency passes; if the first message configuration information is inconsistent with the second message configuration information, determine that the verification result of the message configuration consistency fails.
[0216] In some embodiments, the first determination unit 1302 is further configured to: when the type of the first target program is a boot program, determine the compatibility result between the first upgrade file and each of at least one application program in the current version; determine the application programs with incompatible compatibility results among the at least one application programs as the second target programs; when the type of the first target program is an application program, determine the compatibility result between the first upgrade file and the boot program in the current version; if the compatibility result between the first upgrade file and the boot program in the current version is incompatible, determine the boot program as the second target program.
[0217] In some embodiments, the upgrade unit 1305 is further configured to: when the type of the first target program is a boot program and the compatibility result between the first upgrade file and each of at least one application program in the current version is compatible, or when the type of the first target program is an application program and the compatibility result between the first upgrade file and the boot program in the current version is compatible, upgrade the first target program based on the first upgrade file.
[0218] In some embodiments, the first determination unit 1302 is further configured to: determine the compatibility result between the first upgrade file and the preset program in the current version and the historical flashing times of the preset program in the current version; wherein, if the type of the first target program is an application program, the type of the preset program in the current version is a boot program, and if the type of the first target program is a boot program, the type of the preset program in the current version is an application program; determine the preset programs with incompatible compatibility results and historical flashing times less than the first threshold in the preset program in the current version as the second target programs.
[0219] It should be noted that each unit included in the upgrade device provided in the embodiments of the present application can be implemented by a processor in a user device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU, Central Processing Unit), a microprocessor (MPU, Micro Processor Unit), a digital signal processor (DSP, Digital Signal Processor), or a field programmable gate array (FPGA), etc.
[0220] The description of the above device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects to the method embodiments. For the technical details not disclosed in the device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.
[0221] It should be noted that in the embodiments of the present application, if the above-mentioned upgrade method is implemented in the form of software function modules and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present application essentially or the part that contributes to the related technology can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM), magnetic disks, or optical discs that can store program codes. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0222] The embodiments of the present application further provide a user device, which at least includes a memory and a processor. The memory stores a computer program that can run on the processor, and when the processor executes the program, it implements the steps in the upgrade method provided in the above embodiments.
[0223] The following Figure 14 illustrates the structure diagram of the user device with reference to the user device 140 shown.
[0224] In one example, as Figure 14 shown, the user device 140 includes: a processor 1401, at least one communication bus 1402, at least one external communication interface 1403, and a memory 1404. Among them, the communication bus 1402 is configured to enable connection communication between these components. Among them, the external communication interface 1403 may include a standard wired interface and a wireless interface.
[0225] The memory 1404 is configured to store instructions and applications executable by the processor 1401, and can also cache data to be processed or already processed by the processor 1401 and each module in the user device (for example, image data, audio data, voice communication data, and video communication data), and can be implemented by flash memory (FLASH) or random access memory (Random Access Memory, RAM).
[0226] The embodiments of the present application further provide a storage medium, that is, a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps in the upgrade method provided in the above embodiments.
[0227] The embodiments of the present application further provide a computer program product, including a computer program or instructions. When the computer program or instructions are executed by a processor, they implement the steps in the upgrade method provided in the above embodiments.
[0228] It should be noted here that the descriptions of the above storage medium and device embodiments are similar to those of the above method embodiments and have similar beneficial effects to the method embodiments. For the technical details not disclosed in the storage medium and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0229] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of this application. Therefore, the appearances of "in one embodiment" or "in some embodiments" throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of this application, the sequence numbers of the above processes do not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of this application. The sequence numbers of the embodiments of this application above are only for description and do not represent the advantages or disadvantages of the embodiments.
[0230] It should be noted that in this article, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0231] In several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. 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, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling or communication connection between the components shown or discussed with each other can be through some interfaces. The indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0232] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units; 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 of this embodiment.
[0233] In addition, in each embodiment of the present application, each functional unit can be fully integrated into one processing unit, or each unit can be separately regarded as one unit, or two or more units can be integrated into one unit; the above-mentioned integrated unit can be implemented in the form of hardware, or in the form of a combination of hardware and software functional units.
[0234] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps including the above method embodiments; and the foregoing storage medium includes: removable storage devices, read-only memory (ROM), magnetic disks, or optical discs and other various media that can store program codes.
[0235] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present application, in essence, or the part that makes contributions to the related art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the various embodiments of the present application. And the foregoing storage medium includes: removable storage devices, ROM, magnetic disks, or optical discs and other various media that can store program codes.
[0236] The above is only the implementation mode of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered by the protection scope of the present application.
Claims
1. An upgrade method, characterized in that, The method is applied to a user device, on which a bootloader and at least one application are installed. The method includes: In response to an upgrade request for a first target program, obtain a first upgrade file of the first target program from a server; the first target program is the bootloader or a first application, and the first application is any one of the at least one application; Determine a compatibility result between the first upgrade file and a preset program of the current version, and determine a preset program with an incompatible compatibility result in the preset program of the current version as a second target program; wherein, if the type of the first target program is an application, the type of the preset program of the current version is the bootloader, and if the type of the first target program is the bootloader, the type of the preset program of the current version is an application; Based on the version identifier of the first target program in the upgrade request, determine a compatible version identifier of the second target program; Based on the compatible version identifier of the second target program, obtain a second upgrade file of the second target program; Based on the first upgrade file and the second upgrade file, upgrade the first target program and the second target program; The upgrading of the first target program and the second target program based on the first upgrade file and the second upgrade file includes: Determine the system state of the dual-partition system of the user device; the system state includes an active state or a non-active state; the dual-partition system includes an active area and a non-active area; When the system state of the dual-partition system is the active state, after writing the first upgrade file and the second upgrade file into the program storage area in the non-active area, perform a partition switch between the non-active area and the active area to complete the bundled upgrade of the first target program and the second target program; When the system state of the dual-partition system is the non-active state, after writing the first upgrade file and the second upgrade file into the program storage area of the single-partition system of the user device, reset the single-partition system to complete the bundled upgrade of the first target program and the second target program; The method further includes: Determine the compatibility result between the first upgrade file and the preset program of the current version and the historical flashing times of the preset program of the current version; wherein, the historical flashing times is the cumulative number of data writing operations performed on the preset program of the current version; Determine a preset program with an incompatible compatibility result and a historical flashing times less than a first threshold in the preset program of the current version as the second target program.
2. The upgrade method according to claim 1, wherein The method further includes: Perform a driver configuration compatibility check and / or a message configuration consistency check on the written first upgrade file and the written second upgrade file; When the check passes, restart the operating system of the user device so that the operating system of the user device starts based on the first upgrade file and the second upgrade file.
3. The upgrade method according to claim 2, characterized in that Performing driver configuration compatibility verification on the first upgraded file after writing and the second upgraded file after writing includes: Obtaining first driver configuration information of the first upgraded file after writing and second driver configuration information of the second upgraded file after writing; If the first driver configuration information is compatible with the second driver configuration information, determining that the verification result of the driver configuration compatibility verification passes; If the first driver configuration information is incompatible with the second driver configuration information, determining that the verification result of the driver configuration compatibility verification fails.
4. The upgrade method according to claim 2, wherein Performing message configuration consistency verification on the first upgraded file after writing and the second upgraded file after writing includes: Obtaining first message configuration information of the first upgraded file after writing and second message configuration information of the second upgraded file after writing; If the first message configuration information is consistent with the second message configuration information, determining that the verification result of the message configuration consistency passes; If the first message configuration information is inconsistent with the second message configuration information, determining that the verification result of the message configuration consistency fails.
5. The upgrade method according to claim 1, wherein Determining the compatibility result between the first upgraded file and the preset program of the current version, and determining the preset program with an incompatible compatibility result in the preset program of the current version as the second target program includes: When the type of the first target program is a boot program, determining the compatibility result between the first upgraded file and each of at least one application program of the current version; determining the application program with an incompatible compatibility result among the at least one application program as the second target program; When the type of the first target program is an application program, determining the compatibility result between the first upgraded file and the boot program of the current version; if the compatibility result between the first upgraded file and the boot program of the current version is incompatible, determining the boot program as the second target program.
6. The upgrade method according to claim 5, characterized in that The method further includes: When the type of the first target program is a boot program and the compatibility result between the first upgraded file and each of at least one application program of the current version is compatible, or when the type of the first target program is an application program and the compatibility result between the first upgraded file and the boot program of the current version is compatible, upgrading the first target program based on the first upgraded file.
7. An upgrade device, characterized in that, The device is deployed on a user device, and a boot program and at least one application program are installed on the user device. The device includes: A first acquisition unit, configured to obtain a first upgraded file of the first target program from a server in response to an upgrade request of the first target program; the first target program is the boot program or a first application program, and the first application program is any one of the at least one application program; A first determination unit, configured to determine a compatibility result between the first upgrade file and a preset program of the current version, and determine a preset program with an incompatible compatibility result in the preset program of the current version as a second target program; wherein, if the type of the first target program is an application program, the type of the preset program of the current version is a boot program, and if the type of the first target program is a boot program, the type of the preset program of the current version is an application program; A second determination unit, configured to determine a compatible version identifier of the second target program based on the version identifier of the first target program in the upgrade request; A second acquisition unit, configured to acquire a second upgrade file of the second target program based on the compatible version identifier of the second target program; An upgrade unit, configured to upgrade the first target program and the second target program based on the first upgrade file and the second upgrade file; The upgrade unit is configured to determine the system state of the dual-partition system of the user device; the system state includes an active state or a non-active state; the dual-partition system includes an active area and a non-active area; when the system state of the dual-partition system is the active state, after writing the first upgrade file and the second upgrade file into the program storage area in the non-active area, perform a partition switch between the non-active area and the active area to complete the bundled upgrade of the first target program and the second target program; when the system state of the dual-partition system is the non-active state, after writing the first upgrade file and the second upgrade file into the program storage area of the single-partition system of the user device, reset the single-partition system to complete the bundled upgrade of the first target program and the second target program; The first determination unit is further configured to determine a compatibility result between the first upgrade file and a preset program of the current version and the historical rewrite times of the preset program of the current version; wherein, the historical rewrite times is the cumulative number of data writing operations performed on the preset program of the current version; determine a preset program with an incompatible compatibility result and a historical rewrite times less than a first threshold in the preset program of the current version as the second target program.
8. A user device, including a memory and a processor, the memory stores a computer program that can run on the processor, and when the processor executes the program, the upgrade method according to any one of claims 1 to 6 is implemented.
9. A storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the upgrade method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Application program upgrading method and device, electronic equipment and storage medium
CN116360831A
Cluster firmware combination upgrading method and system, terminal and storage medium
CN116880872A