Local authentication method and electronic device

By retaining the installation package in an electronic device when the local authentication is invalid and delaying the pre-authentication operation, the user experience and resource waste caused by local authentication failure are solved, and more efficient installation package management and system reliability are achieved.

CN117390604BActive Publication Date: 2024-11-05HONOR DEVICE CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202311251077.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-15
Publication Date
2024-11-05
Estimated Expiration
2042-08-15

AI Technical Summary

Technical Problem

The electronic device immediately deletes the installation package when local authentication fails, resulting in poor user experience and increasing the expense of re-downloading.

Method used

The installation package will not be deleted when the local authentication is invalid. The pre-authentication operation will be re-execute when waiting for the network connection to be available, and a night installation timer will be set to delay the installation attempt to avoid unnecessary re-downloading.

Benefits of technology

Save re-download resources, enhance user experience and improve system reliability, and ensure that the installation package is effectively authenticated and installed when the network is available.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117390604B_ABST
    Figure CN117390604B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a local authentication method and an electronic device. In the technical solution provided by the embodiment of the present invention, the method includes: when the electronic device is in a first state, obtaining pre-authentication data of a downloaded installation package; obtaining a local authentication result according to the pre-authentication data; when the local authentication result includes invalidity, connecting to a server to perform a pre-authentication operation when a network connection is available. The embodiment of the present invention does not delete the installation package when the local authentication is invalid, saving re-downloading expenses and enhancing the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent with application date of August 15, 2022, application number 202210976626.0, and invention name “A local authentication method and electronic device”. [Technical field]

[0002] The present invention relates to the field of computer technology, and in particular to a local authentication method and electronic equipment. [Background technology]

[0003] The network of the electronic device is relatively stable for a period of time after the installation package (such as OTA package) is downloaded. In order to solve the problem of no network during the scheduled installation at night, after the installation package is downloaded, it will first query the server whether the currently downloaded installation package can be used for installation. If it can be used for installation, the pre-authentication data will be written in the cache file. This process is called pre-authentication. When the scheduled installation at night is triggered, if the network is available, the electronic device will initiate installation authentication to the server; if the network is not available, the electronic device will perform installation authentication based on the pre-authentication data. This process is called local authentication.

[0004] Currently, when an electronic device performs local authentication on an installation package, the installation package is deleted if the authentication fails, which increases the cost of re-downloading and reduces the user experience. [Summary of the invention]

[0005] In view of this, the embodiments of the present invention provide a local authentication method and an electronic device, which will not delete the installation package when the local authentication is invalid, thereby saving the cost of re-downloading and enhancing the user experience.

[0006] In a first aspect, an embodiment of the present invention provides a local authentication method, the method comprising:

[0007] When the electronic device is in the first state, obtaining pre-authentication data of the downloaded installation package;

[0008] Obtaining a local authentication result based on the pre-authentication data;

[0009] When the local authentication result includes invalid, connecting to the server to perform a pre-authentication operation when a network connection is available.

[0010] In combination with the first aspect, in some implementations of the first aspect, when the local authentication result includes invalid, the method further includes:

[0011] Sets the next nightly installation timer for the installation package.

[0012] In combination with the first aspect, in some implementations of the first aspect, when the local authentication result includes success, the method further includes:

[0013] Execute the installation operation of the installation package.

[0014] In combination with the first aspect, in some implementations of the first aspect, when the local authentication result includes a failure, the method further includes:

[0015] Delete the installation package and its version information.

[0016] In combination with the first aspect, in some implementations of the first aspect, the method further includes:

[0017] Generate a prompt message, the prompt message is used to remind the user that the installation package will be deleted and remind the user to re-download the latest installation package.

[0018] In combination with the first aspect, in certain implementations of the first aspect, the first state includes a nighttime installation timer of the installation package being triggered, an installation condition of the installation package being met, and a network connection of the electronic device being unavailable.

[0019] In combination with the first aspect, in some implementations of the first aspect, the pre-authentication data includes an authentication Token, a version code list of successful authentications, and an authentication result returned by the server.

