Search

CN-116028079-B - Upgrading method and device for vehicle application program

CN116028079BCN 116028079 BCN116028079 BCN 116028079BCN-116028079-B

Abstract

The embodiment of the application provides a method and a device for upgrading a vehicle application program, wherein a software remote upgrading service engine comprises a state machine manager and a state machine corresponding to each application program, the state machine manager is used for receiving information sent by a service and distributing the information to the state machine corresponding to each application program, and the state machine is used for driving each application program according to driving behaviors corresponding to the information. According to the embodiment of the application, the application can be used as an upgrading object, the upgrading object can be controlled more finely, and the SOTA flow of the application can be realized more accurately and efficiently.

Inventors

  • LIU XINBEI

Assignees

  • 经纬恒润(天津)研究开发有限公司

Dates

Publication Date
20260512
Application Date
20221215

Claims (20)

  1. 1. The method is applied to a state machine in a software remote upgrading service engine, the software remote upgrading service engine comprises a state machine manager and a state machine corresponding to each application program, the state machine manager is used for receiving messages sent by a service and distributing the messages to the state machines corresponding to the application programs, and the state machine is used for driving the application programs according to driving behaviors corresponding to the messages, and the method comprises the following steps: In the case of receiving an upgrade message of a target application sent by a state machine manager, detecting a current state of the target application, Receiving event information in the current state, the event information including information of an event generated in the process of upgrading the target application, When the event is processed in the current state of the target application, the target application is migrated from the current state to a target state so as to finish upgrading the target application; The current state comprises an unavailable update state, the event information comprises information of an available update inquiry event and an unavailable update state overtime event, the target state comprises an available upgrade inquiry state, the target application is migrated from the current state to the target state when the event is processed in the current state of the target application, the method comprises the steps of migrating the target application from the unavailable update state to the available upgrade inquiry state when the available update inquiry event and/or the unavailable update state overtime event are processed in the unavailable update state of the target application, and clearing the unavailable update state overtime event in a buffer area of a state machine under the condition that the unavailable update state overtime event is processed; The current state comprises an unavailable update state, the event information comprises information of an active push event of a new version, the target state comprises information of waiting for a user to confirm a download state, the target application is migrated from the current state to the target state when the event is processed in the current state of the target application, and the method further comprises the step of migrating the target application from the unavailable update state to waiting for the user to confirm the download state when the active push event of the new version is processed in the unavailable update state of the target application.
  2. 2. The method of claim 1, wherein the current state comprises a query for available upgrade state, the event information comprises information of a new version event detected, a new version of active push event not detected, and a query for available upgrade state timeout event, the target state comprises a wait for a user to confirm download state and no available upgrade state, and the transitioning the target application from the current state to a target state while processing the event in the current state of the target application further comprises: when a new version event and/or a new version active pushing event is detected in the inquiry available upgrading state of the target application, the target application is migrated from the inquiry available upgrading state to a state waiting for user confirmation to download, And when the new version event is not detected and/or the inquiry available upgrading state overtime event is processed in the inquiry available upgrading state of the target application, the target application is migrated from the inquiry available upgrading state to the unavailable upgrading state, and the inquiry available upgrading state overtime event in a buffer area of the state machine is cleared under the condition of processing the inquiry available upgrading state overtime event.
  3. 3. The method of claim 1, wherein the current state comprises waiting for a user to confirm a download state, the event information comprises information for a user to confirm a new version of the downloaded event, the target state comprises a download policy check state, and the transitioning the target application from the current state to a target state while processing the event in the current state of the target application further comprises: And when the event of confirming the downloading of the new version by the user is processed in the state of confirming the downloading by the waiting user of the target application, the target application is migrated from the state of confirming the downloading by the waiting user to the downloading strategy checking state, and the event of confirming the downloading of the new version by the user in a buffer area of a state machine is cleared.
  4. 4. The method of claim 1, wherein the current state comprises information waiting for a user to acknowledge a download state, the event information comprising a new version of an active push event and waiting for a user to acknowledge a download state timeout event, the method further comprising: And when the target application waits for the user to confirm the downloading state to process the active pushing event of the new version and/or waits for the user to confirm the downloading state to time out the event, maintaining the current state as the waiting user to confirm the downloading state, and under the condition of processing the waiting user to confirm the downloading state to time out the event, clearing the waiting user to confirm the downloading state to time out the event in a buffer area of the state machine.
  5. 5. The method of claim 1, wherein the current state comprises a download policy check state, the event information comprises information of a download pre-condition check passing event, the target state comprises a state in which a download is performed, and the migrating the target application from the current state to a target state when the event is processed in the current state of the target application, further comprising: When a download pre-condition check passing event is processed in the download policy check state of the target application, the target application is migrated from the download policy check state to a state in which download is being executed, and the download pre-condition check passing event in a buffer of a state machine is cleared.
  6. 6. The method of claim 1, wherein the current state comprises a download policy check state, the event information comprises information of a download pre-condition check failure event, a download policy check state timeout event, and a download pre-condition check retry event, the method further comprising: When a download pre-condition check failure event and/or a download policy check state timeout event is processed in the download policy check state of the target application, configuration information of a state machine is obtained, the configuration information comprises retry times and retry periods of the download pre-condition check, When the retry number is not 0, subtracting 1 from the retry number, and processing a download precondition to check for a retry event with the retry period as a delay, Maintaining the current state of the target application as a download policy check state, and clearing a download pre-condition check failure event, a download policy check state timeout event and a download pre-condition check retry event in a buffer of a state machine, And when the retry number is 0, the target application is migrated from a download strategy checking state to a state waiting for a user to confirm a result, the retry number is reset to be the target number, and a download pre-condition checking failure event and a download strategy checking state overtime event in a buffer zone of a state machine are cleared.
  7. 7. The method of claim 1, wherein the current state comprises a state in which a download is performed, the event information comprises information of a download success event, the target state comprises waiting for a user to confirm an upgrade state, and the transitioning the target application from the current state to a target state while processing the event in the current state of the target application further comprises: And when a download success event is processed in the state of the target application in the process of executing and downloading, the target application is migrated from the state of executing and downloading to a state of waiting for the user to confirm upgrading.
  8. 8. The method of claim 1, wherein the current state comprises a state in which a download is being performed, the event information comprises information of a download failure event, a state timeout event in which a download is being performed, and a user cancel download event, the target state comprises a state waiting for a user to confirm a result and a state waiting for a user to confirm a download, and the method further comprises, when the event is being processed in the current state of the target application, migrating the target application from the current state to a target state: when processing download failure event and/or status time-out event in executing download of the target application in the status in executing download, the target application is migrated from the status in executing download to the status waiting for user confirmation result, and the status time-out event in executing download in the buffer of the state machine is cleared in the case of processing status time-out event in executing download, And when the user cancel downloading event is processed in the state of the target application in the process of executing downloading, the target application is migrated from the state of executing downloading to the state of waiting for the user to confirm the downloading, and the user cancel downloading event in the buffer area of the state machine is cleared.
  9. 9. The method of claim 1, wherein the current state comprises a wait for user to confirm upgrade state, the event information comprises information of user to confirm installation event, user to cancel new version installation event, the target state comprises an upgrade policy check state and a wait for user to confirm download state, the target application is migrated from the current state to a target state while processing the event in the current state of the target application, further comprising: when processing the user-confirmed installation event in the state of waiting for user confirmation of upgrading of the target application, the target application is migrated from the state of waiting for user confirmation of upgrading to the state of checking upgrading strategy, and the user-confirmed installation event in a buffer zone of a state machine is cleared, And when the user cancel new version installation event is processed in the state of waiting for user confirmation of the upgrade of the target application, the target application is migrated from the state of waiting for user confirmation of the upgrade to the state of waiting for user confirmation of the download, and the user cancel new version installation event in a buffer area of a state machine is cleared.
  10. 10. The method of claim 1, wherein the current state comprises waiting for a user to confirm an upgrade state, the event information comprises information of a timeout event waiting for a user to confirm an upgrade state, the method further comprising: and when the overtime event waiting for the user to confirm the upgrading state is processed in the state waiting for the user to confirm the upgrading state of the target application, maintaining the current state of the target application as the overtime event waiting for the user to confirm the upgrading state in a buffer zone of a state machine.
  11. 11. The method of claim 1, wherein the current state comprises an upgrade policy check state, the event information comprises information of an upgrade pre-condition check passing event, the target state comprises a state in which an upgrade is performed, and the migrating the target application from the current state to a target state when the event is processed in the current state of the target application further comprises: and when the upgrade pre-condition check passing event is processed in the upgrade policy check state of the target application, the target application is migrated from the upgrade policy check state to a state in which upgrade is performed, and the upgrade pre-condition check passing event in a buffer area of a state machine is cleared.
  12. 12. The method of claim 1, wherein the current state comprises an upgrade policy check state, the event information comprises information of an upgrade pre-condition check failure event, an upgrade policy check state timeout event, and an upgrade pre-condition check retry event, the method further comprising: When an upgrade pre-condition check failure event and/or an upgrade policy check state timeout event is processed in the upgrade policy check state of the target application, configuration information of a state machine is acquired, the configuration information comprises retry times and retry periods of the upgrade pre-condition check, When the retry number is not 0, subtracting 1 from the retry number, and processing the upgrade precondition with the retry period as delay to check the retry event, Maintaining the current state of the target application as an upgrade policy check state, and clearing upgrade pre-condition check failure events, upgrade policy check state timeout events and upgrade pre-condition check retry events in a buffer of a state machine, And when the retry number is 0, the target application is migrated from the upgrade strategy checking state to a state waiting for a user to confirm a result, the retry number is reset to be the target number, and an upgrade pre-condition checking failure event and an upgrade strategy checking state overtime event in a buffer area of a state machine are cleared.
  13. 13. The method of claim 1, wherein the current state comprises a state in which an upgrade is performed, the event information comprises information of an installation completion event, the target state comprises an upgrade result verification state, and the migrating the target application from the current state to a target state when the event is processed in the current state of the target application further comprises: and when the installation completion event is processed in the state of the target application in the process of executing the upgrade, the target application is migrated from the state of executing the upgrade to the upgrade result verification state.
  14. 14. The method of claim 1, wherein the current state comprises a state in which an upgrade is performed, the event information comprises information of a state timeout event in which an upgrade is performed, the target state comprises a waiting for a user to confirm a result state, and the transitioning the target application from the current state to a target state while the event is processed in the current state of the target application further comprises: And when the state timeout event in the execution upgrading of the target application is processed in the state in the execution upgrading of the target application, the target application is migrated from the state in the execution upgrading to a state waiting for confirmation of a result by a user, and the state timeout event in the execution upgrading in a buffer zone of a state machine is cleared.
  15. 15. The method of claim 1, wherein the current state comprises an upgrade result verification state, the event information comprises information of a verification success event and a verification failure event, the target state comprises a wait for a user to confirm a result state, the migrating the target application from the current state to a target state while processing the event in the current state of the target application, further comprising: And when a verification success event or a verification failure event is processed in the upgrading result verification state of the target application, the target application is migrated from the upgrading result verification state to a state waiting for a user to confirm the result, and the verification success event and the verification failure event in a buffer area of a state machine are cleared.
  16. 16. The method of claim 1, wherein the current state comprises an upgrade result verification state, the event information comprises information of an upgrade result verification state timeout event and a check version retry event, the method further comprising: when the upgrade result verification state timeout event is processed in the upgrade result verification state of the target application, acquiring configuration information of a state machine, wherein the configuration information comprises retry times and retry periods, When the retry number is not 0, the retry number is reduced by 1, and the retry period is used as delay to process the check version retry event, Maintaining the current state of the target application as the upgrade result verification state, and clearing upgrade result verification state timeout events and check version retry events in a buffer of a state machine, And when the retry number is 0, the target application is migrated from the upgrade result verification state to a state waiting for the user to confirm the result, the retry number is reset to be the target number, and the upgrade result verification state timeout event in the buffer area of the state machine is cleared.
  17. 17. The method of claim 1, wherein the current state comprises a wait for user to confirm result state, the event information comprises information for user to confirm upgrade result event, the target state comprises an unavailable update state, the target application is migrated from the current state to a target state while processing the event in the current state of the target application, further comprising: And when the user confirmation upgrading result event is processed in the state of waiting for the user confirmation result of the target application, the target application is migrated from the state of waiting for the user confirmation result to the state of no available update, and the user confirmation upgrading result event in a buffer area of the state machine is cleared.
  18. 18. The method of claim 1, wherein the current state comprises a wait for user to confirm a result state, the event information comprises information waiting for a user to confirm a result state timeout event, the method further comprising: And when the state overtime event of the waiting user confirmation result is processed in the state of the waiting user confirmation result of the target application, maintaining the current state of the target application as the state of the waiting user confirmation result, and clearing the state overtime event of the waiting user confirmation result in a buffer zone of a state machine.
  19. 19. The method according to claim 1, wherein the method further comprises: writing the target state and data generated during the process of upgrading the target application into a database, When the state machine is started, the target state of the target application is acquired from a database.
  20. 20. An upgrade apparatus for a vehicle application program, the apparatus being applied to a state machine, the apparatus comprising: A detection module for detecting the current state of the target application under the condition of receiving the upgrade message of the target application sent by the state machine manager, A receiving module for receiving event information in the current state, the event information including information of an event generated in the process of upgrading the target application, A state migration module, configured to migrate, when the event is processed in the current state of the target application, the target application from the current state to a target state, so as to complete upgrading of the target application; The current state comprises an unavailable update state, the event information comprises information of an available update inquiry event and an unavailable update state overtime event, the target state comprises an available update inquiry state, the state migration module is further used for migrating the target application from the unavailable update state to the available update inquiry state when the available update inquiry event and/or the unavailable update state overtime event are processed in the unavailable update state of the target application, and clearing the unavailable update state overtime event in a buffer area of a state machine under the condition of processing the unavailable update state overtime event; The current state comprises an unavailable update state, the event information comprises information of an active push event of a new version, the target state comprises a state waiting for a user to confirm downloading, and the state migration module is further used for migrating the target application from the unavailable update state to the state waiting for the user to confirm downloading when the active push event of the new version is processed in the unavailable update state of the target application.

