The invention provides a method and
system for activating a vehicle-mounted terminal for the first time after factory settings are restored, and belongs to the technical field of vehicle-mounted
software. Resource acquisition tasks are serially executed in sequence, the
certificate ready event state is acquired, and 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, obtaining a two-dimensional code for activating the vehicle-mounted terminal. According to the invention, parallel risks are converted into controllable serial risks, which is convenient for
system maintenance and
troubleshooting; according to the invention, the average code output time consumption of first-time startup is greatly reduced, and the user experience is improved; the method supports idempotent cache, can reduce the time consumption of code output during secondary startup, and improves the response speed of the
system; according to the method, the network is automatically waited to be ready, invalid retry caused by late arrival of the network is avoided, invalid requests to the cloud are reduced, the cloud pressure is reduced, and the overall stability is improved.