[0020] In combination with the first aspect, in certain implementations of the first aspect, when the pre-authentication data is not obtained, or the authentication Token is not equal to the local authentication Token, or the version code list in the installation package is not equal to the version code list in which the authentication succeeds, the local authentication result includes invalidity.

[0021] In combination with the first aspect, in certain implementations of the first aspect, when the pre-authentication data has been acquired, and the authentication Token is equal to the local authentication Token, and the version code list in the installation package is equal to the version code list of the successful authentication, and the authentication result returned by the server is successfully saved in a specified file, the local authentication result includes success.

[0022] In combination with the first aspect, in certain implementations of the first aspect, when the pre-authentication data has been acquired, the authentication Token is equal to the local authentication Token, the version code list in the installation package is equal to the version code list of the successful authentication, and the authentication result returned by the server is not successfully saved to the specified file, the local authentication result includes failure.

[0023] In combination with the first aspect, in some implementations of the first aspect, the designated file includes an update_auth_sa file.

[0024] In combination with the first aspect, in some implementations of the first aspect, the installation package includes an OTA package.

[0025] In a second aspect, an embodiment of the present invention provides an electronic device, comprising a processor and a memory, wherein the memory is used to store a computer program, and the computer program comprises program instructions, and when the processor runs the program instructions, the electronic device executes the method described above.

[0026] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program request is executed by a computer, the computer is caused to execute the method as described above.

[0027] In the technical solution of the local authentication method and electronic device provided by the embodiment of the present invention, the method comprises: when the electronic device is in a first state, obtaining pre-authentication data of the downloaded installation package; obtaining a local authentication result according to the pre-authentication data; when the local authentication result includes invalid, connecting to the server to perform a pre-authentication operation when the network connection is available. The embodiment of the present invention does not delete the installation package when the local authentication is invalid, saving the re-download expenses and enhancing the user experience.

Brief Description of the Drawings

[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0029] Figure 1 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;

[0030] Figure 2 is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention;

[0031] Figure 3 A schematic diagram of a local authentication result provided by an embodiment of the present invention;

[0032] Figure 4 A flowchart of a local authentication method provided by an embodiment of the present invention;

[0033] Figure 5 A flowchart of another local authentication method provided by an embodiment of the present invention;

[0034] Figure 6 for Figure 5 A specific flow chart of obtaining a local authentication result based on pre-authentication data;

[0035] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. [Specific implementation method]

[0036] In order to better understand the technical solution of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0037] It should be clear that the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0038] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.

[0039] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0040] Figure 1 A schematic structural diagram of an electronic device 100 is shown.

[0041] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0042] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0043] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0044] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0045] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0046] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0047] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0048] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0049] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0050] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0051] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0052] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0053] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0054] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0055] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0056] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0057] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0058] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0059] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0060] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0061] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0062] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0063] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0064] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0065] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0066] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0067] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0068] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0069] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0070] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0071] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0072] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.

[0073] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0074] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0075] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0076] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0077] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

[0078] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0079] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0080] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.

[0081] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0082] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.

[0083] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0084] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0085] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0086] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0087] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0088] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0089] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0090] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.

[0091] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0092] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0093] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0094] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0095] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system of the layered architecture is taken as an example to exemplify the software structure of the electronic device 100.

[0096] Figure 2 1 is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.

[0097] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0098] The application layer can include a series of application packages.

[0099] like Figure 2 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0100] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0101] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0102] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0103] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0104] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0105] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0106] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0107] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0108] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0109] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0110] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0111] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0112] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0113] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0114] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0115] A 2D graphics engine is a drawing engine for 2D drawings.

[0116] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0117] The following is an illustrative description of the workflow of the software and hardware of the electronic device 100 in conjunction with capturing a photo scene.

[0118] When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, and other information). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer and identifies the control corresponding to the input event. For example, if the touch operation is a touch single-click operation and the control corresponding to the single-click operation is the control of the camera application icon, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer to capture static images or videos through the camera 193.