Description

Upgrading method and device for vehicle application program Technical Field The application belongs to the field of remote upgrading of vehicles, and particularly relates to a method and a device for upgrading a vehicle application program. Background Currently, software-over-the-air (SOTA) is implemented mainly based on Service-Oriented Architecture (SOA) of an Auto SAR (Auto SAR) open system architecture (Automotive Open System Architecture). However, the SOTA technology realized based on the AntoSAR SOA architecture provides technical support for remote upgrade of the software package of each electronic control unit (Electronic Control Unit, ECU) at the vehicle end, the object of the upgrade is the ECU software package, the above SOTA upgrade mode is software upgrade for the whole ECU, the sub-functions provided by each ECU are diversified, and one ECU can control a plurality of software, so that the above scheme cannot realize finer control of the upgrade object. Disclosure of Invention The embodiment of the application provides a method and a device for upgrading a vehicle application program, which can solve the problems that in the prior art, an SOTA upgrading mode is software upgrading for a whole ECU, sub functions provided by each ECU are diversified, and one ECU can control a plurality of software, so that the scheme cannot realize finer control of an upgrading object. In a first aspect, an embodiment of the present application provides a method for upgrading a vehicle application, where the method is applied to a state machine, and the method includes: In the case of receiving an upgrade message of a target application transmitted by a state machine manager, detecting a current state of the target application, receiving event information in the current state, the event information including information of an event generated in the process of upgrading the target application, And when the event is processed in the current state of the target application, the target application is migrated from the current state to the target state so as to finish upgrading the target application. In one embodiment, the current state includes an unavailable update state, the event information includes information of a query available update event and an unavailable update state timeout event, the target state includes a query available upgrade state, and when the event is processed in the current state of the target application, the target application is migrated from the current state to the target state, including: And when the available update inquiring event and/or the available update state timeout event are processed in the unavailable update state of the target application, the target application is migrated from the unavailable update state to the available update inquiring state, and the unavailable update state timeout event in a buffer area of the state machine is cleared under the condition that the unavailable update state timeout event is processed. In one embodiment, the current state includes a no available update state, the event information includes information of a new version of the active push event, the target state includes information of waiting for a user to confirm the download state, and when the event is processed in the current state of the target application, the method further includes: And when the active pushing event of the new version is processed in the unavailable updating state of the target application, the target application is migrated from the unavailable updating state to a state waiting for the user to confirm the downloading. In one embodiment, the current state includes a query available upgrade state, the event information includes information of a detected new version event, a new version of an active push event, a non-detected new version event, and a query available upgrade state timeout event, the target state includes a waiting for a user to confirm a download state and a no available update state, and when the event is processed in the current state of the target application, the method further includes: when the process detects a new version event and/or a new version active push event in the inquiry available upgrade state of the target application, the target application is migrated from the inquiry available upgrade state to a state waiting for user confirmation of downloading, When no new version event and/or no update available state timeout event is detected in the process of the update available state of the target application, the target application is migrated from the update available state to the update unavailable state, and the update available state timeout event in a buffer area of the state machine is cleared under the condition of processing the update available state timeout event. In one embodiment, the current state includes information waiting for a user to confirm the download state, the event information includes a new version of the acti