Software detection method and device, equipment, and storage medium
By self-detecting the startup parameters after the software is updated and switching to the inactive area to run the old version of the software, the compatibility issues after the software update and the long fallback time are solved, and fast and accurate rollback and reduced fault resolution time are achieved.
Patent Information
- Application Number
- CN202411210417.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2044-08-30
AI Technical Summary
After the software update of the existing technology, the new version may be incompatible with the old version or affect other functions, resulting in a long time to fall back to the old version of the program and easy to operate incorrectly.
After the first software package in the activation area is updated, the startup parameters of the second software package are self-checked, including the initialization progress, message transmission status and startup time. If the detection result is abnormal, switch to the inactivated area to run the third software package to achieve accurate rollback.
It realizes rapid and accurate rollback to the old version after software updates, reducing the time to resolve software failures and avoiding the risk of misoperation.
Smart Images

Figure CN118708500B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a software detection method and apparatus, device, and storage medium. Background Art
[0002] At present, some cars on the market are equipped with chips that support AB Swap. Because this redundant mechanism ensures that the entire vehicle segment always has two sets of programs, when updating to a new version of the application (Application, APP), the new version may be incompatible with the current vehicle segment or affect another function, and you may want to return to the old version of the program.
[0003] The current technical means to solve this problem is to uninstall the new version of the APP and re-flash the previous version of the APP program. However, this method is not only time-consuming, but may also cause the program to be flashed incorrectly, resulting in failure to roll back to the previous version normally. Summary of the invention
[0004] The embodiments of the present application are intended to provide a software detection method and apparatus, device, and storage medium that can solve the problem of incompatibility of updated software and shorten the time for resolving the problem.
[0005] The present application provides a software detection method, including:
[0006] When the first software package in the activation area is updated, determining the second software package;
[0007] Starting the second software package, detecting startup parameters of the second software package, and determining the detection result;
[0008] If the detection result indicates abnormal operation, the activation area is switched to the non-activation area, and the third software package in the non-activation area is run; wherein the startup parameters include: at least one of initialization progress, message transmission status and startup time; the first software package and the third software package belong to the same software package; the startup time indicates the startup time of the controller.
[0009] It can be understood that when the first software package in the activation zone is updated, the second software package is determined, the second software package is started, the startup parameters of the second software package are detected, and the detection result is determined, so that the second software package can be self-detected, and there is no need to obtain whether the second software package is abnormal through the upper controller, which can save the time of obtaining whether the second software package is abnormal, wherein the startup parameters include: at least one of the initialization progress, the transmission status of the message and the startup time, and the startup time represents the startup time of the controller. When the second software package is detected to be abnormal, it is actively switched from the activation zone where the second software package is located to the non-activation zone through switching processing, and the third software package in the non-activation zone is run. In the whole process of recovering from the failure of the second software package to the operation of the third software package in the non-activation zone, the second software package in the activation zone is automatically switched to the third software package in the non-activation zone, so as to achieve accurate rollback to the third software package, and at the same time, it can also reduce the time of solving software failures, wherein the first software package and the third software package belong to the same software package.
[0010] In the above solution, starting the second software package, detecting the startup parameters of the second software package, and determining the detection result include:
[0011] The second software package is started, and at least one startup parameter of the second software package's initialization progress, message transmission status, and startup time is detected to determine a detection result of the second software package; wherein the startup time represents a startup time of the controller.
[0012] It can be understood that by detecting at least one startup parameter of the initialization progress of the second software package, the transmission status of the message and the startup time and determining the detection result, self-detection of the second software package can be achieved, and there is no need to obtain whether the second software package has any abnormality through the upper-level controller, which can save time for obtaining whether the second software package has any abnormality.
[0013] In the above scheme, detecting at least one startup parameter of the initialization progress of the second software package, the transmission status of the message, and the startup time to determine the detection result of the second software package includes:
[0014] detecting the initialization progress of the second software package and determining a first detection result of the second software package;
[0015] detecting a transmission status of a message of the second software package and determining a second detection result of the second software package;
[0016] detecting the startup time of the second software package and determining a third detection result of the second software package;
[0017] Based on at least one of the first detection result, the second detection result, and the third detection result, a detection result of the second software package is determined.
[0018] It can be understood that the initialization progress of the second software package, the transmission status of the message and the startup time are detected respectively to determine the first detection result, the second detection result and the third detection result of the second software package. Based on at least one of the first detection result, the second detection result and the third detection result, the detection result of the second software package is determined, so that the self-detection of the second software package can be realized, and it is not necessary to obtain whether the second software package is abnormal through the upper controller, which can save the time of obtaining whether the second software package is abnormal.
[0019] In the above solution, detecting the initialization progress of the second software package and determining the first detection result of the second software package includes:
[0020] The progress of the initialization of the second software package is detected by the first flag bit, wherein the first flag bit indicates whether the initialization of the second software package is completed;
[0021] If the value of the first flag bit is the first value, it is determined that the first detection result is normal; wherein the first value indicates that the initialization of the second software package is completed;
[0022] If the value of the first flag bit is the second value, the first detection result is determined to be abnormal; wherein the second value indicates that initialization of the second software package is not completed.
[0023] It can be understood that the progress of initialization of the second software package is detected through the first flag bit. If the value of the first flag bit is the first value, the first detection result is determined to be normal. If the value of the first flag bit is the second value, the first detection result is determined to be abnormal, which facilitates the subsequent determination of the detection result of the second software package based on the first detection result, further realizes self-detection of the second software package, and saves time for obtaining whether there is any abnormality in the second software package.
[0024] In the above solution, detecting the transmission status of the message of the second software package to determine the second detection result of the second software package includes:
[0025] The transmission status of the message of the second software package is detected through the second flag bit; wherein the second flag bit indicates whether the controller successfully sends the first frame message;
[0026] If the value of the second flag bit is the third value, the second detection result is determined to be normal; wherein the third value indicates that the controller successfully sends the first frame message;
[0027] If the value of the second flag bit is a fourth value, the second detection result is determined to be abnormal; wherein the fourth value indicates that the controller has not sent the first frame message.
[0028] It can be understood that, through the second flag bit, the transmission status of the message of the second software package is detected. If the value of the second flag bit is the third value, the second detection result is determined to be normal. If the value of the second flag bit is the fourth value, the second detection result is determined to be abnormal, which is convenient for subsequently determining the detection result of the second software package according to the second detection result, further realizing self-detection of the second software package, and saving time for obtaining whether there is any abnormality in the second software package.
[0029] In the above solution, detecting the startup time of the second software package to determine the third detection result of the second software package includes:
[0030] The startup time of the second software package is detected by a time threshold; wherein the time threshold is based on the startup time of the vehicle controller set in advance for vehicles of different car manufacturers, and vehicles of different car manufacturers correspond to different time thresholds;
[0031] If the startup time is less than the time threshold, determining that the third detection result is normal;
[0032] If the start-up time is equal to or greater than the time threshold, the third detection result is determined to be abnormal.
[0033] It can be understood that the startup time of the second software package is detected through the time threshold. If the startup time is less than the time threshold, the third detection result is determined to be normal; if the startup time is equal to or greater than the time threshold, the third detection result is determined to be abnormal, which is convenient for subsequently determining the detection result of the second software package according to the third detection result, further realizing self-detection of the second software package, and saving time for obtaining whether there is any abnormality in the second software package.
[0034] In the above solution, determining the detection result of the second software package based on at least one of the first detection result, the second detection result, and the third detection result includes:
[0035] If the first test result, the second test result, and the third test result are all normal, determining that the test result of the second software package is normal;
[0036] If at least one of the first detection result, the second detection result and the third detection result is abnormal, it is determined that the detection result of the second software package is abnormal.
[0037] It can be understood that, according to one detection result, two detection results, or three detection results among the first detection result, the second detection result, and the third detection result, the detection result of the second software package is determined, so as to further implement self-detection of the second software package and save time for obtaining whether there is any abnormality in the second software package.
[0038] In the above scheme, if the detection result indicates that the operation is abnormal, switching from the active area to the inactive area and running the third software package in the inactive area includes:
[0039] If the test result is abnormal, continue to perform function test on the second software package until the maximum number of tests is reached and multiple test results are obtained;
[0040] If multiple detection results are all abnormal, the active area is switched to the inactive area, and the third software package in the inactive area is run.
[0041] It is understandable that if the test result is abnormal, the function test of the second software package will continue until the maximum number of tests is reached, and multiple test results will be obtained, which can prevent false detection of the second software package and ensure the accuracy of the detection of the second software package. If the multiple test results are abnormal, the activation area will be switched to the non-activation area, and the third software package in the non-activation area will be run. In the process of recovering from the failure of the second software package to the third software package in the non-activation area, the second software package in the activation area will be automatically switched to the third software package in the non-activation area, thereby achieving accurate rollback to the third software package. At the same time, it can also reduce the time to resolve software failures.
[0042] In the above solution, before starting the second software package and detecting the startup parameters of the second software package and determining the detection result, the method further includes:
[0043] When the second software package in the activation zone is started for the first time, the detection switch is started;
[0044] When the detection switch is in the startup state, initializing startup parameters corresponding to the chip startup phase, the boot software running phase, and the second software package running phase, and determining the initialization result;
[0045] When the initialization result is determined and the second software package is started, the detection switch is turned off;
[0046] When the detection switch is turned off, the startup parameters of the second software package are detected.
[0047] It can be understood that by starting the detection switch, the startup parameters are initialized to facilitate the subsequent detection of the second software package.
[0048] The embodiment of the present application provides a software detection device, the software detection device comprises: an update unit, a detection unit and a region cutting unit; wherein,
[0049] An updating unit, configured to determine a second software package when the first software package in the activation area is updated;
[0050] A detection unit, used to start the second software package, detect the startup parameters of the second software package, and determine the detection result;
[0051] A zone switching unit, configured to switch from the active zone to the inactive zone and run the third software package in the inactive zone if the detection result indicates that the operation is abnormal;
[0052] The startup parameters include: at least one of initialization progress, message transmission status and startup time; the first software package and the third software package belong to the same software package; and the startup time represents the startup time of the controller.
[0053] The embodiment of the present application provides a software detection device, including: a processor and a memory, wherein:
[0054] Memory for storing computer programs;
[0055] The processor is used to call and run a computer program from a memory to execute the above-mentioned software detection method.
[0056] An embodiment of the present application provides a computer-readable storage medium storing executable instructions for causing a processor to execute the above-mentioned software detection method.
[0057] The embodiment of the present application provides a software detection method and device, equipment, and storage medium, the method comprising: determining a second software package when the first software package in the activation area is updated; starting the second software package, detecting the startup parameters of the second software package, and determining the detection result; if the detection result indicates an abnormal operation, switching from the activation area to the non-activation area, and running the third software package in the non-activation area; wherein the startup parameters include: at least one of the progress of initialization, the transmission status of the message, and the startup time; the first software package and the third software package belong to the same software package; and the startup time indicates the startup time of the controller. By adopting the above scheme, when the first software package in the activation area is updated, determining the second software package, starting the second software package, detecting the startup parameters of the second software package, and determining the detection result can realize self-detection of the second software package, without obtaining whether the second software package is abnormal through the upper controller, and can save time for obtaining whether the second software package is abnormal, wherein the startup parameters include: at least one of the progress of initialization, the transmission status of the message, and the startup time, and the startup time indicates the startup time of the controller. When an abnormality is detected in the second software package, the active switching process is performed to switch from the activation area where the second software package is located to the inactive area, and the third software package in the inactive area is run. In the entire process from the failure of the second software package to the recovery of the operation of the third software package in the inactive area, the second software package in the active area is automatically switched to the third software package in the inactive area, thereby achieving accurate rollback to the third software package. At the same time, the time for resolving software failures can also be reduced, wherein the first software package and the third software package belong to the same software package. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0059] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0060] Figure 1 An optional process diagram of a software detection method provided in an embodiment of the present application Figure 1 ;
[0061] Figure 2 An optional process diagram of a software detection method provided in an embodiment of the present application Figure 2 ;
[0062] Figure 3 An optional process diagram of a software detection method provided in an embodiment of the present application Figure 3 ;
[0063] Figure 4 An optional process diagram of a software detection method provided in an embodiment of the present application Figure 4 ;
[0064] Figure 5A An optional cut-area diagram of a software detection method provided in an embodiment of the present application Figure 1 ;
[0065] Figure 5B An optional cut-area diagram of a software detection method provided in an embodiment of the present application Figure 2 ;
[0066] Figure 6 A schematic diagram of starting an optional second software package of a software detection method provided in an embodiment of the present application;
[0067] Figure 7 A schematic diagram of the structure of a software detection device provided in an embodiment of the present application;
[0068] Figure 8A schematic diagram of the structure of a software detection device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the specific technical solution of the present application will be further described in detail below in conjunction with the 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.
[0070] Unless otherwise defined, all technical and scientific terms used in this application have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in this application are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0071] In the following description, reference is made to “some embodiments”, “this embodiment”, “embodiments of the present application” and examples, etc., which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0072] If similar descriptions of "first / second" appear in the application documents, the following instructions are added. In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0073] Figure 1 An optional process diagram of a software detection method provided in an embodiment of the present application Figure 1 ,like Figure 1 As shown, the software detection method includes the following steps:
[0074] S101. When the first software package in the activation area is updated, determine the second software package.
[0075] In some embodiments of the present application, the software detection method provided in the embodiments of the present application can be applied to the detection of various types of software packages, such as software packages for mobile phone applications, software packages installed in computers, and software packages installed on vehicle terminals, etc. In this regard, the embodiments of the present application do not impose specific restrictions.
[0076] In some embodiments of the present application, the second software package is sent to the vehicle terminal via the cloud, and the vehicle terminal detects whether the second software package can run normally. The second software package generally involves functional upgrades of the vehicle, including body, chassis, intelligent driving, etc.
[0077] In some embodiments of the present application, when the first software package is upgraded to the second software package, the upgrade is required to be seamless, that is, the system can still download the program while running, with zero standby time. For upgrade exception handling, it is required to always have a working backup program for rollback. Therefore, many chip manufacturers provide hardware-based mechanisms that facilitate upgrades, such as the TC3xx A\BSWAP mechanism, the ST SPC58NH92 Hardware flash A / B context swapping mechanism, the NXP S32K3 AB_SWAP mechanism, etc. Under this mechanism, Flash needs to support the RWW (Read While Write) attribute. The Flash space is divided into two Banks (also called partitions) according to the design of the chip manufacturer. These two physical Banks can be alternately assigned a unified logical address by hardware. When the system is running, one and only one Bank (Bank A) can run the code (called the active Bank), and the other Bank (Bank B) is called the inactive Bank. New code can be written to Bank B while Bank A is running. After the code update is completed on Bank B, the active area and the inactive area are switched. At this time, Bank B is the active area and Bank A is the inactive area. The next time the system is powered on, it will automatically switch to the latest Bank B to start instruction fetching and running, thus achieving zero standby time.
[0078] It should be noted that active Bank refers to the activated area, and inactive Bank refers to the inactive area.
[0079] In the following embodiments, the first software package and the second software package are software packages of a vehicle terminal as an example for description.
[0080] In some embodiments of the present application, the execution subject of the software detection method is a software detection device, and the software detection device may be a vehicle terminal.
[0081] In some embodiments of the present application, the vehicle terminal updates the first software package in the activation area and determines the second software package.
[0082] S102: Start the second software package, detect the startup parameters of the second software package, and determine the detection result.
[0083] In some embodiments of the present application, the startup parameters include: initialization progress, message transmission status and startup time.
[0084] In some embodiments of the present application, the second software package is started, at least one startup parameter of the initialization progress, message transmission status and startup time of the second software package is detected, and the detection result of the second software package is determined.
[0085] In some embodiments of the present application, the progress of initialization can be indicated by a first flag bit, and the transmission status of the message can be indicated by a second flag bit. The startup time represents the startup time of the controller of the vehicle.
[0086] Exemplarily, the first flag bit may be FlagA, where FlagA indicates the initialization completion stage, and the second flag bit may be FlagB, where FlagB indicates whether the Can controller successfully sends out the first frame message.
[0087] In some embodiments of the present application, the vehicle terminal can start the second software package, detect at least one startup parameter of the initialization progress, message transmission status and startup time of the second software package, and obtain the detection result of at least one startup parameter, thereby determining the detection result of the second software package based on the detection result of at least one startup parameter.
[0088] S103: If the detection result indicates that the operation is abnormal, switch from the active area to the inactive area and run the third software package in the inactive area.
[0089] In some embodiments of the present application, the first software package in the active area and the third software package in the inactive area belong to the same version of software packages, that is, the first software package and the third software package belong to the same software package.
[0090] In some embodiments of the present application, if the vehicle terminal detects that the detection result of the second software package has an operating abnormality, it switches from the activation area to the inactivation area and runs the third software package in the inactivation area.
[0091] In some embodiments of the present application, if the test result is abnormal, the function test of the second software package continues until the maximum number of tests is reached and multiple test results are obtained; if the multiple test results are all abnormal, the activation area is switched to the inactive area and the third software package in the inactive area is run.
[0092] It is understandable that when the first software package in the activation zone is updated, the second software package is determined, the second software package is started, and the startup parameters of the second software package are detected. The detection result can realize the self-detection of the second software package, and it is not necessary to obtain whether the second software package is abnormal through the upper controller, which can save the time of obtaining whether the second software package is abnormal, wherein the startup parameters include: at least one of the progress of initialization, the transmission status of the message and the startup time, and the startup time represents the startup time of the controller. When the second software package is detected to be abnormal, it is actively switched from the activation zone where the second software package is located to the non-activation zone through switching processing, and the third software package in the non-activation zone is run. In the whole process of recovering from the failure of the second software package to the operation of the third software package in the non-activation zone, the second software package in the activation zone is automatically switched to the third software package in the non-activation zone, so as to realize accurate rollback to the third software package, and at the same time, it can also reduce the time of solving software failures, wherein the first software package and the third software package belong to the same software package.
[0093] In some embodiments of the present application, Figure 2 An optional process diagram of a software detection method provided in an embodiment of the present application Figure 2 , S102 can be implemented through S201 as follows:
[0094] S201, start a second software package, detect at least one startup parameter of the second software package's initialization progress, message transmission status, and startup time, and determine a detection result of the second software package; wherein the startup time represents a startup time of a controller.
[0095] In some embodiments of the present application, the vehicle terminal starts a second software package, detects at least one startup parameter of the second software package, including initialization progress, message transmission status, and startup time, and obtains at least one detection result of the initialization progress detection result, the message transmission status detection result, and the startup time detection result, and determines the detection result of the second software package based on the at least one detection result.
[0096] In some embodiments of the present application, the vehicle terminal detects the initialization progress of the second software package to determine a first detection result of the second software package; detects the transmission status of the message of the second software package to determine a second detection result of the second software package; detects the startup time of the second software package to determine a third detection result of the second software package; and determines the detection result of the second software package based on at least one of the first detection result, the second detection result and the third detection result.
[0097] It can be understood that by detecting at least one startup parameter of the initialization progress of the second software package, the transmission status of the message and the startup time and determining the detection result, self-detection of the second software package can be achieved, and there is no need to obtain whether the second software package has any abnormality through the upper-level controller, which can save time for obtaining whether the second software package has any abnormality.
[0098] In some embodiments of the present application, Figure 3 An optional process diagram of a software detection method provided in an embodiment of the present application Figure 3 , S201 can be implemented by S301, S302, S303 and S304 as follows:
[0099] S301: Detect the initialization progress of the second software package to determine a first detection result of the second software package.
[0100] In some embodiments of the present application, the vehicle terminal detects the initialization progress of the second software package through the first flag bit to determine the first detection result of the second software package.
[0101] In some embodiments of the present application, the vehicle terminal detects the progress of initialization of the second software package through a first flag bit; wherein the first flag bit indicates whether the initialization of the second software package is completed; if the value of the first flag bit is a first value, the first detection result is determined to be normal; wherein the first value indicates that the initialization of the second software package is completed; if the value of the first flag bit is a second value, the first detection result is determined to be abnormal; wherein the second value indicates that the initialization of the second software package is not completed.
[0102] Exemplarily, the first value of the first flag bit may be 1, and the second value of the first flag bit may be 0.
[0103] In some embodiments of the present application, the vehicle terminal detects the progress of initialization of the second software package through the first flag bit. If the value of the first flag bit is 1, the first detection result is determined to be normal. If the value of the first flag bit is 0, the first detection result is determined to be abnormal.
[0104] It can be understood that the progress of initialization of the second software package is detected through the first flag bit. If the value of the first flag bit is the first value, the first detection result is determined to be normal. If the value of the first flag bit is the second value, the first detection result is determined to be abnormal, which facilitates the subsequent determination of the detection result of the second software package based on the first detection result, further realizes self-detection of the second software package, and saves time for obtaining whether there is any abnormality in the second software package.
[0105] S302: Detect the transmission status of the message of the second software package to determine a second detection result of the second software package.
[0106] In some embodiments of the present application, the vehicle terminal detects the transmission status of the message of the second software package through the second flag bit to determine the second detection result of the second software package.
[0107] In some embodiments of the present application, the vehicle terminal detects the transmission status of the message of the second software package through the second flag bit; wherein the second flag bit indicates whether the controller successfully sends the first frame message; if the value of the second flag bit is the third value, the second detection result is determined to be normal; wherein the third value indicates that the controller successfully sends the first frame message; if the value of the second flag bit is the fourth value, the second detection result is determined to be abnormal; wherein the fourth value indicates that the controller did not send the first frame message.
[0108] Exemplarily, the third value of the second flag bit may be 1, and the fourth value of the second flag bit may be 0.
[0109] In some embodiments of the present application, the vehicle terminal detects the transmission status of the message of the second software package through the second flag bit. If the value of the second flag bit is 1, the second detection result is determined to be normal; if the value of the second flag bit is 0, the second detection result is determined to be abnormal.
[0110] It can be understood that, through the second flag bit, the transmission status of the message of the second software package is detected. If the value of the second flag bit is the third value, the second detection result is determined to be normal. If the value of the second flag bit is the fourth value, the second detection result is determined to be abnormal, which is convenient for subsequently determining the detection result of the second software package according to the second detection result, further realizing self-detection of the second software package, and saving time for obtaining whether there is any abnormality in the second software package.
[0111] S303: Detect the startup time of the second software package to determine a third detection result of the second software package.
[0112] In some embodiments of the present application, the vehicle terminal detects the startup time of the second software package through a time threshold to determine a second detection result of the second software package.
[0113] In some embodiments of the present application, the vehicle terminal detects the startup time of the second software package through a time threshold; wherein the time threshold is based on the startup time of the vehicle controller set in advance for vehicles of different car manufacturers, and vehicles of different car manufacturers correspond to different time thresholds; if the startup time is less than the time threshold, the third detection result is determined to be normal; if the startup time is equal to or greater than the time threshold, the third detection result is determined to be abnormal.
[0114] Exemplarily, the time threshold may be 30 seconds, the startup time is 20 seconds, and the vehicle terminal detects the startup time of the second software package through the time threshold of 30 seconds. Since the startup time of 20 seconds is less than the time threshold of 30 seconds, the third detection result of the second software package is determined to be normal.
[0115] It can be understood that the startup time of the second software package is detected through the time threshold. If the startup time is less than the time threshold, the third detection result is determined to be normal; if the startup time is equal to or greater than the time threshold, the third detection result is determined to be abnormal, which is convenient for subsequently determining the detection result of the second software package according to the third detection result, further realizing self-detection of the second software package, and saving time for obtaining whether there is any abnormality in the second software package.
[0116] S304: Determine a detection result of the second software package based on at least one of the first detection result, the second detection result, and the third detection result.
[0117] In some embodiments of the present application, the vehicle terminal may determine the detection result of the second software package based on at least one detection result among the first detection result, the second detection result, and the third detection result.
[0118] It can be understood that the initialization progress of the second software package, the transmission status of the message and the startup time are detected respectively to determine the first detection result, the second detection result and the third detection result of the second software package. Based on at least one of the first detection result, the second detection result and the third detection result, the detection result of the second software package is determined, so that the self-detection of the second software package can be realized, and it is not necessary to obtain whether the second software package is abnormal through the upper controller, which can save the time of obtaining whether the second software package is abnormal.
[0119] In some embodiments of the present application, determining the detection result of the second software package according to one of the three detection results includes: if the first detection result, or the second detection result, or the third detection result is normal, determining that the detection result of the second software package is normal; if the first detection result, or the second detection result, or the third detection result is abnormal, determining that the detection result of the second software package is abnormal.
[0120] Exemplarily, if the first detection result is normal, the vehicle terminal determines that the detection result of the second software package is normal; if the first detection result is abnormal, the vehicle terminal determines that the detection result of the second software package is abnormal.
[0121] Exemplarily, if the second detection result is normal, the vehicle terminal determines that the detection result of the second software package is normal; if the second detection result is abnormal, the vehicle terminal determines that the detection result of the second software package is abnormal.
[0122] Exemplarily, if the third detection result is normal, the vehicle terminal determines that the detection result of the second software package is normal; if the third detection result is abnormal, the vehicle terminal determines that the detection result of the second software package is abnormal.
[0123] In some embodiments of the present application, determining the detection result of the second software package according to two of the three detection results includes: if any two of the first detection result, the second detection result, and the third detection result are normal, determining that the detection result of the second software package is normal; if any two of the first detection result, the second detection result, and the third detection result are abnormal, determining that the detection result of the second software package is abnormal.
[0124] Exemplarily, if the first detection result is normal and the second detection result is normal, the vehicle terminal determines that the detection result of the second software package is normal; if the first detection result is abnormal and the second detection result is abnormal, the vehicle terminal determines that the detection result of the second software package is abnormal.
[0125] Exemplarily, if the first detection result is normal and the second detection result is normal, the vehicle terminal determines that the detection result of the second software package is normal; if the first detection result is normal and the second detection result is abnormal, the vehicle terminal determines that the detection result of the second software package is abnormal.
[0126] Exemplarily, if the first detection result is normal and the second detection result is normal, the vehicle terminal determines that the detection result of the second software package is normal; if the first detection result is abnormal and the second detection result is normal, the vehicle terminal determines that the detection result of the second software package is abnormal.
[0127] Exemplarily, if the first detection result is normal and the third detection result is normal, the vehicle terminal determines that the detection result of the second software package is normal; if the first detection result is abnormal and the third detection result is abnormal, the vehicle terminal determines that the detection result of the second software package is abnormal.
[0128] Exemplarily, if the first detection result is normal and the third detection result is normal, the vehicle terminal determines that the detection result of the second software package is normal; if the first detection result is normal and the third detection result is abnormal, the vehicle terminal determines that the detection result of the second software package is abnormal.
[0129] Exemplarily, if the first detection result is normal and the third detection result is normal, the vehicle terminal determines that the detection result of the second software package is normal; if the first detection result is abnormal and the third detection result is normal, the vehicle terminal determines that the detection result of the second software package is abnormal.
[0130] Exemplarily, if the second detection result is normal and the third detection result is normal, the vehicle terminal determines that the detection result of the second software package is normal; if the second detection result is abnormal and the third detection result is abnormal, the vehicle terminal determines that the detection result of the second software package is abnormal.
[0131] Exemplarily, if the second detection result is normal and the third detection result is normal, the vehicle terminal determines that the detection result of the second software package is normal; if the second detection result is normal and the third detection result is abnormal, the vehicle terminal determines that the detection result of the second software package is abnormal.
[0132] Exemplarily, if the second detection result is normal and the third detection result is normal, the vehicle terminal determines that the detection result of the second software package is normal; if the second detection result is abnormal and the third detection result is normal, the vehicle terminal determines that the detection result of the second software package is abnormal.
[0133] In some embodiments of the present application, determining the detection result of the second software package based on the three detection results includes: if the first detection result, the second detection result, and the third detection result are all normal, determining that the detection result of the second software package is normal; if at least one detection result among the first detection result, the second detection result, and the third detection result is abnormal, determining that the detection result of the second software package is abnormal.
[0134] Exemplarily, if the first test result is normal, the second test result is normal, and the third test result is normal, the vehicle terminal determines that the test result of the second software package is normal; if the first test result is normal, the second test result is abnormal, and the third test result is normal, the vehicle terminal determines that the test result of the second software package is abnormal.
[0135] For example, if the first test result is normal, the second test result is normal, and the third test result is normal, the vehicle terminal determines that the test result of the second software package is normal; if the first test result is normal, the second test result is normal, and the third test result is abnormal, the vehicle terminal determines that the test result of the second software package is abnormal.
[0136] Exemplarily, if the first test result is normal, the second test result is normal, and the third test result is normal, the vehicle terminal determines that the test result of the second software package is normal; if the first test result is abnormal, the second test result is normal, and the third test result is normal, the vehicle terminal determines that the test result of the second software package is abnormal.
[0137] Exemplarily, if the first detection result is normal, the second detection result is normal, and the third detection result is normal, the vehicle terminal determines that the detection result of the second software package is normal; if the first detection result is abnormal, the second detection result is abnormal, and the third detection result is normal, the vehicle terminal determines that the detection result of the second software package is abnormal.
[0138] For example, if the first detection result is normal, the second detection result is normal, and the third detection result is normal, the vehicle terminal determines that the detection result of the second software package is normal; if the first detection result is abnormal, the second detection result is normal, and the third detection result is abnormal, the vehicle terminal determines that the detection result of the second software package is abnormal.
[0139] For example, if the first test result is normal, the second test result is normal, and the third test result is normal, the vehicle terminal determines that the test result of the second software package is normal; if the first test result is normal, the second test result is abnormal, and the third test result is abnormal, the vehicle terminal determines that the test result of the second software package is abnormal.
[0140] Exemplarily, if the first detection result is normal, the second detection result is normal, and the third detection result is normal, the vehicle terminal determines that the detection result of the second software package is normal; if the first detection result is abnormal, the second detection result is abnormal, and the third detection result is abnormal, the vehicle terminal determines that the detection result of the second software package is abnormal.
[0141] It can be understood that, according to one detection result, two detection results, or three detection results among the first detection result, the second detection result, and the third detection result, the detection result of the second software package is determined, so as to further implement self-detection of the second software package and save time for obtaining whether there is any abnormality in the second software package.
[0142] In some embodiments of the present application, Figure 4 An optional process diagram of a software detection method provided in an embodiment of the present application Figure 4 , S103 can be implemented by S1031 and S1032 as follows:
[0143] S1031. If the detection result is abnormal, continue to perform function detection on the second software package until a maximum number of detection times is reached to obtain multiple detection results.
[0144] In some embodiments of the present application, the vehicle terminal detects the second software package. If the detection result is abnormal, the vehicle terminal continues to perform functional detection on the second software package until a maximum number of detection times is reached to obtain multiple detection results.
[0145] It should be noted that the maximum number of detections is set in advance.
[0146] S1032. If the multiple detection results are all abnormal, switch from the active area to the inactive area and run the third software package in the inactive area.
[0147] In some embodiments of the present application, the second software package of the vehicle terminal performs functional testing until the maximum number of tests is reached. After obtaining multiple test results, if the multiple test results are all abnormal, it switches from the activation area to the non-activation area and runs the third software package in the non-activation area.
[0148] It is understandable that if the test result is abnormal, the function test of the second software package will continue until the maximum number of tests is reached, and multiple test results will be obtained, which can prevent false detection of the second software package and ensure the accuracy of the detection of the second software package. If the multiple test results are abnormal, the activation area will be switched to the non-activation area, and the third software package in the non-activation area will be run. In the process of recovering from the failure of the second software package to the third software package in the non-activation area, the second software package in the activation area will be automatically switched to the third software package in the non-activation area, thereby achieving accurate rollback to the third software package. At the same time, it can also reduce the time to resolve software failures.
[0149] In some embodiments of the present application, before S102, S104, S105, S106 and S107 are also executed as follows:
[0150] S104: When the second software package in the activation area is started for the first time, a detection switch is started.
[0151] In some embodiments of the present application, when the second software package of the activation zone is started for the first time, the vehicle terminal starts the detection switch.
[0152] It should be noted that starting the detection switch can be to set the startup flag, that is, to set the value of the startup flag to 1. The value of the startup flag is set to 1 only when the second software package is started for the first time, and the second software package needs to be detected when it is started thereafter.
[0153] S105 , when the detection switch is in the startup state, initializing startup parameters corresponding to the chip startup phase, the boot software running phase, and the second software package running phase, and determining an initialization result.
[0154] In some embodiments of the present application, when the detection switch is turned on, the vehicle terminal initializes the startup parameters in the chip startup phase, the boot software running phase and the second software package running phase, and determines the initialization result.
[0155] In some embodiments of the present application, when the value of the startup flag is set to 1, the vehicle terminal initializes the first flag, the second flag and the startup time, and determines the initialization result.
[0156] S106: When the initialization result is determined and the second software package is started, the detection switch is turned off.
[0157] In some embodiments of the present application, after determining the initialization result and starting the second software package, the vehicle terminal turns off the detection switch.
[0158] It should be noted that starting the detection switch may reset the start flag, that is, setting the value of the start flag to 0.
[0159] S107: When the detection switch is turned off, detect the startup parameters of the second software package.
[0160] In some embodiments of the present application, when the detection switch is turned off, the vehicle terminal detects the startup parameters of the second software package.
[0161] It can be understood that by starting the detection switch, the startup parameters are initialized to facilitate the subsequent detection of the second software package.
[0162] In some embodiments of the present application, Figure 5A An optional cut-area diagram of a software detection method provided in an embodiment of the present application Figure 1 ,like Figure 5A As shown, the non-volatile memory (such as Nor Flsah) includes an active region and an inactive region. When the active region (Active Region) is updated to the new version of software B (i.e., the second software package), that is, the active region is SoftWare New, but there may be problems such as the new version being incompatible with the current vehicle segment or software function abnormalities (i.e., new version software B Fun Error), and you want to return to the old version of the program (i.e., the third software package) in the inactive region (InActive Region), that is, the inactive region is SoftWare Old. The conventional practice is to find a real vehicle and flash the previous version of the software, and then re-flash the previous version A program (i.e., the first software package). The whole process requires manual intervention, and the old software package is selected for flashing, and it is impossible to switch from the active region to the inactive region. Figure 5B An optional cut-area diagram of a software detection method provided in an embodiment of the present application Figure 2 ,like Figure 5BAs shown, the active region (Active Region) is SoftWare New, that is, the inactive region (InActive Region) is SoftWare Old. When the new software package is flashed into the controller, the software in the controller will detect whether there is an operation abnormality (that is, the self-detection of the software package). If the abnormal mechanism is triggered (that is, the new version of the software B FunError), the original area software (A, that is, the third software package) will be actively restored to run, that is, it will switch from the active region to the inactive region, that is, active rollback. In the related art, the process of passive rollback of the software package is that when the updated software in the controller (lower-level controller) is abnormal, the upper-level controller can indicate the rollback of the controller with the software upgrade abnormality through the original version indicated by the cloud of the car company, that is, the software rollback of the lower-level controller needs to be implemented through the instruction of the upper-level controller. Therefore, the active detection adopted in the embodiment of the present application realizes the method of active rollback, which saves the time of performing rollback when obtaining the second software package with an abnormality.
[0163] In some embodiments of the present application, Figure 6 An optional second software package startup schematic diagram of a software detection method provided in an embodiment of the present application, such as Figure 6 As shown in the figure, during the chip startup, boot (Boot) operation phase to the Appl (i.e., the second software package) operation phase, during the process of sending the first frame message, FlagA=1 is set to indicate that the initialization phase is completed, FlagB=1 is set to indicate that the Can controller successfully sends the first frame message (i.e., the Can message is sent normally), and time C is the startup time. The startup time requirement of the controller is set according to the inconsistent time requirements of different companies. Timeout means that the software is not in compliance with the specification; Bootloader uses the three variables ABC to determine whether Appl can run normally;
[0164] 1. After the new bundled software package is flashed, the Bootloader program flag is not pulled up for the first time. The WRITEONCE FLAG flag (i.e., the boot flag) is introduced, that is, the Appl flag is set for the first unconditional startup. After the first startup, the WRITE ONCE FLAG flag is turned off. The subsequent startups of Boot need to judge the above three variables.
[0165] 2. A normal Appl startup will meet the following three conditions:
[0166] 2.1: Flag A is successfully set (i.e. Flag A=1), and the software initialization phase (i.e. INIT initialization phase) is passed;
[0167] 2.2: Flag B is successfully set (Flag B=1), and the message can be sent normally (i.e., the Can message is sent normally);
[0168] 2.3: TimerC is less than the specification requirement;
[0169] 3. If the software running in the current area is detected to be invalid after the Bootloader program is started, a maximum number of attempts will be made, which can be set by yourself. If the software fails to start after the number of attempts is reached, the Boot software will automatically perform the area switching action.
[0170] It is understandable that when the first software package in the activation zone is updated, the second software package is determined, the second software package is started, and the startup parameters of the second software package are detected. The detection result can realize the self-detection of the second software package, and it is not necessary to obtain whether the second software package is abnormal through the upper controller, which can save the time of obtaining whether the second software package is abnormal, wherein the startup parameters include: at least one of the progress of initialization, the transmission status of the message and the startup time, and the startup time represents the startup time of the controller. When the second software package is detected to be abnormal, it is actively switched from the activation zone where the second software package is located to the non-activation zone through switching processing, and the third software package in the non-activation zone is run. In the whole process of recovering from the failure of the second software package to the operation of the third software package in the non-activation zone, the second software package in the activation zone is automatically switched to the third software package in the non-activation zone, so as to realize accurate rollback to the third software package, and at the same time, it can also reduce the time of solving software failures, wherein the first software package and the third software package belong to the same software package.
[0171] The present application also provides a software detection device. Figure 7 A schematic diagram of a software detection device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the software detection device 7 includes: an updating unit 701, a detection unit 702 and a cutting unit 703; wherein,
[0172] An updating unit 701 is used to determine a second software package when the first software package in the activation area is updated;
[0173] The detection unit 702 is used to start the second software package, detect the startup parameters of the second software package, and determine the detection result;
[0174] A zone switching unit 703 is configured to switch from the active zone to the inactive zone and run the third software package in the inactive zone if the detection result indicates that the operation is abnormal;
[0175] The startup parameters include: at least one of initialization progress, message transmission status and startup time; the first software package and the third software package belong to the same software package; and the startup time represents the startup time of the controller.
[0176] In some embodiments of the present application, the detection unit 702 is further used to start the second software package, detect at least one startup parameter of the initialization progress, message transmission status and startup time of the second software package, and determine the detection result of the second software package; wherein the startup time represents the startup time of the controller.
[0177] In some embodiments of the present application, the software detection device 7 further includes: a determination unit 704; wherein,
[0178] The detection unit 702 is further configured to detect the initialization progress of the second software package to determine a first detection result of the second software package; detect the transmission status of the message of the second software package to determine a second detection result of the second software package; detect the startup time of the second software package to determine a third detection result of the second software package;
[0179] The determining unit 704 is configured to determine a detection result of the second software package based on at least one of the first detection result, the second detection result, and the third detection result.
[0180] In some embodiments of the present application, the detection unit 702 is further configured to detect the progress of initialization of the second software package through the first flag bit; wherein the first flag bit indicates whether the initialization of the second software package is completed;
[0181] The determination unit 704 is further configured to determine that the first detection result is normal if the value of the first flag bit is a first value, wherein the first value indicates that initialization of the second software package is completed; and to determine that the first detection result is abnormal if the value of the first flag bit is a second value, wherein the second value indicates that initialization of the second software package is not completed.
[0182] In some embodiments of the present application, the detection unit 702 is further used to detect the transmission status of the message of the second software package through the second flag bit; wherein the second flag bit indicates whether the controller successfully sends the first frame message;
[0183] The determination unit 704 is also used to determine that the second detection result is normal if the value of the second flag bit is a third value; wherein the third value indicates that the controller successfully sends the first frame message; if the value of the second flag bit is a fourth value, the second detection result is determined to be abnormal; wherein the fourth value indicates that the controller does not send the first frame message.
[0184] In some embodiments of the present application, the detection unit 702 is further configured to detect the startup time of the second software package through a time threshold; wherein the time threshold is a startup time of a vehicle controller set in advance based on vehicles of different car manufacturers, and vehicles of different car manufacturers correspond to different time thresholds;
[0185] The determination unit 704 is further configured to determine that the third detection result is normal if the startup time is less than a time threshold; and determine that the third detection result is abnormal if the startup time is equal to or greater than the time threshold.
[0186] In some embodiments of the present application, the determination unit 704 is further configured to determine that the detection result of the second software package is normal if the first detection result, the second detection result, and the third detection result are all normal; and to determine that the detection result of the second software package is abnormal if at least one detection result among the first detection result, the second detection result, and the third detection result is abnormal.
[0187] In some embodiments of the present application, the detection unit 702 is further configured to, if the detection result is abnormal, continue to perform function detection on the second software package until a maximum number of detection times is reached, thereby obtaining multiple detection results;
[0188] The area switching unit 703 is further configured to switch from the active area to the inactive area and run the third software package in the inactive area if multiple detection results are all abnormal.
[0189] In some embodiments of the present application, the software detection device 7 further includes: a startup unit 705 and a shutdown unit 706; wherein,
[0190] A starting unit 705, used to start the detection switch when the second software package in the activation area is started for the first time;
[0191] The determination unit 704 is further configured to initialize the startup parameters corresponding to the chip startup phase, the boot software running phase, and the second software package running phase when the detection switch is in the startup state, and determine the initialization result;
[0192] A closing unit 706, configured to close the detection switch when the initialization result is determined and the second software package is started;
[0193] The detection unit 702 is further configured to detect the startup parameters of the second software package when the detection switch is turned off.
[0194] Based on the software detection method of the above embodiment, the present application embodiment also provides a software detection device, such as Figure 8 As shown, Figure 8 A schematic diagram of the structure of a software detection device provided in an embodiment of the present application, the software detection device 8 comprises: a processor 801 and a memory 802. The memory 802 is used to store a computer program; the processor 801 is used to call and run the computer program from the memory to execute the software detection method of the above embodiment.
[0195] In the embodiment of the present application, the processor 801 may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It is understandable that for different devices, the electronic device used to implement the above-mentioned processor function may also be other, and the embodiment of the present application does not specifically limit it.
[0196] An embodiment of the present application provides a computer-readable storage medium storing a computer program for implementing the software detection method of any of the above embodiments when executed by a processor.
[0197] Exemplarily, the program instructions corresponding to a software detection method in the present embodiment may be stored on a storage medium such as a CD, a hard disk, or a USB flash drive. When the program instructions corresponding to a software detection method in the storage medium are read or executed by an electronic device, the software detection method of any of the above embodiments may be implemented.
[0198] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method of this embodiment.
[0199] A person skilled in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, read-only memories (ROM), magnetic disks or optical disks.
[0200] The modules described above as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules; they may be located in one place or distributed on multiple network units; some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0201] In addition, all functional modules in the embodiments of the present application can be integrated into one processing unit, or each module can be a separate unit, or two or more modules can be integrated into one unit; the above-mentioned integrated modules can be implemented in the form of hardware or in the form of hardware plus software functional units. It should be understood that "one embodiment" or "an embodiment" mentioned in this application means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present disclosure. Therefore, "in one embodiment" or "in one embodiment" appearing throughout the specification does 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.
[0202] It should be understood that in various embodiments of the present application, the size of the serial number of each step / process does not mean the order of execution, and the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present disclosure. The serial numbers of the above embodiments of the present disclosure are only for description and do not represent the advantages and disadvantages of the embodiments.
[0203] It should be noted that, in the application, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0204] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, 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 can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0205] The methods disclosed in several method embodiments provided in the embodiments of the present application can be arbitrarily combined without conflict to obtain new method embodiments.
[0206] The features disclosed in several product embodiments provided in the embodiments of the present application can be arbitrarily combined without conflict to obtain new product embodiments.
[0207] The features disclosed in several method or device embodiments provided in the embodiments of the present application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0208] The above is only an implementation method of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered within the protection scope of the embodiments of the present application.
Claims
1. A software detection method, characterized in that: include: When the first software package in the activation area is updated, determining a second software package in the activation area; Starting the second software package in the activation area, detecting the startup parameters of the second software package in the activation area, and determining the detection result; If the detection result indicates that the operation is abnormal, switching from the active area to the inactive area and running the third software package in the inactive area; The startup parameters include: at least one of initialization progress, message transmission status and startup time; the first software package and the third software package belong to the same software package; the startup time represents the startup time of the controller; Starting the second software package in the activation area, detecting the startup parameters of the second software package in the activation area, and determining the detection result, including: The second software package is started, and at least one startup parameter of the initialization progress, message transmission status, and startup time of the second software package is detected to determine the detection result of the second software package.
2. The software detection method according to claim 1, characterized in that: The detecting at least one startup parameter of the initialization progress, message transmission status, and startup time of the second software package to determine the detection result of the second software package includes: detecting the initialization progress of the second software package and determining a first detection result of the second software package; detecting a transmission status of a message of the second software package to determine a second detection result of the second software package; detecting the startup time of the second software package to determine a third detection result of the second software package; A detection result of the second software package is determined based on at least one of the first detection result, the second detection result, and the third detection result.
3. The software detection method according to claim 2, characterized in that: The detecting the initialization progress of the second software package to determine a first detection result of the second software package includes: The progress of initialization of the second software package is detected by using the first flag bit; wherein the first flag bit indicates whether the initialization of the second software package is completed; If the value of the first flag bit is a first value, it is determined that the first detection result is normal; wherein the first value indicates that the initialization of the second software package is completed; If the value of the first flag bit is a second value, the first detection result is determined to be abnormal; wherein the second value indicates that initialization of the second software package is not completed.
4. The software detection method according to claim 2, characterized in that: The detecting the transmission status of the message of the second software package to determine a second detection result of the second software package includes: The transmission status of the message of the second software package is detected through the second flag bit; wherein the second flag bit indicates whether the controller successfully sends the first frame message; If the value of the second flag bit is a third value, it is determined that the second detection result is normal; wherein the third value indicates that the controller successfully sends the first frame message; If the value of the second flag bit is a fourth value, it is determined that the second detection result is abnormal; wherein the fourth value indicates that the controller has not sent a first frame message.
5. The software detection method according to claim 2, characterized in that: The detecting the startup time of the second software package to determine a third detection result of the second software package includes: The startup time of the second software package is detected by a time threshold; wherein the time threshold is a startup time of a vehicle controller set in advance based on vehicles of different car manufacturers, and the vehicles of different car manufacturers correspond to different time thresholds; If the startup time is less than the time threshold, determining that the third detection result is normal; If the start-up time is equal to or greater than the time threshold, the third detection result is determined to be abnormal.
6. The software detection method according to claim 2, characterized in that: The determining the detection result of the second software package based on at least one of the first detection result, the second detection result, and the third detection result includes: If the first detection result, the second detection result, and the third detection result are all normal, determining that the detection result of the second software package is normal; If at least one of the first detection result, the second detection result, and the third detection result is abnormal, it is determined that the detection result of the second software package is abnormal.
7. The software detection method according to any one of claims 1 to 6, characterized in that: If the detection result indicates that the operation is abnormal, switching from the active area to the inactive area and running the third software package in the inactive area includes: If the test result is abnormal, continue to perform function test on the second software package until a maximum number of tests is reached to obtain multiple test results; If the multiple detection results are all abnormal, switching from the active area to the inactive area, and running the third software package in the inactive area.
8. The software detection method according to any one of claims 1 to 6, characterized in that: Before the step of starting the second software package and detecting the startup parameters of the second software package and determining the detection result, the method further includes: When the second software package in the activation zone is started for the first time, starting a detection switch; When the detection switch is in the startup state, initializing the startup parameters corresponding to the chip startup phase, the boot software running phase and the second software package running phase, and determining the initialization result; When the initialization result is determined and the second software package is started, turning off the detection switch; When the detection switch is turned off, the startup parameter of the second software package is detected.
9. A software detection device, characterized in that: The software detection device comprises: an updating unit, a detection unit and a cutting unit; wherein, An updating unit, configured to determine a second software package in the activation area when the first software package in the activation area is updated; a detection unit, configured to start the second software package in the activation area, detect a startup parameter of the second software package in the activation area, and determine a detection result; a zone switching unit, configured to switch from the active zone to the inactive zone and run a third software package in the inactive zone if the detection result indicates an abnormal operation; The startup parameters include: at least one of initialization progress, message transmission status and startup time; the first software package and the third software package belong to the same software package; the startup time represents the startup time of the controller; The detection unit is further used to start the second software package, detect at least one startup parameter of the initialization progress, message transmission status and startup time of the second software package, and determine the detection result of the second software package.
10. A software detection device, characterized in that: include: processor and memory, wherein The memory is used to store computer programs; The processor is used to call and run the computer program from the memory to execute the software detection method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: Executable instructions are stored, which are used to cause a processor to execute and implement the software detection method described in any one of claims 1 to 8.
Citation Information
Patent Citations
Software upgrading method and device of vehicle-mounted controller, equipment and storage medium
CN114895947A