[0119] Currently, after the installation package is published to the server, it may be disabled due to vulnerabilities. When the installation package is disabled, electronic devices that have downloaded this version of the installation package will not be able to install the installation package.

[0120] Before installing an installation package, the electronic device needs to perform installation authentication, that is, the electronic device queries the server whether the currently downloaded installation package can be used for installation; when the server returns that it can be installed, the electronic device will perform subsequent installation logic; when the server returns that it cannot be installed, the electronic device will remind the user that the downloaded installation package is invalid and delete the locally downloaded installation package.

[0121] Installation authentication requires that the electronic device meets installation conditions (such as no calls, locked screen, sufficient battery, sufficient storage space, no need for protocol permission, etc.), the network is available, and the result of whether it can be used for installation can be successfully obtained from the server; otherwise, the installation authentication and installation cannot be completed, and it is necessary to wait until the electronic device is idle at night to try again. If the network is still unavailable during the scheduled installation at night, it is necessary to wait until the next scheduled installation at night is triggered to remind the user to connect to the Internet for installation authentication and installation, resulting in the user being unable to experience the new version in a timely manner.

[0122] The network of the electronic device is relatively stable for a period of time after the installation package (such as OTA package) is downloaded. In order to solve the problem of no network during the scheduled installation at night, after the installation package is downloaded, it will first query the server whether the currently downloaded installation package can be used for installation. If it can be used for installation, the pre-authentication data will be written in the cache file. This process is called pre-authentication. When the scheduled installation at night is triggered, if the network is available, the electronic device will initiate installation authentication to the server; if the network is not available, the electronic device will perform installation authentication based on the pre-authentication data. This process is called local authentication.

[0123] Currently, when an electronic device performs local authentication on an installation package, the installation package is deleted if the authentication fails, which increases the cost of re-downloading and reduces the user experience.

[0124] Based on the above technical problems, the embodiments of the present invention provide a local authentication method and an electronic device, which will not delete the installation package when the local authentication is invalid, saving the cost of re-downloading, enhancing the user experience, and reducing the low reliability of the electronic device system.

[0125] Figure 3 A schematic diagram of a local authentication result provided by an embodiment of the present invention. Figure 3 As shown, the local authentication results include success, failure or invalid.

[0126] When the local authentication result includes success, the electronic device performs an installation operation of the installation package. The installation package includes an OTA package.

[0127] When the local authentication result includes failure, the electronic device generates a prompt message, which is used to remind the user that the installation package will be deleted and to remind the user to re-download the latest installation package and delete the installation package and its version information.

[0128] When the local authentication result includes invalid, the electronic device monitors the network, connects to the server to perform pre-authentication operations when the network connection is available, and sets the next nighttime installation timer of the installation package. Register the system network change broadcast, when the electronic device receives the network change broadcast and determines that the network connection is available, it connects to the server for pre-authentication, and after the pre-authentication is successful, the pre-authentication data is stored locally, and will be used when there is no network when the next nighttime installation timer is triggered.

[0129] For example, the next night installation timer is set, and the night installation is fixed to be executed twice between 2 am and 4 am, with an interval of 1 hour each time. If the current night installation is triggered between 2 am and 3 am, the next night installation timer will be set 1 hour later, otherwise it will be set between 2 am and 3 am the next day.

[0130] In an embodiment of the present invention, when the electronic device is in the first state, the pre-authentication data of the downloaded installation package is obtained, and a local authentication result is obtained according to the pre-authentication data. The first state includes the night installation timer of the installation package being triggered, the installation conditions of the installation package being met, and the network connection of the electronic device being unavailable. The pre-authentication data includes the authentication token, the version code list of successful authentication, and the authentication result returned by the server.

[0131] Exemplarily, the installation conditions of the installation package include sufficient power and sufficient storage space of the electronic device.

