Search

CN-121984683-A - Method and system for first activation of vehicle-mounted terminal after factory setting recovery

CN121984683ACN 121984683 ACN121984683 ACN 121984683ACN-121984683-A

Abstract

The invention provides a method and a system for activating a vehicle-mounted terminal for the first time after factory setting is restored, belonging to the technical field of vehicle-mounted software; and performing resource acquisition tasks in sequence to acquire a certificate ready event state, wherein the resource acquisition tasks comprise certificate loading, key loading, token acquisition and configuration table pulling, and acquiring a two-dimensional code for activating the vehicle-mounted terminal when the network available event state is network available and the certificate ready event state is certificate ready. The invention converts parallel risks into controllable serial, is convenient for system maintenance and problem investigation, greatly reduces average code output time of first startup, improves user experience, supports idempotent caching, can reduce code output time of second startup, improves system response speed, automatically waits for network readiness, avoids invalid retry caused by network late arrival, reduces invalid request to cloud, reduces cloud pressure and improves overall stability.

Inventors

  • LEI LEI
  • WAN JUAN

Assignees

  • 东风汽车集团股份有限公司

Dates

Publication Date
20260505
Application Date
20260112

Claims (10)

  1. 1. The method for activating the vehicle-mounted terminal for the first time after restoring the factory setting is characterized by comprising the following steps: Acquiring a network available event state; Sequentially and serially executing resource acquisition tasks to acquire a certificate ready event state, wherein the resource acquisition tasks comprise certificate loading, key loading, token acquisition and configuration table pulling; And when the network available event state is network available and the certificate ready event state is certificate ready, acquiring the two-dimensional code for activating the vehicle-mounted terminal.
  2. 2. The method of claim 1, further comprising logging the log information with a structured log, the fields of the structured log comprising a phase, time consuming, error code.
  3. 3. The method of claim 2, further comprising outputting a global abnormal spam user interface when any resource acquisition task fails, the global abnormal spam user interface providing a retry or restart entry and displaying an error code.
  4. 4. The method of claim 1,2 or 3, wherein the sequentially executing the resource acquisition tasks in series acquires the certificate ready event status, the resource acquisition tasks including certificate loading, key loading, token acquisition, configuration table pulling steps include: The method comprises the steps that certificate loading, key loading, token acquisition and configuration table pulling four resource acquisition tasks are defined as four sequential serial stages in a serial pipeline to be executed, any stage is not completed, and the subsequent stages are not started; When all four phases are performed, the certificate ready event state is set to ready.
  5. 5. The method of claim 4, wherein the four resource acquisition tasks of certificate loading, key loading, token acquisition, configuration table pulling are defined as four sequential serial stages in a serial pipeline for execution, any stage is incomplete, and the step of not initiating a subsequent stage further comprises: And independently configuring the back-off coefficient, the maximum number of times and the maximum time consumption for each stage, and when any stage is not executed, retrying according to the back-off coefficient, the maximum number of times and the maximum time consumption configured in the stage.
  6. 6. The method of claim 4, wherein the four resource acquisition tasks of certificate loading, key loading, token acquisition, configuration table pulling are defined as four sequential serial stages in a serial pipeline for execution, any stage is incomplete, and the step of not initiating a subsequent stage further comprises: the exclusive lock is used to ensure that the whole serial pipeline single instance is executed serially.
  7. 7. The method of claim 4, wherein the four resource acquisition tasks of certificate loading, key loading, token acquisition, configuration table pulling are defined as four sequential serial stages in a serial pipeline for execution, any stage is incomplete, and the step of not initiating a subsequent stage further comprises: the results of each stage are cached to the encryption storage.
  8. 8. A system for first activation of a vehicle terminal after restoration of factory settings, configured to enable the method of any one of claims 1 to 7, the system comprising: the network monitoring module is used for acquiring the network available event state; The task execution module is used for sequentially executing resource acquisition tasks to acquire a certificate ready event state, wherein the resource acquisition tasks comprise certificate loading, key loading, token acquisition and configuration table pulling; The two-dimension code acquisition module is used for acquiring a two-dimension code for activating the vehicle-mounted terminal when the network availability event state is network availability and the certificate ready event state is certificate ready.
  9. 9. An electronic device, comprising: One or more processors; A memory for storing one or more programs; when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1 to 7.
  10. 10. A computer readable medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the steps of the method according to any of claims 1 to 7.

