WO2021073337A1 - 安装插件的方法、装置和存储介质 - Google Patents

安装插件的方法、装置和存储介质 Download PDF

Info

Publication number
WO2021073337A1
WO2021073337A1 PCT/CN2020/115374 CN2020115374W WO2021073337A1 WO 2021073337 A1 WO2021073337 A1 WO 2021073337A1 CN 2020115374 W CN2020115374 W CN 2020115374W WO 2021073337 A1 WO2021073337 A1 WO 2021073337A1
Authority
WO
WIPO (PCT)
Prior art keywords
plug
version number
electronic device
framework
application
Prior art date
Application number
PCT/CN2020/115374
Other languages
English (en)
French (fr)
Inventor
谷岳
印文帅
万柯
许翔
李明江
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP20877330.9A priority Critical patent/EP4033354A4/en
Priority to US17/754,870 priority patent/US20240095000A1/en
Publication of WO2021073337A1 publication Critical patent/WO2021073337A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Definitions

  • This application relates to the field of electronic technology, and in particular to a method, device and storage medium for installing a plug-in.
  • Plug-in concept After a software project is developed and used interactively, some new functions need to be added. It is usually hoped that the newly added functions can be implanted into the system without modifying the original application. This is the so-called Plug-in, the newly added function module is called plug-in. Plug-inization can greatly reduce the coupling between modules, facilitate the independent maintenance of each module, and speed up the maintenance and update of the project.
  • Android App Bundle is an improved application packaging method that can greatly reduce the size of the application. It is Google's official dynamic publishing solution on the Android system. This solution can support splitting the application into multiple plug-ins, and the plug-ins can be downloaded and installed from the Google App Market.
  • the present application discloses a method, a device and a storage medium for installing plug-ins, which can meet the needs of users for separate download and installation of different plug-in capabilities, and improve user experience.
  • an embodiment of the present application provides a method for installing a plug-in, the method including:
  • the electronic device receives a first user operation, and the first user operation is used to request installation of a first plug-in related to a first application, where the first application is an application that has been installed locally on the electronic device, and the first application Comprising a first plug-in framework and at least one plug-in associated with the first plug-in framework, the main version number of each plug-in in the at least one plug-in is the same as the main version number of the first plug-in framework, and the at least one plug-in Each plug-in in the plug-in has a second version number corresponding to the plug-in, the first plug-in framework has a first version number, and both the first version number and the second version number include a major version number and a sub-version number And a stage version number, the first plug-in is different from the at least one plug-in;
  • the electronic device receives the first plug-in from the server;
  • the electronic device detects whether the main version number of the first plug-in and the main version number of the first plug-in framework are the same;
  • the electronic device installs the first plug-in.
  • the plug-in when the electronic device installs the plug-in, the plug-in can be installed by ensuring that the main version number of the plug-in is the same as the main version number of the plug-in framework.
  • the electronic device of this solution is more flexible when installing the plug-in and has higher compatibility.
  • this solution can satisfy users to download and install different plug-ins based on different needs, without having to install all plug-ins of the corresponding application, which improves the user experience.
  • the stage version number of the first plug-in is different from the stage version number of the first plug-in framework.
  • the plug-in when the electronic device installs the plug-in, the plug-in can be installed by ensuring that the main version number of the plug-in and the main version number of the plug-in framework are the same, and the phase version number of the plug-in and the phase version number of the plug-in framework are different.
  • the electronic device of this solution is more flexible when installing the plug-in and has higher compatibility.
  • the at least one plug-in includes a second plug-in
  • the first plug-in is an update plug-in corresponding to the second plug-in.
  • the version number of the first plug-in is higher than the version number of the second plug-in.
  • the plug-in installed in this solution may be an update plug-in corresponding to the plug-in included in the locally installed application.
  • the method includes:
  • the electronic device sends a request to the server at a preset time interval to confirm whether an update plug-in corresponding to at least one plug-in included in the first application installed locally on the electronic device is released in the server;
  • the electronic device detects whether the version number of the update plug-in is higher than that of the sixth plug-in The version number, wherein the at least one plug-in includes a sixth plug-in;
  • the electronic device displays a first user interface, and the first user interface is used to instruct the user to trigger the first user operation.
  • the first plug-in is a brand new plug-in of the first application.
  • the plug-in installed in this solution may also be a plug-in not included in the locally installed application, that is, a brand-new plug-in of the application.
  • the electronic device installing the first plug-in includes the electronic device installing the class loader of the first plug-in, and the electronic device installing the class loader of the first plug-in includes:
  • the electronic device confirms whether the first plug-in is configured with an isolated Split attribute
  • the electronic device obtains the storage path of the dynamic library file of the first plug-in;
  • the electronic device adds the storage path of the dynamic library file to the initial class loader and obtains the class loader of the first plug-in.
  • the electronic device when the electronic device detects that the plug-in is configured with the isolated Split attribute, it obtains the storage path of the dynamic library file of the plug-in and adds the storage path of the dynamic library file to the class loader to support the plug-in to access its internal dynamics. Library file.
  • the method further includes:
  • the electronic device When the electronic device detects the instruction for upgrading the system, the electronic device obtains a first system installation package from the server, the first system installation package contains at least one application installation package, and the at least one The application includes the first application, and the installation package of the first application includes a third plug-in; the at least one plug-in stored on the electronic device included in the installed first application includes a fourth plug-in and A fifth plug-in, the third plug-in, the fourth plug-in, and the fifth plug-in are plug-ins with different version numbers and the same identification, and the fourth plug-in is stored in a preset partition of the electronic device, and the fifth plug-in
  • the plug-ins are stored in the installation partition of the electronic device, wherein each plug-in carries an identification, and the identifications of the plug-ins corresponding to the same function icon are the same;
  • the electronic device detects whether the version number of the third plug-in is higher than that of all plug-ins that are included in the installed first application and are stored on the electronic device and have the same identification as the third plug-in. version number;
  • the electronic device detects whether the main version number of the third plug-in and the main version number of the first plug-in framework are the same;
  • the electronic device installs the third plug-in.
  • the version of each plug-in corresponding to the upgrade application after the completion of the Over-the-Air Technology update space download technology (OTA upgrade) of the electronic device is the highest version, so as to solve the problem of the OTA upgrade in the existing technology.
  • the version of the latter part of the plug-in has been downgraded.
  • the installation package of the first application further includes a second plug-in framework, and the first plug-in framework and the second plug-in framework are plug-in frameworks with different version numbers, and the method further includes:
  • the electronic device detects whether the version number of the second plug-in framework is higher than the version number of the first plug-in framework
  • the electronic device installs the second plug-in frame.
  • the version of the plug-in framework corresponding to the upgraded application after the OTA upgrade is completed by the electronic device is the highest version, so as to solve the shortcoming of version downgrade after the OTA upgrade in the prior art.
  • the first plug-in is an artificial intelligence AI plug-in.
  • the artificial intelligence AI plug-in includes one or more of the following: face recognition plug-in, image super-segmentation plug-in, intent recognition plug-in, text translation plug-in, speech recognition plug-in, vehicle voice wake-up plug-in, and vehicle device Speech recognition plug-in.
  • This solution can be applied to artificial intelligence (AI) terminals, and can be applied to artificial intelligence plug-ins.
  • AI artificial intelligence
  • an embodiment of the present application provides a method for installing a plug-in, the method including:
  • the electronic device When the electronic device detects the instruction for upgrading the system, the electronic device obtains the first system installation package from the server, the first system installation package contains the installation package of at least one application, and the at least one application contains the first system installation package.
  • the first application includes a first plug-in framework and at least one plug-in associated with the first plug-in framework, and the main version number of each plug-in in the at least one plug-in is the same as the main version of the first plug-in framework The same number, each of the at least one plug-in has a second version number corresponding to the plug-in, the first plug-in framework has a first version number, and both the first version number and the second version number include The main version number, the sub-version number and the stage version number, the installation package of the first application includes a third plug-in; the at least one plug-in stored on the electronic device included in the installed first application includes A fourth plug-in and a fifth plug-in, the third plug-in, the fourth plug-in and the fifth plug-in are plug-
  • the electronic device detects whether the version number of the third plug-in is higher than that of all plug-ins that are included in the installed first application and are stored on the electronic device and have the same identification as the third plug-in. version number;
  • the electronic device detects whether the main version number of the third plug-in and the main version number of the first plug-in framework are the same;
  • the electronic device installs the third plug-in.
  • the version of each plug-in corresponding to the upgrade application after the completion of the Over-the-Air Technology update space download technology (OTA upgrade) of the electronic device is the highest version, so as to solve the problem of the OTA upgrade in the existing technology.
  • the version of the latter part of the plug-in has been downgraded.
  • the installation package of the first application further includes a second plug-in framework, and the first plug-in framework and the second plug-in framework are plug-in frameworks with different version numbers, and the method further includes:
  • the electronic device detects whether the version number of the second plug-in framework is higher than the version number of the first plug-in framework
  • the electronic device installs the second plug-in frame.
  • the version of the plug-in framework corresponding to the upgraded application after the OTA upgrade is completed by the electronic device is the highest version, so as to solve the shortcoming of version downgrade after the OTA upgrade in the prior art.
  • the third plug-in is an artificial intelligence AI plug-in.
  • the artificial intelligence AI plug-in includes one or more of the following: face recognition plug-in, image super-segmentation plug-in, intent recognition plug-in, text translation plug-in, speech recognition plug-in, vehicle voice wake-up plug-in, and vehicle device Speech recognition plug-in.
  • This solution can be applied to artificial intelligence (AI) terminals, and can be applied to artificial intelligence plug-ins.
  • AI artificial intelligence
  • installing the third plug-in on the electronic device includes installing the class loader of the third plug-in on the electronic device, and installing the class loader of the third plug-in on the electronic device includes:
  • the electronic device confirms whether the third plug-in is configured with the isolated Split attribute
  • the electronic device obtains the storage path of the dynamic library file of the third plug-in;
  • the electronic device adds the storage path of the dynamic library file to the initial class loader and obtains the class loader of the third plug-in.
  • an embodiment of the present application provides a device, including: one or more processors, one or more memories; the one or more memories are coupled with the one or more processors, and the one or more Multiple memories are used to store computer program codes, the computer program codes including computer instructions, when the one or more processors execute the computer instructions, cause the apparatus to execute:
  • the device When the one or more processors execute the computer instructions, the device is caused to perform the following operations:
  • a first user operation is received, and the first user operation is used to request installation of a first plug-in related to a first application
  • the first application is an application installed locally on the device
  • the first application includes a first A plug-in framework and at least one plug-in associated with the first plug-in framework
  • the main version number of each plug-in in the at least one plug-in is the same as the main version number of the first plug-in framework
  • each plug-in in the at least one plug-in A plug-in has a second version number corresponding to the plug-in
  • the first plug-in framework has a first version number
  • both the first version number and the second version number include a major version number, a sub-version number, and a stage version No.
  • the first plug-in is different from the at least one plug-in;
  • the stage version number of the first plug-in is different from the stage version number of the first plug-in framework.
  • the device further executes: the at least one plug-in includes a second plug-in, and the first plug-in is an update plug-in corresponding to the second plug-in.
  • the device also executes: the first plug-in is a brand new plug-in of the first application.
  • the device also performs the following operations:
  • the storage path of the dynamic library file is added to the initial class loader to obtain the class loader of the first plug-in.
  • the device also performs the following operation: when an instruction for upgrading the system is detected, a first system installation package is obtained from the server, the first system installation package includes an installation package of at least one application, and the at least one The application includes the first application, and the installation package of the first application includes a third plug-in; the at least one plug-in stored on the device included in the installed first application includes a fourth plug-in and a third plug-in.
  • the third plug-in, the fourth plug-in, and the fifth plug-in are plug-ins with different version numbers and the same identification
  • the fourth plug-in is stored in the preset partition of the device
  • the fifth plug-in is Stored in the installation partition of the device, where each plug-in carries an identifier, and plug-ins corresponding to the same function icon have the same identifier;
  • the installation package of the first application further includes a second plug-in framework
  • the first plug-in framework and the second plug-in framework are plug-in frameworks with different version numbers
  • the device further performs the following operations:
  • the first plug-in is an artificial intelligence AI plug-in.
  • the artificial intelligence AI plug-in includes one or more of the following: a face recognition plug-in, an image super-division plug-in, an intent recognition plug-in, a text translation plug-in, a speech recognition plug-in, a vehicle voice wake-up plug-in, and a vehicle voice recognition plug-in.
  • the device is a terminal device or a part of a terminal device.
  • an embodiment of the present application further provides an apparatus, including: one or more processors, one or more memories; the one or more memories are coupled with the one or more processors, and the one Or multiple memories are used to store computer program codes, where the computer program codes include computer instructions;
  • the device When the one or more processors execute the computer instructions, the device is caused to perform the following operations:
  • a first system installation package is obtained from the server, the first system installation package includes an installation package of at least one application, the at least one application includes a first application, and the first system installation package includes an installation package of at least one application.
  • the application includes a first plug-in framework and at least one plug-in associated with the first plug-in framework, the main version number of each plug-in in the at least one plug-in is the same as the main version number of the first plug-in framework, and the at least Each plug-in in a plug-in has a second version number corresponding to the plug-in, the first plug-in framework has a first version number, and both the first version number and the second version number include a major version number and a sub-version Number and stage version number, the installation package of the first application includes a third plug-in; the at least one plug-in stored on the device included in the installed first application includes a fourth plug-in and a fifth plug-in The third plug-in, the fourth plug-in, and the fifth plug-in are plug-ins with different version numbers and the same identification, the fourth plug-in is stored in a preset partition of the device, and the fifth plug-in is stored in In the installation partition of the device, each plug-in carries an identifier, and plug
  • the installation package of the first application further includes a second plug-in framework, and the first plug-in framework and the second plug-in framework are plug-in frameworks with different version numbers, and the apparatus further performs the following operations:
  • the third plug-in is an artificial intelligence AI plug-in.
  • the device also performs the following operations:
  • the storage path of the dynamic library file is added to the initial class loader to obtain the class loader of the third plug-in.
  • the device is a terminal device or a part of a terminal device.
  • the present application provides a computer storage medium, including computer instructions, which when the computer instructions run on an electronic device, cause the electronic device to execute any of the possible implementation manners and/or the first aspect
  • a method provided by any possible implementation manner In the second aspect, a method provided by any possible implementation manner.
  • the embodiments of the present application provide a computer program product.
  • the computer program product runs on a computer
  • the computer executes any possible implementation manner of the first aspect and/or any possible implementation of the second aspect. Implement the method provided by the mode.
  • the device described in the third aspect, the device described in the fourth aspect, the computer storage medium described in the fifth aspect, or the computer program product described in the sixth aspect provided above are all used to execute the Any of the provided methods and any of the methods provided in the second aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here.
  • FIG. 1 is a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application.
  • FIG. 2 is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present application.
  • 3A is a schematic diagram of a plug-in implementation scenario provided by an embodiment of the present application.
  • FIG. 3B is a schematic diagram of another plug-in implementation scenario provided by an embodiment of the present application.
  • FIG. 4A is a schematic flowchart of a method for installing a plug-in provided by an embodiment of the present application
  • 4B to 4D are respectively schematic diagrams of a human-computer interaction interface provided by an embodiment of the present application.
  • 5A to 5B are respectively schematic diagrams of another human-computer interaction interface provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of another method for installing a plug-in provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a process of creating a class loader according to an embodiment of the present application.
  • FIG. 8 is a schematic diagram of creating a class loader according to an embodiment of the present application.
  • FIG. 9 is a schematic flowchart of a method for system upgrade provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of an electronic device provided by an embodiment of the present application when performing an OTA upgrade.
  • FIG. 1 is a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application.
  • 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, and an antenna 2.
  • Mobile communication module 150 wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
  • SIM Subscriber identification module
  • 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 sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light Sensor 180L, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100.
  • the electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait.
  • AP application processor
  • modem processor modem processor
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller may be the nerve center and command center of the electronic device 100.
  • the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 to store instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory can store instructions or data that the processor 110 has just used or used cyclically. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter/receiver (universal asynchronous) interface.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter/receiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB Universal Serial Bus
  • the I2C interface is a bidirectional synchronous serial bus, which includes a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may include multiple sets of I2C buses.
  • the processor 110 may couple the touch sensor 180K, the charger, the flash, the camera 193, etc., respectively through different I2C bus interfaces.
  • the processor 110 may couple the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through an I2C bus interface to implement the touch function of the electronic device 100.
  • the I2S interface can be used for audio communication.
  • the processor 110 may include multiple sets of I2S buses.
  • the processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170.
  • the audio module 170 may transmit audio signals to the wireless communication module 160 through an I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communication to sample, quantize and encode analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus can be a two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • the UART interface is generally used to connect the processor 110 and the wireless communication module 160.
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to realize the Bluetooth function.
  • the audio module 170 may transmit audio signals to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with the display screen 194, the camera 193 and other peripheral devices.
  • the MIPI interface includes a camera serial interface (camera serial interface, CSI), a display serial interface (display serial interface, DSI), and so on.
  • the processor 110 and the camera 193 communicate through a CSI interface to implement the shooting function of the electronic device 100.
  • the processor 110 and the display screen 194 communicate through a DSI interface to realize the display function of the electronic device 100.
  • the GPIO interface can be configured through software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and so on.
  • the GPIO interface can also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on.
  • 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 peripheral devices. It can also be used to connect earphones and play audio through earphones. This interface can also be used to connect to other electronic devices, such as AR devices.
  • the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely a schematic description, and does not constitute a structural limitation of the electronic device 100.
  • the electronic device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 140 may receive the charging input of the wired charger through the USB interface 130.
  • the charging management module 140 may receive the wireless charging input through the wireless charging coil of the electronic device 100. While the charging management module 140 charges the battery 142, it can also supply power to the electronic device through the power management module 141.
  • 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 charge management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, 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 times, and battery health status (leakage, impedance).
  • the power management module 141 may also be provided in the processor 110.
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
  • the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 150 can provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the electronic device 100.
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
  • the mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic wave radiation via the antenna 1.
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110.
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Then the demodulator 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 the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194.
  • the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellites.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication technology
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110.
  • the wireless communication module 160 may also receive the signal to be sent from the processor 110, perform frequency modulation, amplify it, and convert it into electromagnetic waves to radiate through the antenna 2.
  • the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with 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), broadband Code division multiple access (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, etc.
  • the GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite-based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite-based augmentation systems
  • the electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is an image processing microprocessor, which is connected to 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, which execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, and the like.
  • the display screen 194 includes a display panel.
  • the display panel can use liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the electronic device 100 may include one or N display screens 194, and N is a positive integer greater than one.
  • the electronic device 100 can realize a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
  • the ISP is used to process the data fed back by the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing and is converted into an image visible to the naked eye.
  • ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and is projected to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the electronic device 100 may include one or N cameras 193, and N is a positive integer greater than one.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • MPEG2 MPEG2, MPEG3, MPEG4, and so on.
  • NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, and so on.
  • the external memory interface 120 may 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 realize the data storage function. For example, save music, video and other files in an external memory card.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function.
  • the data storage area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 100.
  • 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 magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
  • UFS universal flash storage
  • the electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal.
  • the audio module 170 can also be used to encode and decode audio signals.
  • the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
  • the speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
  • the receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the electronic device 100 answers a call or voice message, it can receive the voice by bringing the receiver 170B close to the human ear.
  • the microphone 170C also called “microphone”, “microphone”, is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 170C through the human mouth, and input the sound signal into the microphone 170C.
  • the electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, which can implement noise reduction functions in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
  • the earphone interface 170D is used to connect wired earphones.
  • the earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, and a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA, CTIA
  • the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the pressure sensor 180A may be provided on the display screen 194.
  • the capacitive pressure sensor may include at least two parallel plates with conductive material. When a force is applied to 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.
  • the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations that act on the same touch position but have different touch operation strengths may correspond to different operation instructions. For example: when a touch operation whose intensity is less than the first pressure threshold is applied to 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.
  • the gyro sensor 180B may be used to determine the movement posture of the electronic device 100.
  • the angular velocity of the electronic device 100 around three axes ie, x, y, and z axes
  • the gyro sensor 180B can be used for image stabilization.
  • the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shake 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.
  • the air pressure sensor 180C is used to measure air pressure.
  • the electronic device 100 calculates the altitude based on the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
  • the magnetic sensor 180D includes a Hall sensor.
  • the electronic device 100 may use the magnetic sensor 180D to detect the opening and closing of the flip holster.
  • the electronic device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D.
  • features such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various 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 electronic devices, and apply to applications such as horizontal and vertical screen switching, pedometers and so on.
  • the electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F to measure the distance to achieve fast focusing.
  • 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 to the outside 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 the pocket mode will automatically unlock and lock the screen.
  • the ambient light sensor 180L is used to sense the brightness of the ambient light.
  • the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light.
  • 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 the pocket to prevent accidental touch.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
  • the temperature sensor 180J is used to detect temperature.
  • 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 value, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection.
  • the electronic device 100 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.
  • the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • Touch sensor 180K also called “touch panel”.
  • the touch sensor 180K may be disposed on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch 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.
  • the visual output related to the touch operation can be provided through the display screen 194.
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194.
  • the bone conduction sensor 180M can acquire vibration signals.
  • the bone conduction sensor 180M can obtain the vibration signal of the vibrating bone mass of the human voice.
  • the bone conduction sensor 180M can also contact the human pulse and receive the blood pressure pulse signal.
  • the bone conduction sensor 180M may also be provided in the earphone, combined with the bone conduction earphone.
  • the audio module 170 can parse the voice signal based on the vibration signal of the vibrating bone block of the voice obtained by the bone conduction sensor 180M, and realize the voice function.
  • the application processor can analyze the heart rate information based on the blood pressure beating signal obtained by the bone conduction sensor 180M, and realize the heart rate detection function.
  • the button 190 includes a power-on button, a volume button, and so on.
  • the button 190 may be a mechanical button. It can also be a touch button.
  • 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.
  • the motor 191 can generate vibration prompts.
  • the motor 191 can be used for incoming call vibration notification, and can also be used for touch vibration feedback.
  • touch operations that act on different applications can correspond to different vibration feedback effects.
  • Acting on touch operations in different areas of the display screen 194, the motor 191 can also correspond to different vibration feedback effects.
  • Different application scenarios for example: time reminding, receiving information, alarm clock, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, or to indicate messages, missed calls, notifications, and so on.
  • the SIM card interface 195 is used to connect to the SIM card.
  • the SIM card can be inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device 100.
  • the electronic device 100 may support 1 or N SIM card interfaces, and N is a positive integer greater than 1.
  • the SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
  • the same SIM card interface 195 can insert multiple cards 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 may also be compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as call and data communication.
  • the electronic device 100 adopts an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of the present invention takes an Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 by way of example.
  • FIG. 2 is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface.
  • 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.
  • the application layer can include a series of application packages.
  • the application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, and a notification manager.
  • the window manager is used to manage window programs.
  • the window manager can obtain the size of the display, determine whether there is a status bar, lock the screen, take a screenshot, etc.
  • the content provider is used to store and retrieve data and make these data accessible to applications.
  • the data may include videos, images, audios, phone calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls that display text, controls that display pictures, and so on.
  • the view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
  • the phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call status (including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can disappear automatically after a short stay without user interaction.
  • the notification manager is used to notify download completion, message reminders, and so on.
  • the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or a scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, prompt sounds, electronic devices vibrate, and indicator lights flash.
  • Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
  • 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.
  • the system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), three-dimensional graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to realize 3D graphics drawing, image rendering, synthesis, and layer processing.
  • the 2D graphics engine is a drawing engine for 2D drawing.
  • 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.
  • the corresponding hardware interrupt is sent to the kernel layer.
  • the kernel layer processes the touch operation into the original input event (including touch coordinates, time stamp of the touch operation, etc.).
  • the original input events are stored in the kernel layer.
  • the application framework layer obtains the original input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation, and the control corresponding to the click operation is the control of the camera application icon as an example, 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.
  • the camera 193 captures still images or videos.
  • the embodiment of the present application provides a method for installing a plug-in.
  • the electronic device receives the plug-in to be installed from the server and detects whether the main version number of the plug-in to be installed is the same as the main version number of the plug-in framework associated with the plug-in to be installed. At the same time, the electronic device installs the plug-in.
  • Plug-inization can greatly reduce the coupling between modules, facilitate the independent maintenance of each module, and speed up the maintenance and update of the project.
  • the plug-in framework is the basic functional module in the plug-in application, responsible for the management functions such as downloading, installing, loading, and unloading of the plug-in.
  • the version number can generally include a major version number, a sub-version number, and a stage version number.
  • the major version number corresponds to the first paragraph of the version number, and the major version number is determined by the project.
  • major changes in the functional modules of the project such as the addition of multiple modules or changes in the overall architecture, the major version number will be changed accordingly.
  • the sub-version number corresponds to the second paragraph of the version number.
  • the sub-version number will be modified.
  • stage version number corresponds to the third paragraph of the version number. It is usually a bug fix or some minor changes. A revised version can be released by fixing a serious bug.
  • each plug-in has a version number corresponding to the plug-in.
  • Each plug-in framework has a version number corresponding to the plug-in framework.
  • OTA is the abbreviation of Over-the-Air Technology update space download technology.
  • OTA upgrade is a standard software upgrade method provided by the Android system. The OTA upgrade can be done online directly in the electronic device, and only needs to use the mobile network or Wifi network, and the upgrade does not need to backup data. Generally, after the upgrade is completed, the electronic device can be automatically restarted to complete.
  • FIG. 3A it is a schematic diagram of a plug-in implementation scenario provided by an embodiment of this application.
  • different plug-ins are suitable for different electronic devices. Different electronic devices can obtain different plug-ins based on different requirements to achieve different functions.
  • the face recognition plug-in, the image super-segment plug-in, the intention recognition plug-in, the text translation plug-in, etc. can be applied to the A version of the mobile phone, for example.
  • Face recognition plug-in, image super-segment plug-in, intent recognition plug-in, speech recognition plug-in, etc. can be applied to the B version of mobile phones, for example.
  • Speech recognition plug-ins, text translation plug-ins, etc. are suitable for low-end mobile phone versions.
  • the vehicle voice wake-up plug-in and the vehicle voice recognition plug-in are suitable for vehicle equipment. The foregoing is only an example, and this solution does not specifically limit the acquisition of different plug-ins by different devices.
  • the aforementioned face recognition plug-in, image super-segmenting plug-in, intent recognition plug-in, text translation plug-in, speech recognition plug-in, vehicle voice wake-up plug-in, and vehicle voice recognition plug-in are all artificial intelligence (AI) plug-ins.
  • Each device can implement the on-demand deployment of the device's AI capabilities through the above-mentioned artificial intelligence AI plug-in.
  • FIG. 3B a schematic diagram of a plug-in implementation scenario provided by an embodiment of this application.
  • the electronic device can obtain different plug-ins from the server to implement the on-demand deployment of plug-ins.
  • the above-mentioned server may be called a plug-in server or other names.
  • the plug-in server may be a server that publishes various plug-ins.
  • the electronic device may also obtain various plug-in frameworks respectively associated with different plug-ins from the server.
  • the electronic device can obtain the plug-in framework from the application market.
  • the application market can publish various plug-in frameworks.
  • FIG. 4A a schematic flowchart of a method for installing a plug-in provided by an embodiment of this application, which includes steps S401-S405, which are specifically as follows:
  • the electronic device displays a first user interface
  • FIG. 4B to 4D are respectively schematic diagrams of a human-computer interaction interface provided by an embodiment of the present application.
  • the electronic device 100 displays a user interface 41.
  • the user interface 41 includes a status bar 400 and a first application interface.
  • the first application may be a camera.
  • the camera is an application installed locally on the electronic device.
  • the status bar 400 may include: one or more signal strength indicators 401 of mobile communication signals (also called cellular signals), one or more signal strength indicators 402 of Wi-Fi signals, and battery status indicators 403 , Time indicator 404.
  • the display elements of the first application interface include a flash button 405, a camera setting button 406, a view frame 407, a magnification button 408, a picture option 409, a camera button 410, and a switch camera 411.
  • the electronic device When the user clicks the flash button 405, the electronic device turns on/off the flash in response to the aforementioned user operation.
  • the electronic device When the user clicks the magnification key 408, the electronic device performs lens magnification in response to the aforementioned user operation.
  • the electronic device When the user clicks the camera button 410, the electronic device takes a photo in response to the above-mentioned user operation.
  • the electronic device switches the camera in response to the above-mentioned user operation.
  • the camera application includes a plug-in framework of the camera application and at least one plug-in.
  • the at least one plug-in includes a plug-in corresponding to the flash function, a plug-in corresponding to the camera setting function, a plug-in corresponding to the viewfinder function, a plug-in corresponding to the magnification function, and an image option function.
  • the plug-in corresponding to the flash function the plug-in corresponding to the camera setting function, the plug-in corresponding to the viewfinder function, the plug-in corresponding to the magnification function, the plug-in corresponding to the picture option function, the plug-in corresponding to the camera function, and the plug-in corresponding to the switch camera function.
  • the main version number of the plug-in framework of the camera application is the same.
  • the method may further include:
  • the electronic device may send a request to the server at a preset time interval to confirm whether an update plug-in corresponding to at least one plug-in included in the first application installed locally on the electronic device is released in the server.
  • each plug-in corresponds to a different identifier
  • the same plug-in corresponds to the same identifier.
  • flash plug-ins of different versions correspond to the same logo.
  • the above identification may be the plug-in name splitname, etc.
  • the electronic device separately detects the identification of the at least one plug-in and the identification of the update plug-in to obtain a sixth plug-in that is the same as the identification of the update plug-in;
  • the electronic device detects whether the version number of the update plug-in is higher than the version number of the sixth plug-in; wherein, The at least one plug-in includes a sixth plug-in;
  • step S401 is triggered to be executed.
  • the electronic device detects whether the identification of the update plug-in of the camera application published by the server is the same as the identification of each plug-in of the locally installed camera application. When there is the same, the electronic device detects whether the version number of the update plug-in issued by the server is higher than the version number of the corresponding plug-in installed locally that is the same as the identifier of the update plug-in.
  • the electronic device If the electronic device detects that the identifier of the update plug-in issued by the server is the same as the identifier of the flash plug-in installed locally, the electronic device confirms that the update plug-in is a flash plug-in. The electronic device detects whether the version number of the flash plug-in released by the server is higher than the version number of the flash plug-in installed locally.
  • the electronic device 100 displays the first user interface.
  • the first user interface may be the user interface 42.
  • the user interface 42 includes a status bar 400 and a first application (such as a camera application) interface.
  • the display elements of the first application interface include a flash button 405, a camera setting button 406, a view frame 407, a magnification button 408, a picture option 409, a camera button 410, and a switch camera 411.
  • the electronic device displays a schematic arrow next to the flash button 405 to prompt the user that the flash plug-in corresponding to the flash button 405 has an updated version.
  • the above-mentioned schematic arrows can also be replaced with red dots, etc., and the specific display form is not limited herein.
  • the electronic device receives a first user operation, where the first user operation is used to request installation of a first plug-in related to a first application, and the first application is an application that has been installed locally on the electronic device.
  • An application includes a first plug-in framework and at least one plug-in associated with the first plug-in framework, the main version number of each plug-in in the at least one plug-in is the same as the main version number of the first plug-in framework, and Each plug-in in at least one plug-in has a second version number corresponding to the plug-in, the first plug-in framework has a first version number, and both the first version number and the second version number include a main version number, a sub A version number and a stage version number, the first plug-in is different from the at least one plug-in;
  • Each plug-in framework has plug-ins associated with it.
  • Each plug-in has a version number corresponding to the plug-in.
  • Each plug-in framework has a version number corresponding to the plug-in framework.
  • the above-mentioned first user operation may be any preset operation, and the preset operation may be a long press operation or a slide operation, etc., for example, the user long presses the flash button 405, or the user slides from top to bottom along the above indicated arrow.
  • the embodiments of the present application do not specifically limit the foregoing user operations.
  • the electronic device receives the first plug-in from the server.
  • the electronic device downloads the first plug-in from the server, as shown in FIG. 3B, which will not be repeated here.
  • S404 The electronic device detects whether the main version number of the first plug-in and the main version number of the first plug-in framework are the same;
  • the electronic device obtains the first plug-in, and detects whether the main version number of the first plug-in is the same as the main version number of the first plug-in framework.
  • the major version number is the first number of the version number.
  • the version number is 900.801.100
  • the major version number is 900.
  • the version number is 9.0.2
  • the major version number is 9.
  • the main version number of the first plug-in is compared with the main version number of the first plug-in framework to confirm whether the two are the same.
  • the electronic device installs the first plug-in. That is, as long as the main version number of the plug-in is the same as the main version number of the corresponding plug-in framework, the electronic device allows the plug-in to be installed.
  • the electronic device when the user performs the above-mentioned preset operation on the flash key 405, the electronic device receives an updated version of the plug-in corresponding to the flash key 405 from the server in response to the above user operation. As shown in FIG. 3B, the electronic device may The updated version of the plug-in corresponding to the flash key 405 is downloaded from the plug-in server.
  • the electronic device detects whether the main version number of the plug-in is the same as the main version number of the plug-in frame of the camera. For example, the version number of the plug-in is 9.0.2, and the version number of the plug-in framework of the camera application is 9.0.1.
  • the electronic device obtains the main version number 9 of the plug-in and the main version number 9 of the plug-in framework of the camera application, and then confirms that the main version number of the plug-in is the same as the main version number of the plug-in framework of the camera application.
  • the electronic device installs the new version of the plug-in and replaces the old version of the plug-in.
  • the electronic device does not install the new version of the plug-in.
  • the electronic device When the electronic device detects that the installation of the above-mentioned plug-in is completed, the electronic device can switch from the user interface 42 to the user interface 41.
  • the plug-in when the electronic device installs the plug-in, the plug-in can be installed by ensuring that the main version number of the plug-in is the same as the main version number of the plug-in framework. Compared with the method in the prior art that only needs to be installed when the version number of the plug-in and the version number of the plug-in framework are exactly the same, the electronic device of this solution is more flexible when installing the plug-in and has higher compatibility.
  • this solution can satisfy users to download and install different plug-ins based on different needs, without having to install all plug-ins of the corresponding application, which improves the user experience.
  • FIG. 5A to FIG. 5B are respectively schematic diagrams of another human-computer interaction interface provided by an embodiment of the present application.
  • the electronic device sends a request to the server at a preset time interval to obtain whether an update plug-in corresponding to an application locally installed on the electronic device is released in the server.
  • the electronic device detects the plug-in that is the same as the identification of the update plug-in of the camera application published by the server among the identifiers of the plug-ins of the locally installed camera applications. Then, the electronic device detects whether the version number of the updated plug-in released by the server is higher than the version number of the corresponding plug-in installed locally. If the electronic device detects that the identifier of the update plug-in issued by the server is the same as the identifier of the flash plug-in installed locally, the electronic device confirms that the update plug-in is a flash plug-in.
  • the electronic device detects whether the version number of the flash plug-in released by the server is higher than the version number of the flash plug-in installed locally.
  • the electronic device 100 displays the first user interface.
  • the first user interface may be the user interface 51.
  • the user interface 51 includes a status bar 400 and an application main interface.
  • the main interface of the application contains reminder information 501 and reminder information 502.
  • the reminder information 501 is a plug-in update notification of the camera application.
  • the camera is an application installed locally on the electronic device.
  • the plug-in update notification is used to remind the user that the plug-in corresponding to the flash function has been updated.
  • the electronic device receives the new version of the plug-in corresponding to the flash button 405 from the server in response to the above-mentioned user operation.
  • the electronic device detects whether the main version number of the plug-in is the same as the main version number of the plug-in frame of the camera.
  • the electronic device installs the new version of the plug-in.
  • the electronic device When the electronic device detects that the installation of the updated plug-in is completed, the electronic device switches from the user interface 51 to the user interface 52.
  • the electronic device does not install the new version of the plug-in.
  • the plug-in when the electronic device installs the plug-in, the plug-in can be installed by ensuring that the main version number of the plug-in is the same as the main version number of the plug-in framework. Compared with the method in the prior art that only needs to be installed when the version number of the plug-in and the version number of the plug-in framework are exactly the same, the electronic device of this solution is more flexible when installing the plug-in and has higher compatibility.
  • this solution can satisfy users to download and install different plug-ins based on different needs, without having to install all plug-ins of the corresponding application, which improves the user experience.
  • FIGS. 4B to 4D and FIGS. 5A to 5B are all interaction diagrams of plug-ins already included in the locally installed application of the electronic device.
  • the identifier corresponding to the plug-in published by the server is different from the identifier of the plug-in included in the corresponding application installed locally, that is to say, the server publishes a brand-new plug-in, the above method can still be applied.
  • the method may include:
  • the electronic device obtains the application update information from the server at a preset time interval.
  • the electronic device when the server releases a brand-new plug-in, the electronic device obtains application update information from the server such as the application market at a preset time interval.
  • the electronic device prompts the user with the update information of the corresponding application through the pop-up or interface display of the application update information, so as to instruct the user to upgrade.
  • the electronic device When detecting that the user performs an application update operation, the electronic device updates the application in response to the aforementioned user operation.
  • the interface of the corresponding application may display the function icon corresponding to the brand new plug-in, and at the same time, a schematic arrow may be displayed beside the function icon to indicate to the user that the plug-in of the function is downloadable.
  • the electronic device displays the function icon corresponding to the plug-in in the application interface, and the function icon An arrow is displayed next to to indicate that the plug-in is downloadable.
  • the method may further include:
  • the electronic device may send a request to the server at a preset time interval to obtain whether an update plug-in of an application installed locally on the electronic device is released in the server.
  • the electronic device detects whether the identifier of the update plug-in is the same as the identifier of each plug-in of the locally installed application;
  • step S401 If there is no plug-in with the same identifier as the update plug-in, the electronic device triggers the execution of step S401.
  • the electronic device when there is no plug-in with the same identifier as the update plug-in, the electronic device confirms that the update plug-in is a brand new plug-in corresponding to the application.
  • the electronic device may display preset information on the preset interface of the corresponding application to indicate that there is a plug-in with a new function, and may instruct the user to download.
  • the electronic device sends a request to the server at a preset time interval to obtain whether an update plug-in corresponding to an application installed locally on the electronic device is released in the server.
  • the electronic device detects whether the identification of the update plug-in of the camera application published by the server is the same as the identification of each plug-in of the locally installed camera application. If the same does not exist, the electronic device confirms that the updated plug-in is a brand new plug-in corresponding to the camera application.
  • the electronic device displays the update information of the update plug-in in the corresponding application or prompts the user in the form of a pop-up window.
  • the electronic device detects whether the plug-in is included in the locally installed camera application. If the plug-in is not included in the locally installed application, the electronic device 100 displays the first user interface.
  • the above-mentioned first user interface may refer to the user interface shown in FIG. 4C or the user interface shown in FIG. 5A, which is not specifically limited here.
  • the electronic device can directly display the new function icon in the application interface of the camera application, and display it in the A schematic arrow etc. is displayed next to the new function icon, which can be referred to as shown in Figure 4C to prompt the user to download and install the new plug-in.
  • the electronic device may also display the updated information in the form of a pop-up window, as shown in FIG. 5A.
  • the electronic device receives the plug-in from the server by receiving the first user operation and in response to the first user operation, and detects whether the main version number of the plug-in and the main version number of the plug-in framework associated with it are the same; if so, The electronic device installs the plug-in.
  • FIG. 6 a schematic flowchart of a method for installing a plug-in provided by an embodiment of the present application. As shown in Figure 6, it includes steps S601-S606, which are specifically as follows:
  • the electronic device displays a first user interface
  • the above-mentioned first user interface may be a user interface as shown in FIG. 4C or a user interface as shown in FIG. 5A, which is not specifically limited here.
  • the electronic device receives a first user operation, where the first user operation is used to request installation of a first plug-in related to a first application, where the first application is an application that has been installed locally on the electronic device, and the first user operation is
  • An application includes a first plug-in framework and at least one plug-in associated with the first plug-in framework, the main version number of each plug-in in the at least one plug-in is the same as the main version number of the first plug-in framework, and Each plug-in in at least one plug-in has a second version number corresponding to the plug-in, the first plug-in framework has a first version number, and both the first version number and the second version number include a main version number, a sub A version number and a stage version number, the first plug-in is different from the at least one plug-in;
  • the electronic device receives the first plug-in from the server.
  • S604 The electronic device detects whether the main version number of the first plug-in and the main version number of the first plug-in framework are the same.
  • the electronic device detects the stage version number of the first plug-in and the stage version number of the first plug-in framework Whether it's different
  • the electronic device confirms whether the stage version number of the plug-in and the stage version number of the plug-in framework are different, when the stage version number of the plug-in and the stage version of the plug-in framework When the numbers are different, the electronic device installs the plug-in.
  • the sub-version number of the plug-in and the sub-version number of the plug-in framework can be the same or different, and there is no restriction here.
  • the plug-in when an electronic device installs a plug-in, the plug-in can be installed by ensuring that the main version number of the plug-in is the same as the main version number of the plug-in framework, and the phase version number of the plug-in and the phase version number of the plug-in framework are different. .
  • the electronic device of this solution is more flexible when installing the plug-in and has higher compatibility.
  • FIG. 7 it is a schematic flowchart of a method for creating a class loader according to an embodiment of this application.
  • dynamic libraries are also called shared libraries.
  • the dynamic library marks the called code in the executing program, and then loads the required functions when the program is running. That is to say, the execution program needs the support of the dynamic library when it is running, and it cannot be executed independently by itself. In this way, if a module modifies the code, there is no need to recompile the entire program, but to compile a part of it to generate a new dynamic library .so file.
  • the electronic device creates an initial class loader of the first plug-in
  • S702 The electronic device confirms whether the first plug-in is configured with an isolated Split attribute
  • the electronic device obtains the storage path of the dynamic library file of the first plug-in;
  • the electronic device adds the storage path of the dynamic library file to the initial class loader and obtains the class loader of the first plug-in.
  • the electronic device when the electronic device detects that the plug-in is configured with the isolated Split attribute, it obtains the storage path of the dynamic library file of the plug-in and adds the storage path of the dynamic library file to the class loader to support the plug-in to access its internal dynamics. Library file.
  • FIG. 8 a schematic diagram of a face recognition plug-in creation class loader provided by an embodiment of this application.
  • the electronic device After confirming that the face recognition plug-in is configured with the isolated Split attribute, the electronic device obtains the storage path of the dynamic library file of the face recognition plug-in, and adds the storage path of the dynamic library file to the class loader of the face recognition plug-in. It can support the face recognition plug-in to access its internal dynamic library files.
  • FIG. 9 it is a schematic flowchart of a method for system upgrade provided by an embodiment of this application.
  • the OTA upgrade process may select a lower version of the plug-in. For example, only the pre-installed version is selected during the system upgrade.
  • the plug-in and plug-in framework of the preset partition may be installed, and the version number of the plug-in of the preset partition may be lower than the version number of the plug-in of the installation partition, or the version number of the plug-in framework of the preset partition may be lower than the version of the plug-in framework of the installation partition number. Therefore, after the OTA upgrade, the version of the plug-in or plug-in framework will be downgraded.
  • this solution proposes a control method for system upgrade of electronic equipment.
  • the electronic device when it is detected that the electronic device is performing an OTA upgrade, the electronic device obtains the two directories of the preset partition and the installation partition corresponding to the application to be upgraded, and detects the version numbers of the plug-ins and the plug-in frameworks in the two directories. To get the highest version of each plug-in and the highest version of the plug-in framework. According to the highest version of each plug-in and the highest version of the plug-in framework, a new installation application is formed and installed. At the same time, the electronic device deletes or disables the old installed application, and then completes the OTA upgrade.
  • the first application is an application installed locally on the electronic device, the first application includes a first plug-in framework and at least one plug-in associated with the first plug-in framework, and the at least one The main version number of each plug-in in the plug-in is the same as the main version number of the first plug-in framework; the method includes steps 901 to 904, which are specifically as follows:
  • the electronic device obtains a first system installation package from a server, where the first system installation package includes an installation package of at least one application, and the at least one application includes The first application, the first application includes a first plug-in framework and at least one plug-in associated with the first plug-in framework, and the major version number of each plug-in in the at least one plug-in is the same as that of the first plug-in framework
  • the main version number is the same, each of the at least one plug-in has a second version number corresponding to the plug-in, the first plug-in framework has a first version number, the first version number and the second version number Each includes a major version number, a sub-version number, and a stage version number.
  • the installation package of the first application includes a third plug-in; at least one of the installed first applications included in the first application and stored on the electronic device
  • the plug-in includes a fourth plug-in and a fifth plug-in.
  • the third plug-in, the fourth plug-in and the fifth plug-in are plug-ins with different version numbers and the same identification, and the fourth plug-in is stored in the preset of the electronic device.
  • the fifth plug-in is stored in the installation partition of the electronic device, wherein each plug-in carries an identifier, and the identifiers of plug-ins corresponding to the same function icon are the same;
  • the electronic device detects whether the version number of the third plug-in is higher than all the identifiers of the third plug-in that are included in the installed first application and are stored on the electronic device.
  • the electronic device detects whether the main version number of the third plug-in and the main version number of the first plug-in framework are the same;
  • the electronic device installs the fourth plug-in, and disables other plug-ins other than the fourth plug-in. Plug-ins with the same ID of the third plug-in.
  • the installation package of the first application further includes a second plug-in framework
  • the first plug-in framework and the second plug-in framework are plug-in frameworks with different version numbers
  • the method further includes:
  • the electronic device detects whether the version number of the second plug-in framework is higher than the version number of the first plug-in framework
  • the electronic device installs the second plug-in framework and deletes/disables the first plug-in framework.
  • the electronic device installs the first plug-in framework and disables the second plug-in framework.
  • a partition corresponding to an application such as the plug-in framework of the installation partition and the version of each plug-in
  • the version of the partition is used directly, and the plug-in framework and the plug-in version corresponding to the preset partition are deleted or disabled. version.
  • installing the third plug-in on the electronic device includes installing the class loader of the third plug-in on the electronic device, and installing the class loader of the third plug-in on the electronic device includes:
  • the electronic device confirms whether the third plug-in is configured with the isolated Split attribute
  • the electronic device obtains the storage path of the dynamic library file of the third plug-in;
  • the electronic device adds the storage path of the dynamic library file to the initial class loader and obtains the class loader of the third plug-in.
  • the third plug-in is an artificial intelligence AI plug-in.
  • the artificial intelligence AI plug-in includes one or more of the following: face recognition plug-in, image super-segmentation plug-in, intent recognition plug-in, text translation plug-in, speech recognition plug-in, vehicle voice wake-up plug-in, and vehicle device Speech recognition plug-in.
  • This solution can be applied to artificial intelligence (AI) terminals, and can be applied to artificial intelligence plug-ins.
  • AI artificial intelligence
  • FIG. 10 it is a schematic diagram of an embodiment when an electronic device performs an OTA upgrade.
  • the electronic device separately obtains two directories of the installation partition and the preset partition of the corresponding application.
  • the installation partition and the preset partition both contain the plug-in framework and plug-ins corresponding to the above-mentioned applications.
  • the electronic device obtains the version number of the plug-in framework in the installation partition as 1.1.3, the version number of the plug-in framework in the preset partition is 1.1.8, and the electronic device confirms that the version number of the plug-in framework in the preset partition is higher than that in the installation partition
  • the electronic device will use the plug-in framework in the preset partition as the plug-in framework of the newly installed application.
  • the electronic device obtains that the version number of plug-in 1 in the installation partition is 1.1.3, the version number of plug-in 1 in the preset partition is 1.1.8, and the electronic device confirms that the version number of plug-in 1 in the preset partition is higher than that in the installation partition.
  • the version number of plug-in 1. The electronic device regards plug-in 1 in the preset partition as plug-in 1 of the newly installed application.
  • the electronic device obtains that the version number of plug-in 2 in the installation partition is 1.1.8, the version number of plug-in 2 in the preset partition is 1.1.5, and the electronic device confirms that the version number of plug-in 2 in the installation partition is higher than the preset partition
  • the version number of plug-in 2 in the middle the electronic device will use plug-in 2 in the installation partition as plug-in 2 of the newly installed application.
  • the electronic device confirms that the version numbers of plug-in 3 and plug-in 4 in the preset partition are respectively higher than the version numbers of plug-in 3 and plug-in 4 in the installation partition, and the electronic device regards plug-in 3 and plug-in 4 in the preset partition as newly installed applications Plugin 3 and Plugin 4.
  • the electronic device sequentially traverses different plug-ins and plug-in frameworks in each partition, and obtains the plug-in and plug-in framework of the highest version, thereby obtaining an installation package of the newly installed application, and then installs it to complete the OTA upgrade.
  • the OTA upgrade may include installation packages of multiple applications, and the method for obtaining the installation packages of each application is the same as the above, and will not be repeated here.
  • the version of each plug-in corresponding to the upgraded application of the electronic device after the OTA upgrade is completed is the highest version, and the version of the plug-in framework is the highest version, so as to solve the problem of version downgrade in the prior art after the OTA upgrade. Disadvantages.
  • An embodiment of the present application further provides a device, including: one or more processors, one or more memories; the one or more memories are coupled with the one or more processors, and the one or more memories Used to store computer program code, the computer program code including computer instructions, when the one or more processors execute the computer instructions, cause the apparatus to execute:
  • the device When the one or more processors execute the computer instructions, the device is caused to perform the following operations:
  • a first user operation is received, and the first user operation is used to request installation of a first plug-in related to a first application
  • the first application is an application installed locally on the device
  • the first application includes a first A plug-in framework and at least one plug-in associated with the first plug-in framework
  • the main version number of each plug-in in the at least one plug-in is the same as the main version number of the first plug-in framework
  • each plug-in in the at least one plug-in A plug-in has a second version number corresponding to the plug-in
  • the first plug-in framework has a first version number
  • both the first version number and the second version number include a major version number, a sub-version number, and a stage version No.
  • the first plug-in is different from the at least one plug-in;
  • the stage version number of the first plug-in is different from the stage version number of the first plug-in framework.
  • the device further executes: the at least one plug-in includes a second plug-in, and the first plug-in is an update plug-in corresponding to the second plug-in.
  • the device also executes: the first plug-in is a brand new plug-in of the first application.
  • the device also performs the following operations:
  • the storage path of the dynamic library file is added to the initial class loader to obtain the class loader of the first plug-in.
  • the device also performs the following operation: when an instruction for upgrading the system is detected, a first system installation package is obtained from the server, the first system installation package includes an installation package of at least one application, and the at least one The application includes the first application, and the installation package of the first application includes a third plug-in; the at least one plug-in stored on the device included in the installed first application includes a fourth plug-in and a third plug-in.
  • the third plug-in, the fourth plug-in, and the fifth plug-in are plug-ins with different version numbers and the same identification
  • the fourth plug-in is stored in the preset partition of the device
  • the fifth plug-in is Stored in the installation partition of the device, where each plug-in carries an identifier, and plug-ins corresponding to the same function icon have the same identifier;
  • the installation package of the first application further includes a second plug-in framework
  • the first plug-in framework and the second plug-in framework are plug-in frameworks with different version numbers
  • the device further performs the following operations:
  • the first plug-in is an artificial intelligence AI plug-in.
  • the artificial intelligence AI plug-in includes one or more of the following: a face recognition plug-in, an image super-division plug-in, an intent recognition plug-in, a text translation plug-in, a speech recognition plug-in, a vehicle voice wake-up plug-in, and a vehicle voice recognition plug-in.
  • the device is a terminal device or a part of a terminal device.
  • An embodiment of the present application further provides a device, including: one or more processors, one or more memories; the one or more memories are coupled with the one or more processors, and the one or more memories For storing computer program code, the computer program code including computer instructions;
  • the device When the one or more processors execute the computer instructions, the device is caused to perform the following operations:
  • a first system installation package is obtained from the server, the first system installation package includes an installation package of at least one application, the at least one application includes a first application, and the first system installation package includes an installation package of at least one application.
  • the application includes a first plug-in framework and at least one plug-in associated with the first plug-in framework, the main version number of each plug-in in the at least one plug-in is the same as the main version number of the first plug-in framework, and the at least Each plug-in in a plug-in has a second version number corresponding to the plug-in, the first plug-in framework has a first version number, and both the first version number and the second version number include a major version number and a sub-version Number and stage version number, the installation package of the first application includes a third plug-in; the at least one plug-in stored on the device included in the installed first application includes a fourth plug-in and a fifth plug-in The third plug-in, the fourth plug-in, and the fifth plug-in are plug-ins with different version numbers and the same identification, the fourth plug-in is stored in a preset partition of the device, and the fifth plug-in is stored in In the installation partition of the device, each plug-in carries an identifier, and plug
  • the installation package of the first application further includes a second plug-in framework, and the first plug-in framework and the second plug-in framework are plug-in frameworks with different version numbers, and the apparatus further performs the following operations:
  • the third plug-in is an artificial intelligence AI plug-in.
  • the device also performs the following operations:
  • the storage path of the dynamic library file is added to the initial class loader to obtain the class loader of the third plug-in.
  • the device is a terminal device or a part of a terminal device.
  • the embodiment of the present application also provides a computer-readable storage medium that stores instructions in the computer-readable storage medium, and when it runs on a computer or a processor, the computer or the processor executes any one of the above methods. Or multiple steps.
  • the embodiments of the present application also provide a computer program product containing instructions.
  • the computer program product runs on a computer or a processor, the computer or the processor is caused to execute one or more steps in any of the above methods.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium.
  • the computer instructions can be sent from a website site, computer, server, or data center to another website site, computer, or data center via wired (e.g.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
  • the process can be completed by a computer program instructing relevant hardware.
  • the program can be stored in a computer readable storage medium. , May include the processes of the foregoing method embodiments.
  • the aforementioned storage media include: ROM or random storage RAM, magnetic disks or optical disks and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

一种安装插件的方法、装置和存储介质,包括:接收第一用户操作,所述第一用户操作用于请求安装与第一应用相关的第一插件,所述第一应用包含第一插件框架和与所述第一插件框架相关联的至少一个插件,所述至少一个插件中每个插件的主版本号与所述第一插件框架的主版本号相同,所述第一插件不同于所述至少一个插件;电子设备从服务器接收所述第一插件;电子设备检测所述第一插件的主版本号和所述第一插件框架的主版本号是否相同;若是,安装所述第一插件。该方法可应用于人工智能插件。

Description

安装插件的方法、装置和存储介质
本申请要求于2019年10月15日提交中国专利局、申请号为201910980401.0、发明名称为“安装插件的方法、装置和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及电子技术领域,尤其涉及一种安装插件的方法、装置和存储介质。
背景技术
插件化概念:当一个软件项目开发结束并交互使用后,需要添加一些新的功能,通常希望在不修改原有的应用程序情况下,将新添加的功能植入到系统中,这就是所谓的插件化,新增加的功能模块就叫插件。插件化能大大的降低模块间的耦合性,有利于各模块的独立维护,加快项目的维护更新。
安卓应用束(Android App Bundle)是一种改进的应用程序打包方式,能大幅度减少应用体积,是安卓系统上Google官方的动态发布方案。该方案可支持将应用拆分成多个插件,并且插件可以从谷歌应用市场下载安装。
然而,谷歌应用市场上发布的对应同一应用的所有插件是绑定开发,且绑定发布的。即开发人员在对某一个应用的某一个插件进行开发升级时,往往需要对该应用的所有插件进行绑定升级,且所有插件的版本号和该应用的插件框架的版本号均需要完全一致,并且需要将所有插件一起绑定发布。
对于从谷歌应用市场下载并安装插件的用户来说,在需要下载安装某个应用的某个插件时候,需要将该应用发布的所有插件一起下载安装,且在安装时需确保各插件的版本号和插件框架的版本号完全一致,才允许安装该插件。
发明内容
本申请公开了一种安装插件的方法、装置和存储介质,可以满足用户对于不同插件能力单独下载安装的需求,提高了用户体验。
第一方面,本申请实施例提供一种安装插件的方法,所述方法包括:
电子设备接收第一用户操作,所述第一用户操作用于请求安装与第一应用相关的第一插件,所述第一应用是所述电子设备本地已安装的一个应用,所述第一应用包含第一插件框架和与所述第一插件框架相关联的至少一个插件,所述至少一个插件中每个插件的主版本号与所述第一插件框架的主版本号相同,所述至少一个插件中每个插件具有与该插件对应的第二版本号,所述第一插件框架具有第一版本号,所述第一版本号和所述第二版本号均包含主版本号、子版本号和阶段版本号,所述第一插件不同于所述至少一个插件;
响应于所述第一用户操作,所述电子设备从服务器接收所述第一插件;
所述电子设备检测所述第一插件的主版本号和所述第一插件框架的主版本号是否相同;
若是,所述电子设备安装所述第一插件。
其中,电子设备在安装插件时,通过确保插件的主版本号和插件框架的主版本号相同 即可以安装该插件。相较于现有技术中需要在插件的版本号和插件框架的版本号完全相同的情况下才能安装的手段,本方案的电子设备在安装插件时更加灵活,兼容性更高。另一方面,本方案可满足用户基于不同的需求下载安装不同的插件,无需将对应应用的所有插件均进行安装,提高了用户体验。
可选的,所述第一插件的阶段版本号和所述第一插件框架的阶段版本号不同。
其中,电子设备在安装插件时,通过在确保插件的主版本号和插件框架的主版本号相同,且插件的阶段版本号和插件框架的阶段版本号不同时即可以安装该插件。相较于现有技术中需要在插件的版本号和插件框架的版本号完全相同的情况下才能安装的手段,本方案的电子设备在安装插件时更加灵活,兼容性更高。
可选的,所述至少一个插件包括第二插件,所述第一插件为所述第二插件对应的更新插件。所述第一插件的版本号高于所述第二插件的版本号。
其中,本方案中安装的插件可以是本地安装应用所包含插件对应的更新插件。
进一步地,在电子设备接收第一用户操作之前,所述方法包括:
电子设备在预设时间间隔向服务器发送请求,以确认服务器中是否发布有与所述电子设备本地安装的第一应用所包含的至少一个插件对应的更新插件;
若所述服务器发布有与所述电子设备本地安装的第一应用所包含的第六插件对应的更新插件时,所述电子设备检测所述更新插件的版本号是否高于所述第六插件的版本号,其中,所述至少一个插件包含第六插件;
若所述更新插件的版本号高于所述第六插件的版本号,则所述电子设备显示第一用户界面,所述第一用户界面用于指示用户触发第一用户操作。
可选的,所述第一插件为所述第一应用的全新的插件。
其中,本方案中安装的插件也可以是本地安装应用所不包含的插件,即应用的全新的插件。
可选的,所述电子设备安装所述第一插件包括所述电子设备安装所述第一插件的类加载器,所述电子设备安装所述第一插件的类加载器,包括:
所述电子设备创建所述第一插件的初始类加载器;
所述电子设备确认所述第一插件是否配置有isolated Split属性;
若配置有,则所述电子设备获取所述第一插件的动态库文件的存储路径;
所述电子设备将所述动态库文件的存储路径添加至所述初始类加载器中并得到所述第一插件的类加载器。
其中,电子设备在检测到插件配置有isolated Split属性时,通过获取插件的动态库文件的存储路径,并将该动态库文件的存储路径添加到类加载器中,以支持插件访问自身内部的动态库文件。
可选的,所述方法还包括:
当所述电子设备检测到用于指示升级系统的指令时,所述电子设备从所述服务器获取第一系统安装包,所述第一系统安装包包含至少一个应用的安装包,所述至少一个应用包含所述第一应用,所述第一应用的安装包包含第三插件;所述已安装的所述第一应用所包 括的存储在所述电子设备上的至少一个插件包括第四插件和第五插件,所述第三插件、所述第四插件和第五插件是版本号不同、标识相同的插件,所述第四插件被存储在所述电子设备的预置分区,所述第五插件被存储在所述电子设备的安装分区,其中,每个插件均携带有标识,对应相同功能图标的插件的标识相同;
所述电子设备检测所述第三插件的版本号是否高于所述已安装的所述第一应用所包括的存储在所述电子设备上的与所述第三插件的标识相同的所有插件的版本号;
若是,所述电子设备检测所述第三插件的主版本号和所述第一插件框架的主版本号是否相同;
若相同,所述电子设备安装所述第三插件。
通过本申请实施例,可实现电子设备在完成Over-the-Air Technology update空间下载技术(简称OTA升级)后对应升级应用的各插件的版本均为最高版本,以解决现有技术中在OTA升级后部分插件的版本被降级的缺点。
可选的,所述第一应用的安装包还包含第二插件框架,所述第一插件框架和所述第二插件框架是版本号不同的插件框架,所述方法还包括:
所述电子设备检测所述第二插件框架的版本号是否高于所述第一插件框架的版本号;
若是,所述电子设备安装所述第二插件框架。
通过本申请实施例,可实现电子设备在完成OTA升级后对应升级应用的插件框架的版本为最高版本,以解决现有技术中在OTA升级后版本降级的缺点。
可选的,所述第一插件为人工智能AI插件。
可选的,所述人工智能AI插件包括如下中的一种或多种:人脸识别插件、图像超分插件、意图识别插件、文本翻译插件、语音识别插件、车机语音唤醒插件和车机语音识别插件。
本方案可适用于人工智能(Artificial Intelligence,AI)终端,可以适用于人工智能插件。
第二方面,本申请实施例提供一种安装插件的方法,所述方法包括:
当电子设备检测到用于指示升级系统的指令时,所述电子设备从服务器获取第一系统安装包,所述第一系统安装包包含至少一个应用的安装包,所述至少一个应用包含第一应用,所述第一应用包含第一插件框架和与所述第一插件框架相关联的至少一个插件,所述至少一个插件中每个插件的主版本号与所述第一插件框架的主版本号相同,所述至少一个插件中每个插件具有与该插件对应的第二版本号,所述第一插件框架具有第一版本号,所述第一版本号和所述第二版本号均包含主版本号、子版本号和阶段版本号,所述第一应用的安装包包含第三插件;所述已安装的所述第一应用所包括的存储在所述电子设备上的至少一个插件包括第四插件和第五插件,所述第三插件、所述第四插件和第五插件是版本号不同、标识相同的插件,所述第四插件被存储在所述电子设备的预置分区,所述第五插件被存储在所述电子设备的安装分区,其中,每个插件均携带有标识,对应相同功能图标的插件的标识相同;
所述电子设备检测所述第三插件的版本号是否高于所述已安装的所述第一应用所包括的存储在所述电子设备上的与所述第三插件的标识相同的所有插件的版本号;
若是,所述电子设备检测所述第三插件的主版本号和所述第一插件框架的主版本号是否相同;
若相同,所述电子设备安装所述第三插件。
通过本申请实施例,可实现电子设备在完成Over-the-Air Technology update空间下载技术(简称OTA升级)后对应升级应用的各插件的版本均为最高版本,以解决现有技术中在OTA升级后部分插件的版本被降级的缺点。
可选的,所述第一应用的安装包还包含第二插件框架,所述第一插件框架和所述第二插件框架是版本号不同的插件框架,所述方法还包括:
所述电子设备检测所述第二插件框架的版本号是否高于所述第一插件框架的版本号;
若是,所述电子设备安装所述第二插件框架。
通过本申请实施例,可实现电子设备在完成OTA升级后对应升级应用的插件框架的版本为最高版本,以解决现有技术中在OTA升级后版本降级的缺点。
可选的,所述第三插件为人工智能AI插件。
可选的,所述人工智能AI插件包括如下中的一种或多种:人脸识别插件、图像超分插件、意图识别插件、文本翻译插件、语音识别插件、车机语音唤醒插件和车机语音识别插件。
本方案可适用于人工智能(Artificial Intelligence,AI)终端,可以适用于人工智能插件。
可选的,所述电子设备安装所述第三插件包括所述电子设备安装所述第三插件的类加载器,所述电子设备安装所述第三插件的类加载器,包括:
所述电子设备创建所述第三插件的初始类加载器;
所述电子设备确认所述第三插件是否配置有isolated Split属性;
若配置有,则所述电子设备获取所述第三插件的动态库文件的存储路径;
所述电子设备将所述动态库文件的存储路径添加至所述初始类加载器中并得到所述第三插件的类加载器。
第三方面,本申请实施例提供一种装置,包括:一个或多个处理器、一个或多个存储器;所述一个或多个存储器与所述一个或多个处理器耦合,所述一个或多个存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,当所述一个或多个处理器执行所述计算机指令时,使得所述装置执行:
当所述一个或多个处理器执行所述计算机指令时,使得所述装置执行以下操作:
接收第一用户操作,所述第一用户操作用于请求安装与第一应用相关的第一插件,所述第一应用是所述装置本地已安装的一个应用,所述第一应用包含第一插件框架和与所述第一插件框架相关联的至少一个插件,所述至少一个插件中每个插件的主版本号与所述第一插件框架的主版本号相同,所述至少一个插件中每个插件具有与该插件对应的第二版本号,所述第一插件框架具有第一版本号,所述第一版本号和所述第二版本号均包含主版本号、子版本号和阶段版本号,所述第一插件不同于所述至少一个插件;
响应于所述第一用户操作,从服务器接收所述第一插件;
检测所述第一插件的主版本号和所述第一插件框架的主版本号是否相同;
若是,安装所述第一插件。
可选的,所述第一插件的阶段版本号和所述第一插件框架的阶段版本号不同。
所述装置还执行:所述至少一个插件包括第二插件,所述第一插件为所述第二插件对应的更新插件。
所述装置还执行:所述第一插件为所述第一应用的全新的插件。
所述装置还执行以下操作:
创建所述第一插件的初始类加载器;
确认所述第一插件是否配置有isolated Split属性;
若配置有,则获取所述第一插件的动态库文件的存储路径;
将所述动态库文件的存储路径添加至所述初始类加载器中并得到所述第一插件的类加载器。
所述装置还执行以下操作:当检测到用于指示升级系统的指令时,从所述服务器获取第一系统安装包,所述第一系统安装包包含至少一个应用的安装包,所述至少一个应用包含所述第一应用,所述第一应用的安装包包含第三插件;所述已安装的所述第一应用所包括的存储在所述装置上的至少一个插件包括第四插件和第五插件,所述第三插件、所述第四插件和第五插件是版本号不同、标识相同的插件,所述第四插件被存储在所述装置的预置分区,所述第五插件被存储在所述装置的安装分区,其中,每个插件均携带有标识,对应相同功能图标的插件的标识相同;
检测所述第三插件的版本号是否高于所述已安装的所述第一应用所包括的存储在所述装置上的与所述第三插件的标识相同的所有插件的版本号;
若是,检测所述第三插件的主版本号和所述第一插件框架的主版本号是否相同;
若相同,安装所述第三插件。
其中,所述第一应用的安装包还包含第二插件框架,所述第一插件框架和所述第二插件框架是版本号不同的插件框架,所述装置还执行以下操作:
检测所述第二插件框架的版本号是否高于所述第一插件框架的版本号;
若是,安装所述第二插件框架。
其中,所述第一插件为人工智能AI插件。
所述人工智能AI插件包括如下中的一种或多种:人脸识别插件、图像超分插件、意图识别插件、文本翻译插件、语音识别插件、车机语音唤醒插件和车机语音识别插件。
所述装置为终端设备或终端设备的一部分。
第四方面,本申请实施例还提供一种装置,包括:一个或多个处理器、一个或多个存储器;所述一个或多个存储器与所述一个或多个处理器耦合,所述一个或多个存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令;
当所述一个或多个处理器执行所述计算机指令时,使得所述装置执行以下操作:
当检测到用于指示升级系统的指令时,从服务器获取第一系统安装包,所述第一系统安装包包含至少一个应用的安装包,所述至少一个应用包含第一应用,所述第一应用包含第一插件框架和与所述第一插件框架相关联的至少一个插件,所述至少一个插件中每个插 件的主版本号与所述第一插件框架的主版本号相同,所述至少一个插件中每个插件具有与该插件对应的第二版本号,所述第一插件框架具有第一版本号,所述第一版本号和所述第二版本号均包含主版本号、子版本号和阶段版本号,所述第一应用的安装包包含第三插件;所述已安装的所述第一应用所包括的存储在所述装置上的至少一个插件包括第四插件和第五插件,所述第三插件、所述第四插件和第五插件是版本号不同、标识相同的插件,所述第四插件被存储在所述装置的预置分区,所述第五插件被存储在所述装置的安装分区,其中,每个插件均携带有标识,对应相同功能图标的插件的标识相同;
检测所述第三插件的版本号是否高于所述已安装的所述第一应用所包括的存储在所述装置上的与所述第三插件的标识相同的所有插件的版本号;
若是,检测所述第三插件的主版本号和所述第一插件框架的主版本号是否相同;
若相同,安装所述第三插件。
可选的,所述第一应用的安装包还包含第二插件框架,所述第一插件框架和所述第二插件框架是版本号不同的插件框架,所述装置还执行以下操作:
检测所述第二插件框架的版本号是否高于所述第一插件框架的版本号;
若是,安装所述第二插件框架。
可选的,所述第三插件为人工智能AI插件。
所述装置还执行以下操作:
创建所述第三插件的初始类加载器;
确认所述第三插件是否配置有isolated Split属性;
若配置有,则获取所述第三插件的动态库文件的存储路径;
将所述动态库文件的存储路径添加至所述初始类加载器中并得到所述第三插件的类加载器。
所述装置为终端设备或终端设备的一部分。
第五方面,本申请提供了一种计算机存储介质,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如第一方面任一种可能的实施方式和/或第二方面任一种可能的实施方式提供的方法。
第六方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如第一方面任一种可能的实施方式和/或第二方面任一种可能的实施方式提供的方法。
可以理解地,上述提供的第三方面所述的装置、第四方面所述的装置、第五方面所述的计算机存储介质或者第六方面所述的计算机程序产品均用于执行第一方面中任一所提供的方法以及第二方面中任一所提供的方法。因此,其所能达到的有益效果可参考对应方法中的有益效果,此处不再赘述。
附图说明
为了更清楚地说明本申请实施例或背景技术中的技术方案,下面将对本申请实施例或背景技术中所涉及到的附图作简单地介绍。
图1是本申请实施例提供的电子设备100的结构示意图;
图2是本申请实施例的电子设备100的软件结构框图;
图3A是本申请实施例提供的一种插件化实施场景示意图;
图3B是本申请实施例提供的另一种插件化实施场景示意图;
图4A是本申请实施例提供的一种安装插件的方法的流程示意图;
图4B~图4D分别是本申请实施例提供的一种人机交互界面示意图;
图5A~图5B分别是本申请实施例提供的另一种人机交互界面示意图;
图6是本申请实施例提供的另一种安装插件的方法的流程示意图;
图7是本申请实施例提供的一种创建类加载器的流程示意图;
图8是本申请实施例提供的一种创建类加载器的示意图;
图9是本申请实施例提供的一种系统升级的方法的流程示意图;
图10是本申请实施例提供的电子设备进行OTA升级时的示意图。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。
首先介绍本申请实施例涉及的电子设备。请参阅图1,图1是本申请实施例提供的电子设备100的结构示意图。
电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器, 数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备 100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(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,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器 110中。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。 当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。
图2是本申请实施例的电子设备100的软件结构框图。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。
如图2所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图2所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
下面结合捕获拍照场景,示例性说明电子设备100软件以及硬件的工作流程。
当触摸传感器180K接收到触摸操作,相应的硬件中断被发给内核层。内核层将触摸操作加工成原始输入事件(包括触摸坐标,触摸操作的时间戳等信息)。原始输入事件被存储在内核层。应用程序框架层从内核层获取原始输入事件,识别该输入事件所对应的控件。以该触摸操作是触摸单击操作,该单击操作所对应的控件为相机应用图标的控件为例,相机应用调用应用框架层的接口,启动相机应用,进而通过调用内核层启动摄像头驱动,通过摄像头193捕获静态图像或视频。
首先,对本申请实施例涉及的安装插件的方法进行介绍。
本申请实施例提供一种安装插件的方法。其中,电子设备通过从服务器中接收该待安装插件,检测该待安装插件的主版本号与该待安装插件相关联的插件框架的主版本号是否相同,当上述插件和插件框架的主版本号相同时,电子设备安装该插件。
上述安装插件的方法中,在插件的主版本号与该插件相关联的插件框架的主版本号相同时,电子设备安装该插件。也就是说,本方案中只需插件和插件框架的主版本号相同即可允许安装插件。
和现有技术中用户请求安装插件时电子设备需要将该插件对应的应用的所有插件均安装一遍的手段相比,本方案满足用户对于不同插件单独下载安装的需求,提高了用户体验。同时,对于开发人员来说,可以对不同应用的各插件进行单独开发,单独发布,节约了大量人力资源。
下面介绍本申请实施例涉及到的概念。
(1)插件
当一个软件项目开发结束并交互使用后,需要添加一些新的功能,通常希望在不修改原有的应用程序情况下,将新添加的功能植入到系统中,这就是所谓的插件化,新增加的功能模块叫插件。插件化能大大的降低模块间的耦合性,有利于各模块的独立维护,加快项目的维护更新。
(2)插件框架
插件框架是插件化应用内的基础功能模块,负责插件的下载安装、加载、卸载等管理功能。
(3)版本号
版本号一般可包含主版本号、子版本号和阶段版本号。
其中,主版本号对应版本号的第一段,主版本号由项目决定。当项目的功能模块有较大的变动,比如增加多个模块或者整体架构发生变化时,会相应改变主版本号。
子版本号对应版本号的第二段,当功能有一定的增加或变化时,比如增加了对权限控制或者增加自定义视图等功能时,子版本号会进行修改。
阶段版本号对应版本号的第三段,一般是bug修复或是一些小的变动,修复一个严重的bug即可发布一个修订版。
其中,每个插件分别具有与该插件对应的版本号。每个插件框架分别具有与该插件框架对应的版本号。
(4)OTA升级
OTA为Over-the-Air Technology update空间下载技术的缩写。OTA升级是Android系统提供的标准软件升级方式。OTA升级可以直接在电子设备中在线完成,只需要借助移动网络或者Wifi网络即可,并且升级无需备份数据,一般升级完成后,自动重启电子设备即可完成。
如图3A所示,为本申请实施例提供的一种插件化实施场景的示意图。参照图3A所示, 在插件化的架构下,不同的插件适用于不同的电子设备。不同的电子设备可基于不同的需求获取不同的插件以实现不同的功能。
其中,人脸识别插件、图像超分插件、意图识别插件、文本翻译插件等可适用于如手机的A版本。人脸识别插件、图像超分插件、意图识别插件、语音识别插件等可适用于如手机的B版本。语音识别插件、文本翻译插件等适用于如低端手机版本。车机语音唤醒插件和车机语音识别插件等适用于车机设备。上述仅作为一种示例,本方案对于不同设备获取不同的插件不做具体限定。
其中,上述人脸识别插件、图像超分插件、意图识别插件、文本翻译插件、语音识别插件、车机语音唤醒插件和车机语音识别插件等均为人工智能(Artificial Intelligence,AI)插件。各设备可通过上述人工智能AI插件实现设备的AI能力按需部署。
如图3B所示,为本申请实施例提供的一种插件化实施场景示意图。其中,电子设备可从服务器获取不同的插件,以实现按需部署插件。参照图3B所示,上述服务器可以称之为插件服务器或其他名称。其中,插件服务器可以是发布有各种插件的服务器。
电子设备也可从服务器获取与不同插件分别关联的各插件框架。
可选的,电子设备可从应用市场获取插件框架。其中,应用市场可发布有各种插件框架。
上述实施例仅作为一种实现方式,本方案对此不做具体限制。
下面介绍本申请实施例提供的安装插件的方法。如图4A所示,为本申请实施例提供的一种安装插件的方法的流程示意图,其包括步骤S401-S405,具体如下:
S401、电子设备显示第一用户界面;
其中,图4B~图4D分别是本申请实施例提供的一种人机交互界面示意图。如图4B所示,电子设备100显示用户界面41。该用户界面41包括状态栏400和第一应用界面。该第一应用可以是相机。其中,相机为电子设备本地已安装的应用。
其中,状态栏400可包括:移动通信信号(又可称为蜂窝信号)的一个或多个信号强度指示符401、Wi-Fi信号的一个或多个信号强度指示符402,电池状态指示符403、时间指示符404。
其中,第一应用界面的显示元素包含闪光灯键405、相机设置键406、取景框407、放大倍数键408、图片选项409、拍照键410和切换摄像头411。
当用户点击闪光灯键405时,电子设备响应于上述用户操作开启/关闭闪光灯。当用户点击放大倍数键408时,电子设备响应于上述用户操作进行镜头倍数的放大。当用户点击拍照键410时,电子设备响应于上述用户操作进行拍照。当用户点击切换摄像头411时,电子设备响应于上述用户操作切换摄像头。
其中,相机应用包含相机应用的插件框架和至少一个插件,该至少一个插件包括闪光灯功能对应的插件、相机设置功能对应的插件、取景框功能对应的插件、放大倍数功能对应的插件、图片选项功能对应的插件、拍照功能对应的插件以及切换摄像头功能对应的插件等。其中,上述闪光灯功能对应的插件、相机设置功能对应的插件、取景框功能对应的 插件、放大倍数功能对应的插件、图片选项功能对应的插件、拍照功能对应的插件以及切换摄像头功能对应的插件与所述相机应用的插件框架主版本号相同。
其中,在步骤S401之前,所述方法还可包括:
电子设备可在预设时间间隔向服务器发送请求,以确认服务器中是否发布有与所述电子设备本地安装的第一应用所包含的至少一个插件对应的更新插件。
其中,每个插件分别对应不同的标识,对于相同插件对应相同的标识。如不同版本的闪光灯插件则对应相同的标识。上述标识可以是插件名称splitname等。
电子设备通过分别检测所述至少一个插件的标识与所述更新插件的标识以得到与所述更新插件的标识相同的第六插件;
若检测到所述更新插件的标识与所述至少一个插件中的第六插件的标识相同,所述电子设备检测所述更新插件的版本号是否高于所述第六插件的版本号;其中,所述至少一个插件包含第六插件;
若所述更新插件的版本号高于所述第六插件的版本号,则触发执行步骤S401。
具体地,当发布了相机应用存在更新插件时,电子设备检测服务器发布的相机应用的更新插件的标识与本地安装的相机应用的各插件的标识是否存在相同。当存在相同时,则电子设备检测服务器发布的更新插件的版本号是否高于本地安装的与所述更新插件的标识相同的对应插件的版本号。
如电子设备检测到服务器发布的更新插件的标识与本地安装的闪光灯插件的标识相同,则电子设备确认该更新插件为闪光灯插件。电子设备检测服务器发布的该闪光灯插件的版本号是否高于本地安装的闪光灯插件的版本号。
当服务器发布的更新插件的版本号高于本地安装的插件的版本号时,电子设备100显示第一用户界面。如图4C所示,该第一用户界面可以是用户界面42。该用户界面42包括状态栏400和第一应用(如相机应用)界面。其中,第一应用界面的显示元素包含闪光灯键405、相机设置键406、取景框407、放大倍数键408、图片选项409、拍照键410和切换摄像头411。
如图4C所示,与用户界面41不同的是,电子设备在闪光灯键405的旁边显示有一个示意箭头,以提示用户闪光灯键405对应的闪光灯插件有更新版本。上述示意箭头也可以替换为红色的圆点等,此处并不限定具体的显示形式。
S402、电子设备接收第一用户操作,所述第一用户操作用于请求安装与第一应用相关的第一插件,所述第一应用是所述电子设备本地已安装的一个应用,所述第一应用包含第一插件框架和与所述第一插件框架相关联的至少一个插件,所述至少一个插件中每个插件的主版本号与所述第一插件框架的主版本号相同,所述至少一个插件中每个插件具有与该插件对应的第二版本号,所述第一插件框架具有第一版本号,所述第一版本号和所述第二版本号均包含主版本号、子版本号和阶段版本号,所述第一插件不同于所述至少一个插件;
其中,不同应用对应不同的插件框架和不同的插件。各插件框架分别具有与其相关联的插件。
每个插件分别具有与该插件对应的版本号。每个插件框架分别具有与该插件框架对应 的版本号。
上述第一用户操作可以是任意预设操作,该预设操作可以是长按操作或者下滑操作等,如用户长按闪光灯键405,或者用户沿着上述示意箭头从上往下滑动等。本申请实施例对上述用户操作不做具体限定。
S403、响应于所述第一用户操作,所述电子设备从服务器接收所述第一插件;
其中,电子设备从服务器下载所述第一插件,可参阅图3B所示,此处不再赘述。
S404、所述电子设备检测所述第一插件的主版本号和所述第一插件框架的主版本号是否相同;
电子设备获取第一插件,并检测第一插件的主版本号和所述第一插件框架的主版本号是否相同。
其中,主版本号为版本号的第一段数字,如版本号为900.801.100,则主版本号为900。当版本号为9.0.2时,则主版本号为9。通过比较第一插件的主版本号和所述第一插件框架的主版本号,以确认两者是否相同。
S405、若是,所述电子设备安装所述第一插件。
当第一插件的主版本号和所述第一插件框架的主版本号相同时,电子设备安装所述第一插件。也就是说,只要插件的主版本号和相应插件框架的主版本号相同,则电子设备允许安装该插件。
如图4D所示,当用户对闪光灯键405进行上述预设操作时,电子设备响应于上述用户操作从服务器接收该闪光灯键405对应的插件的更新版本,可如图3B所示,电子设备可从插件服务器下载该闪光灯键405对应的插件的更新版本。
电子设备检测该插件的主版本号和相机的插件框架的主版本号是否相同。如该插件的版本号为9.0.2,相机应用的插件框架的版本号为9.0.1。电子设备获取该插件的主版本号9,以及相机应用的插件框架的主版本号9,则确认插件的主版本号和相机应用的插件框架的主版本号相同。电子设备则安装该新版本的插件,并替换掉该插件的旧版本。
当插件的主版本号和相机应用的插件框架的主版本号不相同时,电子设备则不安装该新版本的插件。
当电子设备检测到完成上述插件的安装后,电子设备可以从用户界面42切换为用户界面41。
通过本申请实施例,电子设备在安装插件时,通过确保插件的主版本号和插件框架的主版本号相同即可以安装该插件。相较于现有技术中需要在插件的版本号和插件框架的版本号完全相同的情况下才能安装的手段,本方案的电子设备在安装插件时更加灵活,兼容性更高。
另一方面,本方案可满足用户基于不同的需求下载安装不同的插件,无需将对应应用的所有插件均进行安装,提高了用户体验。
作为另一种可选的实现方式,如图5A~图5B所示。其中,图5A~图5B分别是本申请实施例提供的另一种人机交互界面示意图。
其中,与上述图4B所述方法相似的,电子设备在预设时间间隔向服务器发送请求,以获取服务器中是否发布有所述电子设备本地安装的应用对应的更新插件。
具体地,当服务器发布了相机应用的更新插件时,电子设备检测本地安装的相机应用的各插件的标识中与服务器发布的相机应用的更新插件的标识相同的插件。然后,电子设备检测服务器发布的更新插件的版本号是否高于本地安装的该对应插件的版本号。如电子设备检测到服务器发布的更新插件的标识与本地安装的闪光灯插件的标识相同,则电子设备确认该更新插件为闪光灯插件。电子设备检测服务器发布的该闪光灯插件的版本号是否高于本地安装的闪光灯插件的版本号。当服务器发布的闪光灯插件的版本号高于本地安装的闪光灯插件的版本号时,电子设备100显示第一用户界面。
如图5A所示,该第一用户界面可以是用户界面51。该用户界面51包括状态栏400和应用主界面。该应用主界面包含提醒信息501和提醒信息502。其中,提醒信息501为相机应用的插件更新通知。相机为电子设备本地已安装的一个应用。该插件更新通知用于提示用户闪光灯功能对应的插件有更新。
如图5B所示,当用户点击该提醒信息501,则电子设备响应于上述用户操作从服务器接收该闪光灯键405对应的新版本的插件。电子设备检测该插件的主版本号和相机的插件框架的主版本号是否相同。当插件的主版本号和相机的插件框架的主版本号相同时,电子设备安装该新版本的插件。
当电子设备检测到完成上述更新的插件的安装后,电子设备从用户界面51切换为用户界面52。
如果插件的主版本号和相机的插件框架的主版本号不相同,电子设备则不安装该新版本的插件。
通过本申请实施例,电子设备在安装插件时,通过确保插件的主版本号和插件框架的主版本号相同即可以安装该插件。相较于现有技术中需要在插件的版本号和插件框架的版本号完全相同的情况下才能安装的手段,本方案的电子设备在安装插件时更加灵活,兼容性更高。
另一方面,本方案可满足用户基于不同的需求下载安装不同的插件,无需将对应应用的所有插件均进行安装,提高了用户体验。
上述图4B~图4D以及图5A~图5B所示的人机交互界面均为电子设备本地安装的应用已包含的插件的交互示意。其中,当服务器发布的插件对应的标识与本地安装的相应应用所包含的插件的标识均不同时,也就是说服务器发布了全新的插件,则仍可适用上述方法。其中,在步骤S401之前,所述方法可包括:
电子设备通过预设时间间隔从服务器获取到应用更新信息。
其中,当服务器发布了全新的插件时,电子设备通过预设时间间隔从服务器如应用市场获取到应用更新信息。
电子设备将所述应用更新信息通过弹框或者界面显示等方式提示用户存在相应应用的更新信息,以指示用户进行升级。
当检测到用户进行应用更新操作时,电子设备响应于上述用户操作进行应用的更新。
当更新完成后,对应应用的界面可显示全新的插件所对应的功能图标,同时可在该功能图标的旁边显示示意箭头等,以指示用户该功能的插件可下载。
作为一种可选的实现方式,其中,当用户安装的该应用的界面存在已经发布但未下载的插件时,电子设备在该应用的界面中显示该插件对应的功能图标,同时在该功能图标的旁边显示示意箭头等,以指示该插件可下载。
作为另一种可选的实现方式,所述方法还可包括:
电子设备可在预设时间间隔向服务器发送请求,以获取服务器中是否发布有所述电子设备本地安装的应用的更新插件。
若存在,则电子设备检测所述更新插件的标识与本地安装的应用的各插件的标识是否存在相同;
若不存在与所述更新插件的标识相同的插件,则所述电子设备触发执行步骤S401。
其中,当不存在与所述更新插件的标识相同的插件,则电子设备确认该更新插件是对应应用的全新插件。电子设备可在相应应用的预设界面显示预设信息,以指示存在新的功能的插件,并可指示用户进行下载。
具体地,电子设备在预设时间间隔向服务器发送请求,以获取服务器中是否发布有所述电子设备本地安装的应用对应的更新插件。当发布了相机应用存在更新插件时,电子设备检测服务器发布的相机应用的更新插件的标识与本地安装的相机应用的各插件的标识是否存在相同。若不存在相同的,则电子设备确认该更新插件为相机应用对应的全新的插件。电子设备将该更新插件的更新信息展示在对应的应用中或者通过弹窗的形式提示用户。
如当发布了相机应用存在更新插件时,电子设备检测本地安装的相机应用中是否包含该插件,若本地安装的应用中不包含该插件,则电子设备100显示第一用户界面。上述第一用户界面可以参照如图4C所示的用户界面,或者是如图5A所示的用户界面,此处不做具体限定。
具体地,如相机应用目前不包含某一功能对应的插件,当服务器发布了该新功能对应的插件A时,则电子设备可直接在相机应用的应用界面中显示该新功能图标,并在该新功能图标的旁边显示一个示意箭头等,可参阅图4C所示,以提示用户可进行下载安装该新插件。可选的,电子设备也可通过弹窗的形式展示该更新信息,可参阅图5A所示。电子设备通过接收第一用户操作并响应于所述第一用户操作,从服务器接收所述插件,并检测所述插件的主版本号和与其关联的插件框架的主版本号是否相同;若是,所述电子设备安装所述插件。
上述实施例仅以相机应用作为一种示例,本方案并不限制具体的应用类型。
作为本申请实施例的另一种实现方式,如图6所示,为本申请实施例提供的一种安装插件的方法的流程示意图。如图6所示,其包括步骤S601-S606,具体如下:
S601、电子设备显示第一用户界面;
上述第一用户界面可以是如图4C所示的用户界面,或者是如图5A所示的用户界面, 此处不做具体限定。
S602、电子设备接收第一用户操作,所述第一用户操作用于请求安装与第一应用相关的第一插件,所述第一应用是所述电子设备本地已安装的一个应用,所述第一应用包含第一插件框架和与所述第一插件框架相关联的至少一个插件,所述至少一个插件中每个插件的主版本号与所述第一插件框架的主版本号相同,所述至少一个插件中每个插件具有与该插件对应的第二版本号,所述第一插件框架具有第一版本号,所述第一版本号和所述第二版本号均包含主版本号、子版本号和阶段版本号,所述第一插件不同于所述至少一个插件;
S603、响应于所述第一用户操作,所述电子设备从服务器接收所述第一插件;
S604、所述电子设备检测所述第一插件的主版本号和所述第一插件框架的主版本号是否相同;
S605、若所述第一插件的主版本号和所述第一插件框架的主版本号相同,所述电子设备检测所述第一插件的阶段版本号和所述第一插件框架的阶段版本号是否不同;
S606、若不同,所述电子设备安装所述第一插件。
当插件的主版本号和相机的插件框架的主版本号相同时,电子设备确认该插件的阶段版本号和插件框架的阶段版本号是否不同,当该插件的阶段版本号和插件框架的阶段版本号不同时,电子设备安装所述插件。
其中,插件的子版本号和插件框架的子版本号可以相同,也可以不同,此处不做限制。
通过本申请实施例,电子设备在安装插件时,通过在确保插件的主版本号和插件框架的主版本号相同,且插件的阶段版本号和插件框架的阶段版本号不同时即可以安装该插件。相较于现有技术中需要在插件的版本号和插件框架的版本号完全相同的情况下才能安装的手段,本方案的电子设备在安装插件时更加灵活,兼容性更高。
参照图7所示,为本申请实施例提供的一种创建类加载器的方法的流程示意图。
其中,动态库又叫做共享库。动态库把调用的代码在执行程序中作下标记,等到程序运行时才去加载需要的函数。也就是说执行程序在运行时需要动态库做支持,自己不能独立执行。这样如果某个模块修改了代码,不需要将整个程序都重新编译,而是编译一部分,生成新的动态库.so文件即可。
现有技术中对于配置了isolated Split属性的插件,目前无法访问插件自身内部的动态库文件。为此,本方案提出的安装插件的方法,对于isolated插件,支持插件访问自身内部的动态库文件,其中,在创建类加载器的时候,把应用内扫描出的动态库文件添加到类加载器内,达到可以加载类的效果。如图7所示,其可包括步骤701~704,具体如下:
S701、电子设备创建第一插件的初始类加载器;
S702、所述电子设备确认所述第一插件是否配置有isolated Split属性;
S703、若配置有,则所述电子设备获取所述第一插件的动态库文件的存储路径;
S704、所述电子设备将所述动态库文件的存储路径添加至所述初始类加载器中并得到所述第一插件的类加载器。
其中,电子设备在检测到插件配置有isolated Split属性时,通过获取插件的动态库文 件的存储路径,并将该动态库文件的存储路径添加到类加载器中,以支持插件访问自身内部的动态库文件。
如图8所示,为本申请实施例提供的一种人脸识别插件创建类加载器的示意图。电子设备确认人脸识别插件配置有isolated Split属性后获取所述人脸识别插件的动态库文件的存储路径,并将该动态库文件的存储路径添加至人脸识别插件的类加载器中,这样可支持人脸识别插件访问自身内部的动态库文件。
如图9所示,为本申请实施例提供的一种系统升级的方法的流程示意图。
其中,对于电子设备的系统在进行OTA升级时,由于同一插件在预置分区和安装分区各有一个的情况下,OTA升级过程可能会选择了较低版本的插件,如系统升级时只选取预置分区的插件和插件框架进行安装,而预置分区的插件的版本号可能低于安装分区的插件的版本号,或者预置分区的插件框架的版本号可能低于安装分区的插件框架的版本号。因此,在OTA升级后会造成插件或者插件框架的版本降级。为此,本方案提出一种电子设备进行系统升级的控制方法。其中,当检测到电子设备在进行OTA升级时,电子设备通过获取待升级应用对应的预置分区与安装分区的两个目录,通过检测上述两个目录中各插件和各插件框架的版本号,以获取各插件的最高版本以及插件框架的最高版本。根据各插件的最高版本以及插件框架的最高版本形成一个新的安装应用,并进行安装。同时电子设备删除或者禁用旧安装应用,进而完成OTA升级。
参照图9所示,其中,第一应用是电子设备本地已安装的一个应用,所述第一应用包含第一插件框架和与所述第一插件框架相关联的至少一个插件,所述至少一个插件中每个插件的主版本号与所述第一插件框架的主版本号相同;所述方法包括步骤901~904,具体如下:
S901、当电子设备检测到用于指示升级系统的指令时,所述电子设备从服务器获取第一系统安装包,所述第一系统安装包包含至少一个应用的安装包,所述至少一个应用包含第一应用,所述第一应用包含第一插件框架和与所述第一插件框架相关联的至少一个插件,所述至少一个插件中每个插件的主版本号与所述第一插件框架的主版本号相同,所述至少一个插件中每个插件具有与该插件对应的第二版本号,所述第一插件框架具有第一版本号,所述第一版本号和所述第二版本号均包含主版本号、子版本号和阶段版本号,所述第一应用的安装包包含第三插件;所述已安装的所述第一应用所包括的存储在所述电子设备上的至少一个插件包括第四插件和第五插件,所述第三插件、所述第四插件和第五插件是版本号不同、标识相同的插件,所述第四插件被存储在所述电子设备的预置分区,所述第五插件被存储在所述电子设备的安装分区,其中,每个插件均携带有标识,对应相同功能图标的插件的标识相同;
S902、所述电子设备检测所述第三插件的版本号是否高于所述已安装的所述第一应用所包括的存储在所述电子设备上的与所述第三插件的标识相同的所有插件的版本号;
S903、若是,所述电子设备检测所述第三插件的主版本号和所述第一插件框架的主版本号是否相同;
S904、若相同,所述电子设备安装所述第三插件,并删除/禁用与所述第三插件的标识相同的所有插件。
若所述第四插件是与所述第三插件的标识相同的所有插件中版本号最高的插件,所述电子设备安装所述第四插件,并禁用除所述第四插件外其他与所述第三插件的标识相同的插件。
进一步,所述第一应用的安装包还包含第二插件框架,所述第一插件框架和所述第二插件框架是版本号不同的插件框架,所述方法还包括:
所述电子设备检测所述第二插件框架的版本号是否高于所述第一插件框架的版本号;
若是,所述电子设备安装所述第二插件框架并删除/禁用所述第一插件框架。
若所述第二插件框架的版本号低于所述第一插件框架的版本号,所述电子设备安装所述第一插件框架并禁用所述第二插件框架。
可选的,如果某应用对应的某一分区如安装分区的插件框架和各插件的版本均为最高版本,则直接使用该分区的版本,删除或者禁用预置分区对应的插件框架和各插件的版本。
可选的,所述电子设备安装所述第三插件包括所述电子设备安装所述第三插件的类加载器,所述电子设备安装所述第三插件的类加载器,包括:
所述电子设备创建所述第三插件的初始类加载器;
所述电子设备确认所述第三插件是否配置有isolated Split属性;
若配置有,则所述电子设备获取所述第三插件的动态库文件的存储路径;
所述电子设备将所述动态库文件的存储路径添加至所述初始类加载器中并得到所述第三插件的类加载器。
可选的,所述第三插件为人工智能AI插件。
可选的,所述人工智能AI插件包括如下中的一种或多种:人脸识别插件、图像超分插件、意图识别插件、文本翻译插件、语音识别插件、车机语音唤醒插件和车机语音识别插件。
本方案可适用于人工智能(Artificial Intelligence,AI)终端,可以适用于人工智能插件。
如图10所示,为电子设备进行OTA升级时的一实施例的示意图。其中,电子设备分别获取相应应用的安装分区和预置分区两个目录。其中,安装分区和预置分区均包含有上述应用对应的插件框架和各插件。电子设备获取到安装分区中插件框架的版本号为1.1.3,预置分区中插件框架的版本号为1.1.8,电子设备确认预置分区中插件框架的版本号高于安装分区中插件框架的版本号,电子设备将预置分区中的插件框架作为新安装应用的插件框架。
进一步,电子设备获取到安装分区中插件1的版本号为1.1.3,预置分区中插件1的版本号为1.1.8,电子设备确认预置分区中插件1的版本号高于安装分区中插件1的版本号,电子设备将预置分区中的插件1作为新安装应用的插件1。依次地,电子设备获取到安装分区中插件2的版本号为1.1.8,预置分区中插件2的版本号为1.1.5,电子设备确认安装分区中插件2的版本号高于预置分区中插件2的版本号,电子设备将安装分区中的插件2作 为新安装应用的插件2。相似地,电子设备确认预置分区中插件3和插件4的版本号分别高于安装分区中插件3和插件4的版本号,电子设备将预置分区中的插件3和插件4作为新安装应用的插件3和插件4。
电子设备依次遍历各分区中不同插件和插件框架,并获取最高版本的插件和插件框架,以此得到新安装应用的安装包,进而进行安装,以完成OTA升级。
其中,OTA升级中可包含多个应用的安装包,其获取各应用的安装包的方法与上述相同,在此不再赘述。
通过本申请实施例,可实现电子设备在完成OTA升级后对应升级应用的各插件的版本均为最高版本,且插件框架的版本为最高版本,以解决现有技术中在OTA升级后版本降级的缺点。
本申请实施例还提供一种装置,包括:一个或多个处理器、一个或多个存储器;所述一个或多个存储器与所述一个或多个处理器耦合,所述一个或多个存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,当所述一个或多个处理器执行所述计算机指令时,使得所述装置执行:
当所述一个或多个处理器执行所述计算机指令时,使得所述装置执行以下操作:
接收第一用户操作,所述第一用户操作用于请求安装与第一应用相关的第一插件,所述第一应用是所述装置本地已安装的一个应用,所述第一应用包含第一插件框架和与所述第一插件框架相关联的至少一个插件,所述至少一个插件中每个插件的主版本号与所述第一插件框架的主版本号相同,所述至少一个插件中每个插件具有与该插件对应的第二版本号,所述第一插件框架具有第一版本号,所述第一版本号和所述第二版本号均包含主版本号、子版本号和阶段版本号,所述第一插件不同于所述至少一个插件;
响应于所述第一用户操作,从服务器接收所述第一插件;
检测所述第一插件的主版本号和所述第一插件框架的主版本号是否相同;
若是,安装所述第一插件。
可选的,所述第一插件的阶段版本号和所述第一插件框架的阶段版本号不同。
所述装置还执行:所述至少一个插件包括第二插件,所述第一插件为所述第二插件对应的更新插件。
所述装置还执行:所述第一插件为所述第一应用的全新的插件。
所述装置还执行以下操作:
创建所述第一插件的初始类加载器;
确认所述第一插件是否配置有isolated Split属性;
若配置有,则获取所述第一插件的动态库文件的存储路径;
将所述动态库文件的存储路径添加至所述初始类加载器中并得到所述第一插件的类加载器。
所述装置还执行以下操作:当检测到用于指示升级系统的指令时,从所述服务器获取第一系统安装包,所述第一系统安装包包含至少一个应用的安装包,所述至少一个应用包 含所述第一应用,所述第一应用的安装包包含第三插件;所述已安装的所述第一应用所包括的存储在所述装置上的至少一个插件包括第四插件和第五插件,所述第三插件、所述第四插件和第五插件是版本号不同、标识相同的插件,所述第四插件被存储在所述装置的预置分区,所述第五插件被存储在所述装置的安装分区,其中,每个插件均携带有标识,对应相同功能图标的插件的标识相同;
检测所述第三插件的版本号是否高于所述已安装的所述第一应用所包括的存储在所述装置上的与所述第三插件的标识相同的所有插件的版本号;
若是,检测所述第三插件的主版本号和所述第一插件框架的主版本号是否相同;
若相同,安装所述第三插件。
其中,所述第一应用的安装包还包含第二插件框架,所述第一插件框架和所述第二插件框架是版本号不同的插件框架,所述装置还执行以下操作:
检测所述第二插件框架的版本号是否高于所述第一插件框架的版本号;
若是,安装所述第二插件框架。
其中,所述第一插件为人工智能AI插件。
所述人工智能AI插件包括如下中的一种或多种:人脸识别插件、图像超分插件、意图识别插件、文本翻译插件、语音识别插件、车机语音唤醒插件和车机语音识别插件。
所述装置为终端设备或终端设备的一部分。
本申请实施例还提供一种装置,包括:一个或多个处理器、一个或多个存储器;所述一个或多个存储器与所述一个或多个处理器耦合,所述一个或多个存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令;
当所述一个或多个处理器执行所述计算机指令时,使得所述装置执行以下操作:
当检测到用于指示升级系统的指令时,从服务器获取第一系统安装包,所述第一系统安装包包含至少一个应用的安装包,所述至少一个应用包含第一应用,所述第一应用包含第一插件框架和与所述第一插件框架相关联的至少一个插件,所述至少一个插件中每个插件的主版本号与所述第一插件框架的主版本号相同,所述至少一个插件中每个插件具有与该插件对应的第二版本号,所述第一插件框架具有第一版本号,所述第一版本号和所述第二版本号均包含主版本号、子版本号和阶段版本号,所述第一应用的安装包包含第三插件;所述已安装的所述第一应用所包括的存储在所述装置上的至少一个插件包括第四插件和第五插件,所述第三插件、所述第四插件和第五插件是版本号不同、标识相同的插件,所述第四插件被存储在所述装置的预置分区,所述第五插件被存储在所述装置的安装分区,其中,每个插件均携带有标识,对应相同功能图标的插件的标识相同;
检测所述第三插件的版本号是否高于所述已安装的所述第一应用所包括的存储在所述装置上的与所述第三插件的标识相同的所有插件的版本号;
若是,检测所述第三插件的主版本号和所述第一插件框架的主版本号是否相同;
若相同,安装所述第三插件。
可选的,所述第一应用的安装包还包含第二插件框架,所述第一插件框架和所述第二 插件框架是版本号不同的插件框架,所述装置还执行以下操作:
检测所述第二插件框架的版本号是否高于所述第一插件框架的版本号;
若是,安装所述第二插件框架。
可选的,所述第三插件为人工智能AI插件。
所述装置还执行以下操作:
创建所述第三插件的初始类加载器;
确认所述第三插件是否配置有isolated Split属性;
若配置有,则获取所述第三插件的动态库文件的存储路径;
将所述动态库文件的存储路径添加至所述初始类加载器中并得到所述第三插件的类加载器。
所述装置为终端设备或终端设备的一部分。
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机或处理器上运行时,使得计算机或处理器执行上述任一个方法中的一个或多个步骤。
本申请实施例还提供了一种包含指令的计算机程序产品。当该计算机程序产品在计算机或处理器上运行时,使得计算机或处理器执行上述任一个方法中的一个或多个步骤。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。
以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何在本申请实施例揭露的技术范围内的变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。

Claims (20)

  1. 一种安装插件的方法,其特征在于,所述方法包括:
    电子设备接收第一用户操作,所述第一用户操作用于请求安装与第一应用相关的第一插件,所述第一应用是所述电子设备本地已安装的一个应用,所述第一应用包含第一插件框架和与所述第一插件框架相关联的至少一个插件,所述至少一个插件中每个插件的主版本号与所述第一插件框架的主版本号相同,所述至少一个插件中每个插件具有与该插件对应的第二版本号,所述第一插件框架具有第一版本号,所述第一版本号和所述第二版本号均包含主版本号、子版本号和阶段版本号,所述第一插件不同于所述至少一个插件;
    响应于所述第一用户操作,所述电子设备从服务器接收所述第一插件;
    所述电子设备检测所述第一插件的主版本号和所述第一插件框架的主版本号是否相同;
    若是,所述电子设备安装所述第一插件。
  2. 根据权利要求1所述的方法,其特征在于,所述第一插件的阶段版本号和所述第一插件框架的阶段版本号不同。
  3. 根据权利要求1或2所述的方法,其特征在于,所述至少一个插件包括第二插件,所述第一插件为所述第二插件对应的更新插件。
  4. 根据权利要求1或2所述的方法,其特征在于,所述第一插件为所述第一应用的全新的插件。
  5. 根据权利要求1至4任一项所述的方法,其特征在于,所述电子设备安装所述第一插件包括所述电子设备安装所述第一插件的类加载器,所述电子设备安装所述第一插件的类加载器,包括:
    所述电子设备创建所述第一插件的初始类加载器;
    所述电子设备确认所述第一插件是否配置有isolatedSplit属性;
    若配置有,则所述电子设备获取所述第一插件的动态库文件的存储路径;
    所述电子设备将所述动态库文件的存储路径添加至所述初始类加载器中并得到所述第一插件的类加载器。
  6. 根据权利要求1至5任一项所述的方法,其特征在于,所述第一插件为人工智能AI插件。
  7. 根据权利要求6所述的方法,其特征在于,所述人工智能AI插件包括如下中的一种或多种:人脸识别插件、图像超分插件、意图识别插件、文本翻译插件、语音识别插件、车机语音唤醒插件和车机语音识别插件。
  8. 一种安装插件的方法,其特征在于,所述方法包括:
    当电子设备检测到用于指示升级系统的指令时,所述电子设备从服务器获取第一系统安装包,所述第一系统安装包包含至少一个应用的安装包,所述至少一个应用包含第一应用,所述第一应用包含第一插件框架和与所述第一插件框架相关联的至少一个插件,所述至少一个插件中每个插件的主版本号与所述第一插件框架的主版本号相同,所述至少一个插件中每个插件具有与该插件对应的第二版本号,所述第一插件框架具有第一版本号,所述第一版本号和所述第二版本号均包含主版本号、子版本号和阶段版本号,所述第一应用的安装包包含第三插件;所述已安装的所述第一应用所包括的存储在所述电子设备上的至少一个插件包括第四插件和第五插件,所述第三插件、所述第四插件和第五插件是版本号不同、标识相同的插件,所述第四插件被存储在所述电子设备的预置分区,所述第五插件被存储在所述电子设备的安装分区,其中,每个插件均携带有标识,对应相同功能图标的插件的标识相同;
    所述电子设备检测所述第三插件的版本号是否高于所述已安装的所述第一应用所包括的存储在所述电子设备上的与所述第三插件的标识相同的所有插件的版本号;
    若是,所述电子设备检测所述第三插件的主版本号和所述第一插件框架的主版本号是否相同;
    若相同,所述电子设备安装所述第三插件。
  9. 根据权利要求8所述的方法,其特征在于,所述第一应用的安装包还包含第二插件框架,所述第一插件框架和所述第二插件框架是版本号不同的插件框架,所述方法还包括:
    所述电子设备检测所述第二插件框架的版本号是否高于所述第一插件框架的版本号;
    若是,所述电子设备安装所述第二插件框架。
  10. 一种装置,其特征在于,包括:一个或多个处理器、一个或多个存储器;所述一个或多个存储器与所述一个或多个处理器耦合,所述一个或多个存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令;
    当所述一个或多个处理器执行所述计算机指令时,使得所述装置执行以下操作:
    接收第一用户操作,所述第一用户操作用于请求安装与第一应用相关的第一插件,所述第一应用是所述装置本地已安装的一个应用,所述第一应用包含第一插件框架和与所述第一插件框架相关联的至少一个插件,所述至少一个插件中每个插件的主版本号与所述第一插件框架的主版本号相同,所述至少一个插件中每个插件具有与该插件对应的第二版本号,所述第一插件框架具有第一版本号,所述第一版本号和所述第二版本号均包含主版本号、子版本号和阶段版本号,所述第一插件不同于所述至少一个插件;
    响应于所述第一用户操作,从服务器接收所述第一插件;
    检测所述第一插件的主版本号和所述第一插件框架的主版本号是否相同;
    若是,安装所述第一插件。
  11. 根据权利要求10所述的装置,其特征在于,所述第一插件的阶段版本号和所述第一插件框架的阶段版本号不同。
  12. 根据权利要求10或11所述的装置,其特征在于,所述至少一个插件包括第二插件,所述第一插件为所述第二插件对应的更新插件。
  13. 根据权利要求10或11所述的装置,其特征在于,所述第一插件为所述第一应用的全新的插件。
  14. 根据权利要求10至13任一项所述的装置,其特征在于,所述装置还执行以下操作:
    创建所述第一插件的初始类加载器;
    确认所述第一插件是否配置有isolated Split属性;
    若配置有,则获取所述第一插件的动态库文件的存储路径;
    将所述动态库文件的存储路径添加至所述初始类加载器中并得到所述第一插件的类加载器。
  15. 根据权利要求10至14任一项所述的装置,其特征在于,所述第一插件为人工智能AI插件。
  16. 根据权利要求15所述的装置,其特征在于,所述人工智能AI插件包括如下中的一种或多种:人脸识别插件、图像超分插件、意图识别插件、文本翻译插件、语音识别插件、车机语音唤醒插件和车机语音识别插件。
  17. 根据权利要求10至16任一项所述的装置,其特征在于,所述装置为终端设备或终端设备的一部分。
  18. 一种装置,其特征在于,包括:一个或多个处理器、一个或多个存储器;所述一个或多个存储器与所述一个或多个处理器耦合,所述一个或多个存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令;
    当所述一个或多个处理器执行所述计算机指令时,使得所述装置执行以下操作:
    当检测到用于指示升级系统的指令时,从服务器获取第一系统安装包,所述第一系统安装包包含至少一个应用的安装包,所述至少一个应用包含第一应用,所述第一应用包含第一插件框架和与所述第一插件框架相关联的至少一个插件,所述至少一个插件中每个插件的主版本号与所述第一插件框架的主版本号相同,所述至少一个插件中每个插件具有与该插件对应的第二版本号,所述第一插件框架具有第一版本号,所述第一版本号和所述第二版本号均包含主版本号、子版本号和阶段版本号,所述第一应用的安装包包含第三插件; 所述已安装的所述第一应用所包括的存储在所述装置上的至少一个插件包括第四插件和第五插件,所述第三插件、所述第四插件和第五插件是版本号不同、标识相同的插件,所述第四插件被存储在所述装置的预置分区,所述第五插件被存储在所述装置的安装分区,其中,每个插件均携带有标识,对应相同功能图标的插件的标识相同;
    检测所述第三插件的版本号是否高于所述已安装的所述第一应用所包括的存储在所述装置上的与所述第三插件的标识相同的所有插件的版本号;
    若是,检测所述第三插件的主版本号和所述第一插件框架的主版本号是否相同;
    若相同,安装所述第三插件。
  19. 根据权利要求18所述的装置,其特征在于,所述第一应用的安装包还包含第二插件框架,所述第一插件框架和所述第二插件框架是版本号不同的插件框架,所述装置还执行以下操作:
    检测所述第二插件框架的版本号是否高于所述第一插件框架的版本号;
    若是,安装所述第二插件框架。
  20. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以实现权利要求1至7任意一项所述的方法和/或权利要求8至9任意一项所述的方法。
PCT/CN2020/115374 2019-10-15 2020-09-15 安装插件的方法、装置和存储介质 WO2021073337A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20877330.9A EP4033354A4 (en) 2019-10-15 2020-09-15 METHOD AND DEVICE FOR INSTALLING PLUG-IN AND STORAGE MEDIA
US17/754,870 US20240095000A1 (en) 2019-10-15 2020-09-15 Plug-In Installation Method, Apparatus, and Storage Medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910980401.0 2019-10-15
CN201910980401.0A CN112667306A (zh) 2019-10-15 2019-10-15 安装插件的方法、装置和存储介质

Publications (1)

Publication Number Publication Date
WO2021073337A1 true WO2021073337A1 (zh) 2021-04-22

Family

ID=75400090

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/115374 WO2021073337A1 (zh) 2019-10-15 2020-09-15 安装插件的方法、装置和存储介质

Country Status (4)

Country Link
US (1) US20240095000A1 (zh)
EP (1) EP4033354A4 (zh)
CN (1) CN112667306A (zh)
WO (1) WO2021073337A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114422637A (zh) * 2021-12-20 2022-04-29 阿里巴巴(中国)有限公司 媒体请求处理方法和跨平台引擎系统
CN117056115A (zh) * 2023-10-10 2023-11-14 腾讯科技(深圳)有限公司 应用程序的修复方法和装置、存储介质及电子设备

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114780173B (zh) * 2022-01-25 2023-12-05 统信软件技术有限公司 一种在应用中加载插件的方法、计算设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8185889B2 (en) * 2007-06-19 2012-05-22 Red Hat, Inc. Methods and systems for porting software packages from one format to another
CN105511902A (zh) * 2015-11-09 2016-04-20 Tcl集团股份有限公司 一种安卓平台模块动态加载的方法及系统
CN105872842A (zh) * 2015-12-30 2016-08-17 乐视致新电子科技(天津)有限公司 一种多桌面独立升级方法及装置
CN106331135A (zh) * 2016-08-31 2017-01-11 广州品唯软件有限公司 一种部分界面更新方法、系统、客户端和服务端
CN107402761A (zh) * 2017-07-25 2017-11-28 青岛海信电器股份有限公司 应用修复方法及装置
CN109729116A (zh) * 2017-10-30 2019-05-07 腾讯科技(深圳)有限公司 插件信息的传输方法、装置、存储介质及电子装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6996832B2 (en) * 2001-05-30 2006-02-07 Bea Systems, Inc. System and method for software component plug-in framework
CN105335187B (zh) * 2014-08-14 2019-12-13 阿里巴巴集团控股有限公司 一种应用的处理方法及装置
US9893887B2 (en) * 2015-01-30 2018-02-13 Ciena Corporation Dynamic licensing for applications and plugin framework for virtual network systems
CN104820676B (zh) * 2015-04-14 2018-06-19 天脉聚源(北京)教育科技有限公司 一种判断版本号大小的方法及装置
US10802861B2 (en) * 2017-11-30 2020-10-13 International Busienss Machines Corporation Accessing host services for virtual guest operating systems

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8185889B2 (en) * 2007-06-19 2012-05-22 Red Hat, Inc. Methods and systems for porting software packages from one format to another
CN105511902A (zh) * 2015-11-09 2016-04-20 Tcl集团股份有限公司 一种安卓平台模块动态加载的方法及系统
CN105872842A (zh) * 2015-12-30 2016-08-17 乐视致新电子科技(天津)有限公司 一种多桌面独立升级方法及装置
CN106331135A (zh) * 2016-08-31 2017-01-11 广州品唯软件有限公司 一种部分界面更新方法、系统、客户端和服务端
CN107402761A (zh) * 2017-07-25 2017-11-28 青岛海信电器股份有限公司 应用修复方法及装置
CN109729116A (zh) * 2017-10-30 2019-05-07 腾讯科技(深圳)有限公司 插件信息的传输方法、装置、存储介质及电子装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4033354A4

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114422637A (zh) * 2021-12-20 2022-04-29 阿里巴巴(中国)有限公司 媒体请求处理方法和跨平台引擎系统
CN114422637B (zh) * 2021-12-20 2023-12-29 阿里巴巴(中国)有限公司 媒体请求处理方法和跨平台引擎系统
CN117056115A (zh) * 2023-10-10 2023-11-14 腾讯科技(深圳)有限公司 应用程序的修复方法和装置、存储介质及电子设备
CN117056115B (zh) * 2023-10-10 2024-03-15 腾讯科技(深圳)有限公司 应用程序的修复方法和装置、存储介质及电子设备

Also Published As

Publication number Publication date
EP4033354A1 (en) 2022-07-27
EP4033354A4 (en) 2023-02-22
CN112667306A (zh) 2021-04-16
US20240095000A1 (en) 2024-03-21

Similar Documents

Publication Publication Date Title
WO2021042978A1 (zh) 一种主题切换方法以及主题切换装置
WO2021159746A1 (zh) 文件共享方法、系统及相关设备
WO2021073337A1 (zh) 安装插件的方法、装置和存储介质
WO2021253975A1 (zh) 应用程序的权限管理方法、装置和电子设备
WO2021052204A1 (zh) 基于通讯录的设备发现方法、音视频通信方法及电子设备
CN113704205B (zh) 日志存储的方法、芯片、电子设备和可读存储介质
CN113961157B (zh) 显示交互系统、显示方法及设备
CN113568634B (zh) 应用优化的处理方法及处理装置
CN114124980B (zh) 一种启动应用的方法、设备、系统、终端及存储介质
CN114553814A (zh) 处理推送消息的方法和装置
CN114741720A (zh) 一种权限管理方法及终端设备
CN113703894A (zh) 通知消息的显示方法和显示装置
CN113485709B (zh) 应用优化方法、装置以及电子设备
WO2022111529A1 (zh) 一种应用程序的调试方法及电子设备
WO2022135195A1 (zh) 显示虚拟现实界面的方法、装置、设备和可读存储介质
CN113467821A (zh) 应用程序的修复方法、装置、设备及可读存储介质
CN113495733A (zh) 主题包安装方法、装置、电子设备及计算机可读存储介质
CN116048629B (zh) 系统服务切换方法及控制装置、电子设备和存储介质
CN114996162B (zh) 测试方法及相关装置
CN114168115B (zh) 通信系统、应用下载方法及设备
WO2024104137A1 (zh) 一种支持数据融合的数据恢复方法及装置
WO2023179682A1 (zh) 一种设备协同方法
CN116709609B (zh) 消息传递方法、电子设备及存储介质
WO2024093703A1 (zh) 一种实例的管理方法、装置、电子设备及存储介质
WO2023045876A1 (zh) 应用程序安装方法及相关设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20877330

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 17754870

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2020877330

Country of ref document: EP

Effective date: 20220421