[0132] In the embodiment of the present invention, when the pre-authentication data is not obtained, or the authentication Token is not equal to the local authentication Token, or the version code list in the installation package is not equal to the version code list of the successful authentication, the local authentication result includes invalid.

[0133] Among them, the pre-authentication data is not obtained, that is, the pre-authentication data is empty. In this case, there are two possibilities. One possibility is that the electronic device has not performed the pre-authentication operation; the other possibility is that the electronic device has no result in connecting to the server for authentication during pre-authentication.

[0134] Among them, when the authentication token and the local authentication token are not equal, the data may be tampered with, or the local data is the authentication data of the last authentication.

[0135] Among them, when the version code list in the installation package and the version code list of the successful authentication are not equal, the data may be tampered with, or the local data is the authentication data of the last authentication.

[0136] In the embodiment of the present invention, when the pre-authentication data has been obtained, the authentication token is equal to the local authentication token, the version code list in the installation package is equal to the version code list of the successful authentication, and the authentication result returned by the server is successfully saved in the specified file, the local authentication result includes success. The specified file includes the update_auth_sa file.

[0137] In an embodiment of the present invention, when the pre-authentication data has been obtained, the authentication Token is equal to the local authentication Token, the version code list in the installation package is equal to the version code list of the successful authentication, and the authentication result returned by the server is not successfully saved to the specified file, the local authentication result includes failure.

[0138] The embodiment of the present invention divides unsuccessful local authentication results into failure and invalid. When the local authentication result is invalid, the installation package is not deleted. At the same time, network changes are monitored and the next nighttime installation timer is set. When the network connection is available, the server is connected to re-execute the pre-authentication operation, thereby saving re-downloading expenses, enhancing user experience, and improving the system reliability of the electronic device.

[0139] Figure 4 A flow chart of a local authentication method provided by an embodiment of the present invention. Figure 4 As shown, the method includes:

[0140] Step 202: When the electronic device is in the first state, obtain pre-authentication data of the downloaded installation package.

[0141] Step 204: Obtain a local authentication result based on the pre-authentication data.

[0142] Step 206: When the local authentication result includes invalid, connect to the server to perform a pre-authentication operation when the network connection is available.

[0143] In the technical solution of the local authentication method provided by the embodiment of the present invention, the method comprises: when the electronic device is in the first state, obtaining the pre-authentication data of the downloaded installation package; obtaining the local authentication result according to the pre-authentication data; when the local authentication result includes invalid, connecting to the server to perform the pre-authentication operation when the network connection is available. In the embodiment of the present invention, the installation package will not be deleted when the local authentication is invalid, saving the re-download expenses and enhancing the user experience.

[0144] Figure 5 A flowchart of another local authentication method provided by an embodiment of the present invention. Figure 5 As shown, the method includes:

[0145] Step 302: When the electronic device is in the first state, obtain pre-authentication data of the downloaded installation package.

[0146] The hardware structure and software structure of the electronic device provided by the embodiment of the present invention can be found in Figure 1 and Figure 2 Related description about electronic device 100.

[0147] The pre-authentication data includes the authentication token, the version code list of successful authentication, and the authentication result returned by the server.

[0148] Step 304, obtain a local authentication result according to the pre-authentication data. When the local authentication result includes invalid, execute step 306; when the local authentication result includes success, execute step 312; when the local authentication result includes failure, execute step 316 and steps 318 and 320.

[0149] In the embodiment of the present invention, Figure 6 As shown, step 304 specifically includes:

[0150] Step 304a, determine whether pre-authentication data is obtained; if so, execute step 304b; if not, execute step 306.

[0151] Step 304b, determine whether the authentication Token in the pre-authentication data is equal to the local authentication Token. If so, execute step 304c; if not, execute step 306.

[0152] Step 304c, determine whether the version code list in the installation package and the successfully authenticated version code list in the pre-authentication data are equal, if so, execute step 304d; if not, execute step 306.

[0153] Step 304d: Save the authentication result returned by the server in the pre-authentication data to a designated file.