Description

Method and system for first activation of vehicle-mounted terminal after factory setting recovery Technical Field The invention relates to the technical field of vehicle-mounted software, in particular to a method and a system for activating a vehicle-mounted terminal for the first time after factory setting is restored. Background After the automobile engine is restored to factory setting, the system needs to reload a plurality of key resources such as equipment certificates, equipment keys, cloud token, configuration tables and the like from the security partition, and is limited by factors such as eMMC reading and writing, HSM checking, network RTT and the like, and 20s-60s are needed for first startup. Existing schemes typically employ parallel calls or simple retries, but suffer from the following drawbacks: the parallel call causes multithreading to access unfinished safe storage at the same time, and the problems of empty certificate/key, token authentication failure, interface error reporting and the like occur; A single simple retry cannot distinguish the cause of failure when no network or certificate is not ready, the user experience is poor, and the avalanche request may be triggered by frequent user clicks. Disclosure of Invention The invention aims to solve at least one of the problems in the prior art, and provides an integrated solution capable of serializing key resource loading, independently retrying according to stages, network monitoring self-adaptive refreshing and global abnormal bottom. In a first aspect, an embodiment of the present invention provides a method for first activating a vehicle terminal after restoring factory settings, where the method includes: Acquiring a network available event state; Sequentially and serially executing resource acquisition tasks to acquire a certificate ready event state, wherein the resource acquisition tasks comprise certificate loading, key loading, token acquisition and configuration table pulling; And when the network available event state is network available and the certificate ready event state is certificate ready, acquiring the two-dimensional code for activating the vehicle-mounted terminal. In a preferred embodiment, logging information is also included using a structured log, the fields of the structured log including phase, time consuming, error codes. In a preferred embodiment, when any resource acquisition task fails, a global exception spam user interface is output that provides a retry or restart entry and displays an error code. In a preferred embodiment, the resource acquisition task is sequentially and serially executed to acquire the state of the certificate ready event, and the resource acquisition task comprises the steps of certificate loading, key loading, token acquisition and configuration table pulling, wherein the steps comprise: The method comprises the steps that certificate loading, key loading, token acquisition and configuration table pulling four resource acquisition tasks are defined as four sequential serial stages in a serial pipeline to be executed, any stage is not completed, and the subsequent stages are not started; When all four phases are performed, the certificate ready event state is set to ready. In a preferred embodiment, the steps of defining the four resource acquisition tasks of certificate loading, key loading, token acquisition and configuration table pulling as four sequential serial stages in the serial pipeline are executed, any stage is not completed, and the following stage non-initiation step further includes: And independently configuring the back-off coefficient, the maximum number of times and the maximum time consumption for each stage, and when any stage is not executed, retrying according to the back-off coefficient, the maximum number of times and the maximum time consumption configured in the stage. In a preferred embodiment, the steps of defining the four resource acquisition tasks of certificate loading, key loading, token acquisition and configuration table pulling as four sequential serial stages in the serial pipeline are executed, any stage is not completed, and the following stage non-initiation step further includes: the exclusive lock is used to ensure that the whole serial pipeline single instance is executed serially. In a preferred embodiment, the steps of defining the four resource acquisition tasks of certificate loading, key loading, token acquisition and configuration table pulling as four sequential serial stages in the serial pipeline are executed, any stage is not completed, and the following stage non-initiation step further includes: the results of each stage are cached to the encryption storage. In a second aspect, an embodiment of the present invention provides a system for first activating a vehicle-mounted terminal after restoring factory settings, configured to be capable of implementing any one of the methods in the first aspect, where the system includes