[0154] Specifies that files include the update_auth_sa file.

[0155] Step 304e, determine whether the authentication result returned by the server is successfully saved to the specified file. If so, execute step 312; if not, execute step 316.

[0156] Step 306: Return that the local authentication result is invalid, and continue to execute steps 308 and 310.

[0157] Step 308: Connect to the server to perform pre-authentication when network connection is available, and the process ends.

[0158] Step 310: Set the next nighttime installation timer of the installation package, and the process ends.

[0159] Step 312: Return the local authentication result successfully.

[0160] Step 314: Execute the installation operation of the installation package, and the process ends.

[0161] Step 316, returning the local authentication result fails, and continuing to execute steps 318 and 320.

[0162] Step 318: Generate a prompt message, which is used to remind the user that the installation package will be deleted and to remind the user to re-download the latest installation package. The process ends.

[0163] Step 320: Delete the installation package and its version information.

[0164] In the technical solution of the local authentication method provided by the embodiment of the present invention, the method comprises: when the electronic device is in the first state, obtaining the pre-authentication data of the downloaded installation package; obtaining the local authentication result according to the pre-authentication data; when the local authentication result includes invalid, connecting to the server to perform the pre-authentication operation when the network connection is available. The embodiment of the present invention will not delete the installation package when the local authentication is invalid, saving the re-download expenses and enhancing the user experience.

[0165] Figure 7 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. It should be understood that the electronic device 400 can execute each step in the above local authentication method, and in order to avoid repetition, it will not be described in detail here. The electronic device 400 includes: a processing unit 401.

[0166] The processing unit 401 is used to obtain pre-authentication data of the downloaded installation package when the electronic device is in the first state; obtain a local authentication result according to the pre-authentication data; and when the local authentication result includes invalidity, connect to the server to perform a pre-authentication operation when a network connection is available.

[0167] Optionally, when the local authentication result includes invalid, the processing unit 401 is further configured to set a next nighttime installation timer for the installation package.

[0168] Optionally, when the local authentication result includes success, the processing unit 401 is further configured to execute an installation operation of the installation package.

[0169] Optionally, when the local authentication result includes failure, the processing unit 401 is further configured to delete the installation package and its version information.

[0170] Optionally, the processing unit 401 is further configured to generate a prompt message, wherein the prompt message is configured to remind the user that the installation package will be deleted and to remind the user to re-download the latest installation package.

[0171] Optionally, the first state includes a nighttime installation timer of the installation package being triggered, an installation condition of the installation package being satisfied, and a network connection of the electronic device being unavailable.

[0172] Optionally, the pre-authentication data includes an authentication Token, a list of successfully authenticated version codes, and an authentication result returned by the server.

[0173] Optionally, when the pre-authentication data is not obtained, or the authentication Token is not equal to the local authentication Token, or the version code list in the installation package is not equal to the version code list of the successfully authenticated version, the local authentication result includes invalid.

[0174] Optionally, when the pre-authentication data has been acquired, the authentication Token is equal to the local authentication Token, the version code list in the installation package is equal to the version code list of the successful authentication, and the authentication result returned by the server is successfully saved in the specified file, the local authentication result includes success.

[0175] Optionally, when the pre-authentication data has been acquired, the authentication Token is equal to the local authentication Token, the version code list in the installation package is equal to the version code list of the successful authentication, and the authentication result returned by the server is not successfully saved to the specified file, the local authentication result includes failure.

[0176] Optionally, the designated file includes an update_auth_sa file.

[0177] Optionally, the installation package includes an OTA package.

[0178] It should be understood that the electronic device 400 here is embodied in the form of a functional unit. The term "unit" here can be implemented in the form of software and / or hardware, and is not specifically limited to this. For example, a "unit" can be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application-specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a proprietary processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a merged logic circuit, and / or other suitable components that support the described functions.

[0179] Therefore, the units of each example described in the embodiments of the present invention can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0180] The embodiment of the present application provides an electronic device, which may be a terminal device or a circuit device built into the terminal device. The electronic device may be used to execute the functions / steps in the above method embodiment.

[0181] An embodiment of the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes the functions / steps in the above method embodiment.

[0182] The embodiment of the present application also provides a computer program product comprising instructions, and when the computer program product is run on a computer or any at least one processor, the computer executes the functions / steps in the above method embodiment.

[0183] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0184] Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0185] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0186] In several embodiments provided in the present application, any function can be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for enabling an electronic device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0187] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A local authentication method, It is characterized in that The method comprises: When the electronic device is in the first state, obtaining pre-authentication data of the downloaded installation package, the pre-authentication data being the data written into the cache file after the electronic device queries the server whether the currently downloaded installation package can be used for installation after completing the download of the installation package, and if so, the pre-authentication data; If the electronic device fails to obtain the pre-authentication data, the installation package is not deleted.

2. The method according to claim 1, It is characterized in that In the case that the electronic device fails to obtain the pre-authentication data, the method further includes: Sets the next nightly installation timer for the installation package.

3. The method according to claim 1, It is characterized in that The method further comprises: When the electronic device obtains the pre-authentication data, determining whether the authentication Token in the pre-authentication data and the local authentication Token are equal; If it is determined that the authentication Token in the pre-authentication data is equal to the local authentication Token, determine whether the version code list in the installation package is equal to the version code list of the successfully authenticated version in the pre-authentication data; If it is determined that the version code list in the installation package is equal to the successfully authenticated version code list in the pre-authentication data, saving the authentication result returned by the server in the pre-authentication data to a designated file; Determine whether the authentication result returned by the server is successfully saved to the specified file; If it is determined that the authentication result returned by the server is successfully saved in the designated file, the installation operation of the installation package is executed.

4. The method according to claim 3, It is characterized in that After determining whether the authentication result returned by the server is successfully saved in the specified file, the method further includes: If it is determined that the authentication result returned by the server is not successfully saved to the designated file, the installation package and its version information are deleted.

5. The method according to claim 4, It is characterized in that After determining that the authentication result returned by the server is not successfully saved in the designated file, the method further includes: Generate a prompt message, the prompt message is used to remind the user that the installation package will be deleted and remind the user to re-download the latest installation package.

6. The method according to claim 1, It is characterized in that The pre-authentication data includes the authentication Token, the version code list of successful authentication and the authentication result returned by the server.

7. The method according to claim 3, It is characterized in that After determining whether the authentication Token in the pre-authentication data is equal to the local authentication Token, the method further includes: If it is determined that the authentication Token in the pre-authentication data is not equal to the local authentication Token, continue to execute the step of not deleting the installation package and connecting to the server to perform the pre-authentication operation when the network connection is available.

8. The method according to claim 3, It is characterized in that After determining whether the version code list in the installation package and the successfully authenticated version code list in the pre-authentication data are equal, the method further includes: If it is determined that the version code list in the installation package and the successfully authenticated version code list in the pre-authentication data are not equal, continue to execute the step of not deleting the installation package and connecting to the server to perform the pre-authentication operation when the network connection is available.

9. The method according to any one of claims 3-5, 7-8, It is characterized in that The designated files include the update_auth_sa file.

10. The method according to any one of claims 1 to 8, It is characterized in that The installation package includes an OTA package.

11. The method according to claim 9, It is characterized in that The installation package includes an OTA package.

12. An electronic device, It is characterized in that The electronic device comprises a processor and a memory, wherein the memory is used to store a computer program, and the computer program comprises program instructions. When the processor runs the program instructions, the electronic device executes the steps of the method according to any one of claims 1 to 11.

13. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program request is executed by a computer, the computer is enabled to execute the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Individual mobile terminal data packet downloading method

    CN101159896A

  • Method and device for installing application software

    CN103577206A

  • Remote control upgrading method and device

    CN105979313A

  • Application program authentication method and system

    CN111159657A

  • Cipher chip embedded application installation method and device

    CN112925535A