WO2024244598A1 - Method for managing shared library, apparatus and electronic device - Google Patents
Method for managing shared library, apparatus and electronic device Download PDFInfo
- Publication number
- WO2024244598A1 WO2024244598A1 PCT/CN2024/081001 CN2024081001W WO2024244598A1 WO 2024244598 A1 WO2024244598 A1 WO 2024244598A1 CN 2024081001 W CN2024081001 W CN 2024081001W WO 2024244598 A1 WO2024244598 A1 WO 2024244598A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- shared library
- shared
- version
- information
- application
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 141
- 238000009434 installation Methods 0.000 claims description 61
- 230000001419 dependent effect Effects 0.000 claims description 20
- 238000004590 computer program Methods 0.000 claims description 19
- 230000004044 response Effects 0.000 claims description 8
- 230000010354 integration Effects 0.000 abstract description 14
- 238000004891 communication Methods 0.000 description 34
- 230000006854 communication Effects 0.000 description 34
- 230000006870 function Effects 0.000 description 32
- 238000007726 management method Methods 0.000 description 30
- 230000003993 interaction Effects 0.000 description 21
- 238000012545 processing Methods 0.000 description 19
- 238000011161 development Methods 0.000 description 14
- 230000018109 developmental process Effects 0.000 description 14
- 230000008569 process Effects 0.000 description 14
- 230000005236 sound signal Effects 0.000 description 13
- 238000010295 mobile communication Methods 0.000 description 12
- 210000000988 bone and bone Anatomy 0.000 description 10
- 238000010586 diagram Methods 0.000 description 10
- 230000000737 periodic effect Effects 0.000 description 10
- 230000007246 mechanism Effects 0.000 description 6
- 230000000694 effects Effects 0.000 description 5
- 230000001960 triggered effect Effects 0.000 description 5
- 238000013500 data storage Methods 0.000 description 4
- 229920001621 AMOLED Polymers 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 3
- 238000013528 artificial neural network Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000011534 incubation Methods 0.000 description 3
- 239000010985 leather Substances 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 2
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 2
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000032683 aging Effects 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 2
- 230000036772 blood pressure Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 230000014509 gene expression Effects 0.000 description 2
- 230000033001 locomotion Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000005855 radiation Effects 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 230000000717 retained effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 230000001755 vocal effect Effects 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 230000003416 augmentation Effects 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 230000007175 bidirectional communication Effects 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 238000013529 biological neural network Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 210000004556 brain Anatomy 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000019771 cognition Effects 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 239000004020 conductor Substances 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 230000003862 health status Effects 0.000 description 1
- 230000001939 inductive effect Effects 0.000 description 1
- 238000011900 installation process Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 229910044991 metal oxide Inorganic materials 0.000 description 1
- 150000004706 metal oxides Chemical class 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 239000002096 quantum dot Substances 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 230000003238 somatosensory effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
Definitions
- Embodiments of the present application relate to the field of managing shared libraries, and more specifically, to a method, device, and electronic device for managing shared libraries.
- third-party application developers often use third-party code, such as shared libraries, in the development process in order to improve efficiency and reduce costs.
- third-party code such as shared libraries
- shared library providers can provide the code capabilities of their own applications to third-party applications through dynamic loading, so that third-party applications do not need to integrate related content (including code, resources, etc.) in their own installation packages, thereby achieving the purpose of reducing the integration cost of third-party applications.
- the present application provides a method, device and electronic device for managing shared libraries.
- the shared library has independent update or uninstall capabilities, and the system can automatically load the highest version of the shared library that it depends on when the application is started, so that the update of the shared library can be reflected in real time, which can reduce the integration cost and update frequency of the shared library used by application developers.
- the timely uninstallation of redundant shared libraries can also reduce the storage space occupied.
- a method for managing shared libraries comprising: when it is detected that version A of a first shared library is released, determining whether version A of the first shared library is installed in the system; when it is determined that version A of the first shared library is not installed in the system, downloading version A of the first shared library.
- version A is the highest version of the first shared library.
- the method also includes: installing the Ath version of the first shared library; when it is detected that the first application is started, obtaining the Ath version of the first shared library to run the first application, and the first shared library is a shared library that the first application depends on.
- the Ath version of the first shared library is obtained, which may be to obtain the shared library path of the Ath version of the first shared library, so that the first application uses the Ath version of the first shared library according to the shared library path of the Ath version of the first shared library.
- the system can automatically load the highest version of the shared library it depends on when the application starts, so that the update of the shared library can be reflected in real time, thereby reducing the integration cost and update frequency of application developers when using shared libraries.
- determining whether the Ath version of the first shared library is installed in the system includes: obtaining information about the first shared library, the information about the first shared library including information about one or more versions of the first shared library currently installed; and determining whether the Ath version of the first shared library is installed in the system based on the information about the first shared library.
- a method in which an application market queries a system for information related to a shared library, which can realize the shared library information interaction between the application market and the system.
- determining whether the Ath version of the first shared library is installed in the system includes: The application market obtains information about the highest version of the first shared library currently installed by querying the system; the application market determines whether the highest version is the Ath version based on the information about the highest version of the first shared library. If not, the application market determines that the Ath version of the first shared library is not installed in the system.
- another method is provided for an application market to query a system for information related to a shared library, which can realize the shared library information interaction between the application market and the system.
- determining whether the Ath version of the first shared library is installed in the system includes: the application market sends an inquiry message to the system, the inquiry message is used to inquire whether the system has installed the Ath version of the first shared library, the application market receives a reply message to the inquiry message, if the reply message is no, the application market determines that the Ath version of the first shared library is not installed in the system.
- another method is provided for an application market to query a system for information related to a shared library, which can realize the shared library information interaction between the application market and the system.
- whether the Ath version of the first shared library is installed in the system is determined based on the information of the first shared library, including: when the information of the first shared library does not include the Ath version of the first shared library, determining that the Ath version of the first shared library is not installed in the system.
- the information of the first shared library includes information of one or more versions of the first shared library currently installed in the system.
- the application market can further determine whether there is version A of the first shared library in the one or more versions of the first shared library currently installed in the system, and then determine whether version A of the first shared library is installed in the system.
- obtaining the information of the first shared library includes: the application market sends a first query message to the system, and the first query message is used to query the information of the first shared library; the application market receives a first reply message, and the first reply message includes the information of the first shared library.
- the system provides a query interface for the shared library version to the application market, so that the application market can implement information interaction with the system through the query interface, and then obtain the shared library version information from the system.
- the method also includes: determining a third shared library list, the third shared library list including shared libraries in the full shared library that are not dependent on the application, and/or the third shared library list includes lower version shared libraries in the full shared library, the shared libraries in the third shared library list are all in a currently non-running state, and the full shared library includes all shared libraries currently installed in the system; uninstalling the shared libraries in the third shared library list.
- each shared library in the full shared library has its own version identifier.
- the low version shared library is a shared library that is not the highest version.
- the shared library has an independent uninstall capability, which lowers the development threshold for shared library providers and makes the shared library easier to manage and popularize; it can timely uninstall shared libraries that are not relied on by applications in the system and low-version shared libraries, which can reduce the storage space occupied in the system and thereby improve the user experience.
- determining a third shared library list includes: obtaining information about the full shared library, the information about the full shared library including version information of each shared library in the full shared library, and/or the information about the full shared library including dependency information of each shared library in the full shared library, the dependency information being used to characterize whether a shared library is dependent on an application, or the dependency information being used to characterize which applications depend on a shared library; determining a fourth shared library list based on the information about the full shared library, the fourth shared library list including shared libraries in the full shared library that are not dependent on an application, and/or the fourth shared library list including lower-version shared libraries in the full shared library; obtaining running information of each shared library in the fourth shared library list, the running information being used to characterize whether a shared library is currently in a running state; determining the third shared library list based on the running information, the third shared library list including shared libraries in the fourth shared library list that are not currently running.
- the information of the full shared library is obtained at a first time
- the first time may be a periodic time, for example: it may be 22:00 every night, or 2:00 every morning, or every 30 hours, or any other periodic time; the first time may also be a time triggered by a user operation, or a time automatically determined by the system according to the current storage or operation status of the device, and the present application does not limit this.
- the application market can obtain version information and operation information of all shared libraries from the system, and then determine a list of shared libraries that need to be uninstalled, so as to facilitate subsequent uninstallation of the shared libraries in the shared library list.
- obtaining the information of the full shared library includes: the application market sends a second query message to the system, and the second query message is used to query the information of the full shared library; the application market receives a second reply message, and the second reply message includes the information of the full shared library.
- the system provides a query interface for the full shared library information to the application market, so that the application market can implement information interaction with the system through the query interface, and then obtain the full shared library information from the system.
- obtaining the operating information of each shared library in the fourth shared library list includes: the application market sends a third query message to the system, and the third query message is used to query the operating information of each shared library in the fourth shared library list; the application market receives a third reply message, and the third reply message is used to indicate the operating information of each shared library in the fourth shared library list.
- the system provides the application market with a query interface for the running information of the shared library, so that the application market can implement information interaction with the system through the query interface, and then obtain the running information of the shared library from the system.
- the full shared library includes the first version of the first shared library and the Ath version of the first shared library, the Ath version of the first shared library is the highest version of the first shared library, and the method also includes: when the first version of the first shared library is uninstalled, pointing the shared library version that the first application depends on to the Ath version of the first shared library.
- Uninstalling the first version of the first shared library includes: deleting path information of the first version of the first shared library.
- pointing the shared library version that the first application depends on to the Ath version of the first shared library can be understood as modifying the dependency of the first application, that is, changing the dependency of the first application from relying on the first version of the first shared library to relying on the Ath version of the first shared library.
- the system when the first version of the first shared library is uninstalled, the system does not modify the dependency of the first application, but obtains the Ath version of the first shared library each time the first application is started.
- the shared library version used by an application when the shared library version used by an application is uninstalled, the shared library version used by the application automatically points to a higher version of the shared library. In this way, when the application is started, the higher version of the shared library is automatically enabled, and the application will not run abnormally due to the uninstallation of the shared library version, thereby improving the user experience.
- the method also includes: in response to a user operation of installing or updating the first application, obtaining a first shared library list that the first application depends on, the first shared library list including M shared libraries, where M is a positive integer greater than or equal to 1; determining a second shared library list based on the installation status of the M shared libraries, the second shared library list including uninstalled shared libraries among the M shared libraries; installing the shared libraries in the second shared library list, and installing or updating the first application.
- the shared library and the third-party application can be installed together, so that the application can always have the shared library it depends on, which can reduce the occurrence of application operation failures and improve the user experience.
- the method before determining the second shared library list based on the installation status of the M shared libraries, the method also includes: the application market sends a fourth query message to the system, and the fourth query message is used to query the installation status of the M shared libraries; the application market receives a fourth reply message, and the fourth reply message is used to indicate the installation status of the M shared libraries.
- the system provides a query interface for the installation information of the shared library to the application market, so that the application market can implement information interaction with the system through the query interface, and then obtain the installation information of the shared library from the system.
- installing the shared libraries in the second shared library list includes: installing each shared library in the second shared library list in different paths respectively.
- the system when the system installs different versions of shared libraries, it will install different versions of shared libraries in different version paths according to the version numbers.
- different versions of shared libraries can be relatively independent of each other, different versions of the same shared library can be treated as different applications, and operations such as updating or uninstalling a specific version of the shared library can be implemented.
- a method for managing shared libraries comprising: determining a third shared library list, the third shared library list including shared libraries in the full shared library that are not dependent on applications, and/or the third shared library list including lower version shared libraries in the full shared library, the full shared library including all shared libraries currently installed in the system; uninstalling shared libraries in the third shared library list, the shared libraries in the third shared library list are all in a currently non-running state.
- each shared library in the full shared library has its own version identifier.
- the shared library has an independent uninstall capability, which lowers the development threshold for shared library providers and makes the shared library easier to manage and popularize; it can timely uninstall shared libraries that are not relied on by applications in the system and low-version shared libraries, which can reduce the storage space occupied in the system and thereby improve the user experience.
- determining a third shared library list includes: obtaining information about the full shared library, the information about the full shared library including version information of each shared library in the full shared library, and/or the information about the full shared library including dependency information of each shared library in the full shared library, the dependency information being used to characterize whether a shared library is dependent on an application, or the dependency information being used to characterize which applications depend on a shared library; determining a fourth shared library list based on the information about the full shared library, the fourth shared library list including The fourth shared library list includes the shared libraries in the full shared library that are not depended on by the application, and/or the fourth shared library list includes the lower version shared libraries in the full shared library; the running information of each shared library in the fourth shared library list is obtained, and the running information is used to indicate whether the shared library is currently in a running state; the third shared library list is determined according to the running information, and the third shared library list includes the shared libraries in the fourth shared library list that are not currently running.
- the information of the full shared library is obtained at a first time
- the first time may be a periodic time, for example: it may be 22:00 every night, or 2:00 every morning, or every 30 hours, or any other periodic time; the first time may also be a time triggered by a user operation, or a time automatically determined by the system according to the current storage or operation status of the device, and the present application does not limit this.
- the application market can obtain version information and operation information of all shared libraries from the system, and then determine a list of shared libraries that need to be uninstalled, so as to facilitate subsequent uninstallation of the shared libraries in the shared library list.
- obtaining the information of the full shared library includes: the application market sends a second query message to the system, and the second query message is used to query the information of the full shared library; the application market receives a second reply message, and the second reply message includes the information of the full shared library.
- the system provides a query interface for the full shared library information to the application market, so that the application market can implement information interaction with the system through the query interface, and then obtain the full shared library information from the system.
- obtaining the operating information of each shared library in the fourth shared library list includes: the application market sends a third query message to the system, and the third query message is used to query the operating information of each shared library in the fourth shared library list; the application market receives a third reply message, and the third reply message is used to indicate the operating information of each shared library in the fourth shared library list.
- the system provides the application market with a query interface for the running information of the shared library, so that the application market can implement information interaction with the system through the query interface, and then obtain the running information of the shared library from the system.
- the full shared library includes the first version of the first shared library and the Ath version of the first shared library, and the Ath version of the first shared library is the highest version of the first shared library.
- the method also includes: when uninstalling the first version of the first shared library, pointing the shared library version that the first application depends on to the Ath version of the first shared library, and the first shared library is the shared library that the first application depends on.
- Uninstalling the first version of the first shared library includes: deleting path information of the first version of the first shared library.
- pointing the shared library version that the first application depends on to the Ath version of the first shared library can be understood as modifying the dependency of the first application, that is, changing the dependency of the first application from relying on the first version of the first shared library to relying on the Ath version of the first shared library.
- the system when the first version of the first shared library is uninstalled, the system does not modify the dependency of the first application, but obtains the Ath version of the first shared library each time the first application is started.
- the shared library version used by an application when the shared library version used by an application is uninstalled, the shared library version used by the application automatically points to a higher version of the shared library. In this way, when the application is started, the higher version of the shared library is automatically enabled, and the application will not run abnormally due to the uninstallation of the shared library version, thereby improving the user experience.
- the method also includes: in response to a user's operation of installing or updating the first application, obtaining a first shared library list that the first application depends on, the first shared library list including M shared libraries, where M is a positive integer greater than or equal to 1; determining a second shared library list based on the installation status of the M shared libraries, the second shared library list including uninstalled shared libraries among the M shared libraries; installing the shared libraries in the second shared library list, and installing or updating the first application.
- the shared library and the third-party application can be installed together, so that the application can always have the shared library it depends on, which can reduce the occurrence of application operation failures and improve the user experience.
- the method before determining the second shared library list based on the installation status of the M shared libraries, the method also includes: the application market sends a fourth query message to the system, and the fourth query message is used to query the installation status of the M shared libraries; the application market receives a fourth reply message, and the fourth reply message is used to indicate the installation status of the M shared libraries.
- the system provides a query interface for the installation information of the shared library to the application market, so that the application market can implement information interaction with the system through the query interface, and then obtain the installation information of the shared library from the system.
- installing the shared libraries in the second shared library list includes: installing each shared library in the second shared library list in a different path.
- the system when the system installs different versions of shared libraries, it will install different versions of shared libraries in different folders according to the version number.
- different versions of shared libraries can be relatively independent of each other, different versions of the same shared library can be treated as different applications, and operations such as updating or uninstalling a specific version of the shared library can be implemented.
- a device for managing shared libraries comprising: a judgment module, for judging whether the Ath version of the first shared library is installed in the system when it is detected that the Ath version of the first shared library is put on the shelf; and a download module, for downloading the Ath version of the first shared library when it is determined that the Ath version of the first shared library is not installed in the system.
- version A is the highest version of the first shared library.
- the device also includes: an installation module for installing the Ath version of the first shared library; an acquisition module for acquiring the Ath version of the first shared library when it is detected that the first application is started, so as to run the first application, and the first shared library is a shared library that the first application depends on.
- the acquisition module acquires the Ath version of the first shared library.
- the acquisition module may acquire the shared library path of the Ath version of the first shared library so that the first application uses the Ath version of the first shared library according to the shared library path of the Ath version of the first shared library.
- the system can automatically load the highest version of the shared library it depends on when the application starts, so that the update of the shared library can be reflected in real time, thereby reducing the integration cost and update frequency of application developers when using shared libraries.
- the acquisition module is used to obtain information about the first shared library, and the information about the first shared library includes information about one or more versions of the first shared library that are currently installed; the judgment module is specifically used to: judge whether version A of the first shared library is installed in the system based on the information about the first shared library.
- a device for an application market to query a system for information related to a shared library, which can realize the shared library information interaction between the application market and the system.
- the acquisition module is used to obtain information about the highest version of the first shared library currently installed by querying the system; the judgment module is specifically used to: determine whether the highest version is the Ath version based on the information of the highest version of the first shared library; if not, the determination module included in the device determines that the Ath version of the first shared library is not installed in the system.
- another device is provided for the application market to query the system for information related to the shared library, which can realize the shared library information interaction between the application market and the system.
- the device also includes a transceiver module for sending an inquiry message to the system, wherein the inquiry message is used to inquire whether the system has installed the Ath version of the first shared library, and the transceiver module is also used to receive a reply message to the inquiry message, and a determination module for determining that the Ath version of the first shared library is not installed in the system when the reply message is no.
- another device is provided for the application market to query the system for information related to the shared library, which can realize the shared library information interaction between the application market and the system.
- the judgment module is specifically used to: when the information of the first shared library does not include the information of the Ath version of the first shared library, determine that the Ath version of the first shared library is not installed in the system.
- the information of the first shared library includes information of one or more versions of the first shared library currently installed in the system.
- the application market can further determine whether there is version A of the first shared library in the one or more versions of the first shared library currently installed in the system, and then determine whether version A of the first shared library is installed in the system.
- the transceiver module is also used to send a first query message to the system, and the first query message is used to query the information of the first shared library; the transceiver module is also used to receive a first reply message, and the first reply message includes the information of the first shared library.
- the system provides a query interface for the shared library version to the application market, so that the application market can implement information interaction with the system through the query interface, and then obtain the shared library version information from the system.
- the determination module is also used to: determine a third shared library list, the third shared library list includes shared libraries in the full shared library that are not dependent on the application, and/or the third shared library list includes lower version shared libraries in the full shared library, the shared libraries in the third shared library list are all in a currently non-running state, and the full shared library includes all shared libraries currently installed in the system; the device also includes an uninstall module for uninstalling the shared libraries in the third shared library list.
- each shared library in the full shared library has its own version identifier.
- the low version shared library is a shared library that is not the highest version.
- the shared library has an independent uninstall capability, which lowers the development threshold for shared library providers and makes the shared library easier to manage and popularize; it can timely uninstall shared libraries that are not relied on by applications in the system and low-version shared libraries, which can reduce the storage space occupied in the system and thereby improve the user experience.
- the acquisition module is also used to: obtain information about the full shared library, the information about the full shared library includes version information of each shared library in the full shared library, and/or the information about the full shared library includes dependency information of each shared library in the full shared library, the dependency information is used to characterize whether the shared library is dependent on the application, or the dependency information is used to characterize which applications depend on the shared library; determine a fourth shared library list based on the information about the full shared library, the fourth shared library list includes shared libraries in the full shared library that are not dependent on the application, and/or the fourth shared library list includes lower-version shared libraries in the full shared library; obtain running information of each shared library in the fourth shared library list, the running information is used to characterize whether the shared library is currently in a running state; the determination module is specifically used to: determine the third shared library list based on the running information, the third shared library list includes shared libraries in the fourth shared library list that are not currently running.
- the acquisition module acquires the information of the full shared library at a first time
- the first time may be a periodic time, for example: it may be 22:00 every night, or 2:00 every morning, or every 30 hours, or any other periodic time; the first time may also be a time triggered by a user operation, or a time automatically determined by the system according to the current storage or operation status of the device, and the present application does not limit this.
- the application market can obtain version information and operation information of all shared libraries from the system, and then determine a list of shared libraries that need to be uninstalled, so as to facilitate subsequent uninstallation of the shared libraries in the shared library list.
- the transceiver module is also used to: send a second query message to the system, the second query message is used to query the information of the full shared library; receive a second reply message, the second reply message includes the information of the full shared library.
- the system provides the application market with a query interface for information of the full shared library, so that the application market can implement information interaction with the system through the query interface, and then obtain the full shared library information from the system.
- the transceiver module is also used to: send a third query message to the system, the third query message is used for the operation information of each shared library in the fourth shared library list; receive a third reply message, the third reply message is used to indicate the operation information of each shared library in the fourth shared library list.
- the system provides the application market with a query interface for the running information of the shared library, so that the application market can implement information interaction with the system through the query interface, and then obtain the running information of the shared library from the system.
- the full shared library includes the first version of the first shared library and the Ath version of the first shared library, the Ath version of the first shared library being the highest version of the first shared library, and the device also includes: a pointing module, used to point the shared library version on which the first application depends to the Ath version of the first shared library when the first version of the first shared library is uninstalled.
- Uninstalling the first version of the first shared library includes: deleting path information of the first version of the first shared library.
- the pointing module points the shared library version on which the first application depends to the Ath version of the first shared library, which can be understood as the pointing module modifying the dependency of the first application, that is, changing the dependency of the first application from the first version depending on the first shared library to the Ath version depending on the first shared library.
- the shared library version used by an application when the shared library version used by an application is uninstalled, the shared library version used by the application automatically points to a higher version of the shared library. In this way, when the application is started, the higher version of the shared library is automatically enabled, and the application will not run abnormally due to the uninstallation of the shared library version, thereby improving the user experience.
- the acquisition module is also used to: in response to a user's operation of installing or updating the first application, obtain a first shared library list that the first application depends on, the first shared library list including M shared libraries, M being a positive integer greater than or equal to 1; the determination module is also used to: determine a second shared library list based on the installation status of the M shared libraries, the second shared library list including uninstalled shared libraries among the M shared libraries; the installation module is also used to: install the shared libraries in the second shared library list, and install or update the first application.
- the shared library and the third-party application can be installed together, so that the application can always have the shared library it depends on, which can reduce the occurrence of application operation failures and improve the user experience.
- the transceiver module is further used to: send a fourth query message to the system, the fourth query message A query message is used to query the installation status of the M shared libraries; and a fourth reply message is received, where the fourth reply message is used to indicate the installation status of the M shared libraries.
- the system provides a query interface for the installation information of the shared library to the application market, so that the application market can implement information interaction with the system through the query interface, and then obtain the installation information of the shared library from the system.
- the installation module is specifically configured to: install each shared library in the second shared library list in different paths respectively.
- the system when the system installs different versions of shared libraries, it will install different versions of shared libraries in different version paths according to the version numbers.
- different versions of shared libraries can be relatively independent of each other, different versions of the same shared library can be treated as different applications, and operations such as updating or uninstalling a specific version of the shared library can be implemented.
- a device for managing shared libraries comprising: a determination module, used to determine a third shared library list, the third shared library list including shared libraries in the full shared library that are not dependent on applications, and/or the third shared library list including lower version shared libraries in the full shared library, the full shared library including all shared libraries currently installed in the system; an uninstallation module, used to uninstall shared libraries in the third shared library list, the shared libraries in the third shared library list are all in a currently non-running state.
- each shared library in the full shared library has its own version identifier.
- the shared library has an independent uninstall capability, which lowers the development threshold for shared library providers and makes the shared library easier to manage and popularize; it can timely uninstall shared libraries that are not relied on by applications in the system and low-version shared libraries, which can reduce the storage space occupied in the system and thereby improve the user experience.
- the device also includes an acquisition module, which is used to obtain information about the full shared library, the information about the full shared library includes version information of each shared library in the full shared library, and/or the information about the full shared library includes dependency information of each shared library in the full shared library, the dependency information is used to characterize whether the shared library is dependent on the application, or the dependency information is used to characterize which applications depend on the shared library; a fourth shared library list is determined based on the information about the full shared library, the fourth shared library list includes shared libraries in the full shared library that are not dependent on the application, and/or the fourth shared library list includes low-version shared libraries in the full shared library; the acquisition module is also used to obtain running information of each shared library in the fourth shared library list, the running information is used to characterize whether the shared library is currently in a running state; the determination module is specifically used to: determine the third shared library list based on the running information, the third shared library list includes shared libraries in the fourth shared library list that are not currently running.
- the acquisition module acquires the information of the full shared library at a first time
- the first time may be a periodic time, for example: it may be 22:00 every night, or 2:00 every morning, or every 30 hours, or any other periodic time; the first time may also be a time triggered by a user operation, or a time automatically determined by the system according to the current storage or operation status of the device, and the present application does not limit this.
- the application market can obtain version information and operation information of all shared libraries from the system, and then determine a list of shared libraries that need to be uninstalled, so as to facilitate subsequent uninstallation of the shared libraries in the shared library list.
- the device also includes a transceiver module, which is used to send a second query message to the system, and the second query message is used to query the information of the full shared library; and is also used to receive a second reply message, and the second reply message includes the information of the full shared library.
- the system provides a query interface for the full shared library information to the application market, so that the application market can implement information interaction with the system through the query interface, and then obtain the full shared library information from the system.
- the transceiver module is also used to: send a third query message to the system, the third query message is used for the operation information of each shared library in the fourth shared library list; receive a third reply message, the third reply message is used to indicate the operation information of each shared library in the fourth shared library list.
- the system provides the application market with a query interface for the running information of the shared library, so that the application market can implement information interaction with the system through the query interface, and then obtain the running information of the shared library from the system.
- the full shared library includes the first version of the first shared library and the Ath version of the first shared library, and the Ath version of the first shared library is the highest version of the first shared library.
- the device also includes: a pointing module, which is used to point the shared library version on which the first application depends to the Ath version of the first shared library when uninstalling the first version of the first shared library, and the first shared library is the shared library on which the first application depends.
- Uninstalling the first version of the first shared library includes: deleting path information of the first version of the first shared library.
- the pointing module points the shared library version that the first application depends on to the Ath version of the first shared library, which can be understood as the pointing module modifying the dependency of the first application, that is, changing the dependency of the first application from the first version of the first shared library to the Ath version of the first shared library. Version A of a shared library.
- the shared library version used by an application when the shared library version used by an application is uninstalled, the shared library version used by the application automatically points to a higher version of the shared library. In this way, when the application is started, the higher version of the shared library is automatically enabled, and the application will not run abnormally due to the uninstallation of the shared library version, thereby improving the user experience.
- the acquisition module is also used to: in response to a user's operation of installing or updating the first application, obtain a first shared library list that the first application depends on, the first shared library list including M shared libraries, M being a positive integer greater than or equal to 1; the determination module is also used to: determine a second shared library list based on the installation status of the M shared libraries, the second shared library list including uninstalled shared libraries among the M shared libraries; the device also includes an installation module for installing the shared libraries in the second shared library list, and installing or updating the first application.
- the shared library and the third-party application can be installed together, so that the application can always have the shared library it depends on, which can reduce the occurrence of application operation failures and improve the user experience.
- the transceiver module is also used to: send a fourth query message to the system, the fourth query message is used to query the installation status of the M shared libraries; receive a fourth reply message, the fourth reply message is used to indicate the installation status of the M shared libraries.
- the system provides a query interface for the installation information of the shared library to the application market, so that the application market can implement information interaction with the system through the query interface, and then obtain the installation information of the shared library from the system.
- the installation module is specifically used to: install each shared library in the second shared library list in different paths respectively.
- the system when the system installs different versions of shared libraries, it will install different versions of shared libraries in different version paths according to the version numbers.
- different versions of shared libraries can be relatively independent of each other, different versions of the same shared library can be treated as different applications, and operations such as updating or uninstalling a specific version of the shared library can be implemented.
- an electronic device comprising a memory and a processor, wherein the memory is used to store computer program code, and the processor is used to execute the computer program code stored in the memory to implement the method in the above-mentioned first aspect or any possible implementation of the first aspect, or to implement the above-mentioned second aspect or any possible implementation of the second aspect.
- a computer-readable storage medium in which a computer program or instruction is stored.
- the computer program or instruction is executed, the method in the first aspect or any possible implementation of the first aspect is implemented, or the method in the second aspect or any possible implementation of the second aspect is implemented.
- a chip in which instructions are stored.
- the chip executes the method in the first aspect or any possible implementation of the first aspect, or executes the method in the second aspect or any possible implementation of the second aspect.
- a computer program product which includes a computer program code.
- the computer program code runs on a computer, it implements the method in the first aspect or any possible implementation of the first aspect, or implements the method in the second aspect or any possible implementation of the second aspect.
- FIG1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
- FIG2 is a software structure block diagram of an electronic device provided in an embodiment of the present application.
- FIG3 is a schematic flow chart of a method for managing a shared library provided in an embodiment of the present application.
- FIG4 is a schematic flow chart of another method for managing a shared library provided in an embodiment of the present application.
- FIG5 is a schematic flow chart of a method for synchronously installing a shared library and an application provided in an embodiment of the present application
- FIG. 6 is a schematic flow chart of a method for installing a multi-version shared library provided in an embodiment of the present application
- FIG7 is a schematic flow chart of a method for updating a shared library provided in an embodiment of the present application.
- FIG8 is a schematic flow chart of a method for uninstalling a shared library provided in an embodiment of the present application.
- FIG9 is a schematic flow chart of another method for uninstalling a shared library provided in an embodiment of the present application.
- FIG10 is a schematic flow chart of another method for updating a shared library provided in an embodiment of the present application.
- FIG11 is a schematic flow chart of a method for updating and uninstalling a shared library provided in an embodiment of the present application
- FIG. 12 is a schematic diagram of functional modules of a device for synchronously installing an application and a shared library provided in an embodiment of the present application;
- FIG. 13 is a schematic diagram of functional modules of a device for updating a shared library provided in an embodiment of the present application.
- FIG. 14 is a schematic diagram of functional modules of a device for unloading a shared library provided in an embodiment of the present application.
- first and second are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features.
- a feature defined as “first” or “second” may explicitly or implicitly include one or more of the features.
- plural means two or more.
- a and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural.
- the character "/” generally indicates that the objects associated before and after are in an "or” relationship.
- references to "one embodiment” or “some embodiments” etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application.
- the phrases “one embodiment”, “some embodiments”, “another embodiment”, “some other embodiments”, etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean “one or more but not all embodiments", unless otherwise specifically emphasized.
- the terms “including”, “comprising”, “having” and their variations all mean “including but not limited to”, unless otherwise specifically emphasized.
- the method provided in the embodiments of the present application can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR)/virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc.
- electronic devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR)/virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc.
- the embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
- a shared library is a library of shared functions that applications can link to at runtime, rather than at compile time.
- shared libraries are called dynamic link libraries; in Mac OS X, they are called frameworks; in Linux, they are called shared objects.
- FIG1 shows a schematic diagram of the structure of an electronic device 100.
- the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
- 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 light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
- the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100.
- the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently.
- the components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
- the processor 110 may include one or more processing units.
- the processor 110 may include an application processor.
- processor AP
- modem processor graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and/or neural-network processing unit (NPU), etc.
- AP application processor
- GPU graphics processing unit
- ISP image signal processor
- DSP digital signal processor
- NPU neural-network processing unit
- different processing units can 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 may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
- the processor 110 may also be provided with a memory for storing instructions and data.
- the memory in the processor 110 is a cache memory.
- the memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
- the processor 110 may include one or more interfaces.
- the interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (SIM) interface, and/or a universal serial bus (USB) interface, etc.
- I2C inter-integrated circuit
- I2S inter-integrated circuit sound
- PCM pulse code modulation
- UART universal asynchronous receiver/transmitter
- 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, including a serial data line (SDA) and a serial clock line (SCL).
- the processor 110 may include multiple groups of I2C buses.
- the processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces.
- the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.
- the I2S interface can be used for audio communication.
- the processor 110 can include multiple I2S buses.
- the processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170.
- the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
- the PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals.
- the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface.
- the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
- the UART interface is a universal serial data bus for asynchronous communication.
- the bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
- 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 implement the Bluetooth function.
- the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
- the MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193.
- the MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc.
- the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100.
- the processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.
- the GPIO interface can be configured by 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 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc.
- the GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
- the USB interface 130 is an interface that complies with the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.
- the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones.
- the interface can also be used to connect other electronic devices, such as AR devices, etc.
- the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100.
- the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
- the charging management module 140 is used to receive charging input from a charger.
- the charger can be a wireless charger or a wired charger.
- the charging management module 140 can receive charging input from a wired charger through the USB interface 130.
- the charging management module 140 can receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it can also power 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 charging 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 number, battery health status (leakage, impedance), etc.
- the power management module 141 can also be set in the processor 110.
- the power management module 141 and the charging management module 140 can also be set in the same device.
- the wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
- Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
- Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas.
- antenna 1 can be reused as a diversity antenna for a wireless local area network.
- the antenna can be used in combination with a tuning switch.
- the mobile communication module 150 can provide solutions for wireless communications including 2G/3G/4G/5G, etc., applied to the electronic device 100.
- the mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.
- the mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
- the mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1.
- at least some of the functional modules of the mobile communication module 150 can be set in the processor 110.
- at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
- 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-high frequency signal.
- the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal.
- the demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
- the application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194.
- the modem processor may be an independent device.
- the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
- the wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) and the like applied to the electronic device 100.
- WLAN wireless local area networks
- BT wireless fidelity
- GNSS global navigation satellite system
- FM frequency modulation
- NFC near field communication
- IR infrared
- the wireless communication module 160 can be one or more devices integrating at least one communication processing module.
- the wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering processing, and sends the processed signal to the processor 110.
- the wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of the signal, amplify the signal, and convert it into electromagnetic waves for radiation through the antenna 2.
- the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
- the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technology.
- the GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and/or a satellite based augmentation system (SBAS).
- GPS global positioning system
- GLONASS global navigation satellite system
- BDS Beidou navigation satellite system
- QZSS quasi-zenith satellite system
- SBAS satellite based augmentation system
- the electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor.
- the GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor.
- the GPU is used to perform mathematical and geometric calculations for graphics rendering.
- the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
- the display screen 194 is used to display images, videos, etc.
- the display screen 194 includes a display panel.
- the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode (OLED), or a display panel.
- the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
- the electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
- ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
- the camera 193 is used to capture still images or videos.
- the object generates an optical image through the lens and projects it onto the photosensitive element.
- the photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor.
- CMOS complementary metal oxide semiconductor
- the photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal.
- the ISP outputs the digital image signal to the DSP for processing.
- the DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format.
- the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
- the digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
- Video codecs are used to compress or decompress digital videos.
- the electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
- MPEG Moving Picture Experts Group
- MPEG2 MPEG2, MPEG3, MPEG4, etc.
- NPU is a neural network (NN) computing processor.
- NN neural network
- applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
- the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
- the external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.
- the internal memory 121 can be used to store computer executable program codes, which include instructions.
- the processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121.
- the internal memory 121 may include a program storage area and a data storage area.
- the program storage area can store an operating system, an App required for at least one function (such as a sound playback function, an image playback function, etc.), etc.
- the data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc.
- the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
- UFS universal flash storage
- the electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
- the audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals.
- the audio module 170 can also be used to encode and decode audio signals.
- the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
- the speaker 170A also called a "speaker" is used to convert an audio electrical signal into a sound signal.
- the electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
- the receiver 170B also called a "earpiece" is used to convert audio electrical signals into sound signals.
- the voice can be received by placing the receiver 170B close to the human ear.
- Microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C.
- the electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.
- the earphone interface 170D is used to connect a wired earphone.
- the earphone interface 170D may be the USB interface 130, or may be a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
- OMTP open mobile terminal platform
- CTIA cellular telecommunications industry association of the USA
- 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 can be set on the display screen 194.
- the capacitive pressure sensor can be a parallel plate including at least two conductive materials.
- the electronic device 100 determines the intensity of the pressure according to the change in capacitance.
- the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A.
- the electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A.
- touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
- the gyro sensor 180B can be used to determine the motion posture of the electronic device 100.
- the angular velocity of the electronic device 100 around three axes i.e., x, y, and z axes
- the gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake.
- the gyro sensor 180B can also be used for navigation and somatosensory game scenes.
- the air pressure sensor 180C is used to measure air pressure.
- the electronic device 100 calculates the altitude through 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 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case.
- the electronic device 100 when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.
- the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
- the distance sensor 180F is used to measure the distance.
- the electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
- the proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode.
- the light emitting diode may be an infrared light emitting diode.
- the electronic device 100 emits infrared light outward through the light emitting diode.
- the electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100.
- the electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power.
- the proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.
- the ambient light sensor 180L is used to sense the ambient light brightness.
- the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
- the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
- the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
- the fingerprint sensor 180H is used to collect fingerprints.
- the electronic device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
- 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, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
- the touch sensor 180K is also called a "touch panel”.
- the touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, 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.
- Visual output related to the touch operation can be provided through the display screen 194.
- the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
- the bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone.
- the audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function.
- the application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.
- the key 190 includes a power key, a volume key, etc.
- the key 190 may be a mechanical key or a touch key.
- the electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
- Motor 191 can generate vibration prompts.
- Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
- touch operations acting on different applications can correspond to different vibration feedback effects.
- touch operations acting on different areas of the display screen 194 can also correspond to different vibration feedback effects.
- Different application scenarios for example: time reminders, receiving messages, alarm clocks, games, etc.
- the touch vibration feedback effect can also support customization.
- Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
- the SIM card interface 195 is used to connect a SIM card.
- the SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195.
- the electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
- the SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different.
- the SIM card interface 195 can also be compatible with different types of SIM cards.
- the SIM card interface 195 can also be compatible with external memory cards.
- the electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications.
- the electronic device 100 uses an embedded SIM (eSIM) card, i.e., an embedded SIM card.
- the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
- phone cards in the embodiments of the present application include but are not limited to SIM cards, eSIM cards, universal subscriber identity modules (USIM), universal integrated circuit cards (UICC), and the like.
- the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture.
- the embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.
- FIG2 is a software structure diagram of the electronic device 100 of an embodiment of the present application.
- the layered architecture divides the software into several layers, each layer has a clear role and division of labor.
- the layers communicate with each other through software interfaces.
- the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer.
- the application layer can include a series of application packages.
- the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
- the application framework layer provides application programming interface (API) and programming framework for the applications in the application layer.
- API application programming interface
- the application framework layer includes some predefined functions.
- the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
- the window manager is used to manage window programs.
- the window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
- Content providers are used to store and retrieve data and make it accessible to applications.
- the data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
- the view system includes visual controls, such as controls for displaying text, controls for displaying images, etc.
- the view system can be used to build applications.
- a display interface can be composed of one or more views.
- a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
- the phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).
- the resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
- the notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc.
- the notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
- Android Runtime includes core libraries and virtual machines. Android Runtime is responsible for scheduling and management of the Android system.
- the core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
- 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, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
- functional modules such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
- the surface manager is used to manage the display subsystem and provide the fusion 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 static image files, etc.
- the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
- the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
- a 2D graphics engine is a drawing engine for 2D drawings.
- 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 electronic device in the embodiments of the present application may be a television, a desktop computer, a laptop computer, or a portable electronic device such as a mobile phone, a tablet computer, a camera, a camcorder, a video recorder, or other electronic devices with storage functions, electronic devices in a 5G network, or electronic devices in a future evolving public land mobile communication network (public land mobile network, PLMN), etc., and the present application does not limit this.
- a portable electronic device such as a mobile phone, a tablet computer, a camera, a camcorder, a video recorder, or other electronic devices with storage functions, electronic devices in a 5G network, or electronic devices in a future evolving public land mobile communication network (public land mobile network, PLMN), etc.
- third-party application developers often use third-party code, such as shared libraries, in the development process in order to improve efficiency and reduce costs.
- third-party code such as shared libraries
- shared library providers can provide the code capabilities of their own applications to third-party applications through dynamic loading, so that third-party applications do not need to integrate related content (including code, resources, etc.) in their own installation packages, thereby achieving the purpose of reducing the integration cost of third-party applications.
- the shared library in the device is different from the overall process of the application.
- the shared library does not have the mechanism of application installation, and the shared library cannot be updated.
- the shared library version 1.0 the shared library cannot solve the problem by updating the 1.1 version like the application. Instead, all applications that rely on the shared library need to be updated and re-updated to the update shelf to solve the problem, which will increase the integration cost of the application.
- multiple low-version shared libraries are subsets of the highest-version shared library. Only the highest-version shared library is required to meet the application requirements.
- the embodiments of the present application provide a method, device and electronic device for managing shared libraries.
- the method can realize the application of shared libraries through collaboration between subjects such as mobile phone systems, application markets and cloud, so that shared libraries have the ability to be independently developed, distributed, installed, updated or uninstalled, which reduces the development threshold of shared library providers and makes shared libraries easy to manage and popularize; moreover, multiple versions of shared libraries can exist in the system, and the highest version of the shared library is automatically enabled when the application is started, so that the update of the shared library can be reflected in real time, reducing the integration cost and update frequency of application developers when using shared libraries; in addition, the method can realize the joint installation of shared libraries and third-party applications through the collaboration between the system framework and the application market, and can also uninstall shared libraries that are not relied on by applications and low-version shared libraries at specific times, thereby improving user experience and reducing storage space occupied in the system.
- Fig. 3 shows a schematic flow chart of a method 300 for managing a shared library provided in an embodiment of the present application. As shown in Fig. 3, the method 300 includes:
- version A is the highest version of the first shared library.
- the Ath version of the first shared library is obtained, which may be to obtain the shared library path of the Ath version of the first shared library, so that the first application uses the Ath version of the first shared library according to the shared library path of the Ath version of the first shared library. Version A.
- step S301 and step S302 are executed on the application market side; step S303 and step S304 are executed on the system side.
- determining whether version A of the first shared library is installed in the system includes: the application market obtains information about the highest version of the first shared library currently installed by querying the system; the application market determines whether the highest version is version A based on the information about the highest version of the first shared library; if not, the application market determines that version A of the first shared library is not installed in the system.
- determining whether version A of the first shared library is installed in the system includes: the application market sends an inquiry message to the system, the inquiry message is used to inquire whether the system has installed version A of the first shared library, the application market receives a reply message to the inquiry message, if the reply message is no, the application market determines that version A of the first shared library is not installed in the system.
- Fig. 4 shows a schematic flow chart of another method 400 for managing a shared library provided in an embodiment of the present application.
- the method 400 includes:
- the third shared library list includes shared libraries in the full shared library that are not relied upon by the application, and/or the third shared library list includes lower-version shared libraries in the full shared library, and the full shared library includes all shared libraries currently installed in the system.
- determining the third shared library list includes: obtaining information of the full shared library, the information of the full shared library including version information of each shared library in the full shared library, and/or including dependency information of each shared library in the full shared library.
- the dependency information is used to indicate whether the shared library is dependent on the application, or the dependency information is used to indicate which applications depend on the shared library.
- the information of the full shared library is obtained at a first time
- the first time may be a periodic time, for example: it may be 22:00 every night, or 2:00 every morning, or every 30 hours, or any other periodic time; the first time may also be a time triggered by a user operation, or a time automatically determined by the system according to the current storage or operation status of the device, and the present application does not limit this.
- all shared libraries in the third shared library list are currently not running.
- the step of determining the third shared library list may be:
- Acquire information of a full shared library where the information of the full shared library includes version information of each shared library in the full shared library and/or dependency information of each shared library in the full shared library.
- the fourth shared library list includes shared libraries in the full shared library that are not depended on by applications, and/or the third shared library list includes lower-version shared libraries in the full shared library, and the current running status of the shared libraries in the fourth shared library list is unknown.
- each shared library in the full shared library has its own version identifier.
- FIG5 shows a schematic flow chart of a method 500 for synchronously installing a shared library and an application provided in an embodiment of the present application.
- the method 500 includes:
- S501 In response to a user's operation of installing/updating a first application, the application market downloads an installation package of the first application and obtains a first shared library list on which the first application depends.
- the application market downloads the installation package of the first application from the cloud and parses a configuration file in the installation package of the first application to obtain a first shared library list on which the first application depends.
- the first shared library list that the first application depends on includes one or more shared libraries that the first application depends on, and the one or more shared libraries carry version information. That is to say, the first shared library list may include one or more different shared libraries, and may also include one or more versions of the same shared library with different versions.
- the first shared library list includes a first version of the first shared library, a second version of the first shared library, a third version of the first shared library, a first version of the second shared library, a first version of the third shared library, and a second version of the third shared library.
- S502 The application market sends a fourth query message to the package management, where the fourth query message is used to query the installation status of the shared libraries in the first shared library list.
- the application market queries the installation directory of the shared libraries in the first shared library list by calling the package management query interface in the system framework. Installation situation.
- the installation status of the shared libraries in the first shared library list may refer to the installation status of each shared library in the first shared library list (for example, whether it is installed in the system/whether it exists in the system).
- S503 Receive a fourth reply message sent by the package management, where the fourth reply message is used to indicate the installation status of the shared libraries in the first shared library list.
- S504 The application market determines a second shared library list according to the fourth reply message.
- the second shared library list includes the uninstalled shared libraries in the first shared library list, and/or the second shared library list includes the higher version shared libraries corresponding to the installed shared libraries in the first shared library list.
- the process of the application market determining the second shared library list according to the fourth reply message may be:
- S506 Install the shared libraries in the second shared library list, and install or update the first application.
- the shared library and the third-party application can be installed together, so that the application always has the shared library it depends on, which can reduce the occurrence of application operation failures and improve the user experience.
- FIG6 shows a schematic flow chart of a method 600 for installing a multi-version shared library provided in an embodiment of the present application.
- the method 600 includes:
- S601 When there is a first version of a first shared library and a second version of the first shared library to be installed, install the first version of the first shared library in a first path and generate first shared library information; install the second version of the first shared library in a second path and generate second shared library information.
- the first shared library information includes identification information of the first shared library and version information of the first shared library; the second shared library information includes identification information of the second shared library and version information of the second shared library.
- the permissions required by the shared library are applied for by the applications that depend on it, and the shared library itself cannot apply for permissions, and the shared library itself does not have a data directory.
- the system when the system installs different versions of shared libraries, it will install different versions of shared libraries in different version paths according to the version number, and generate multiple shared library information in the system according to the version.
- different versions of shared libraries can be relatively independent, different versions of the same shared library can be treated as different applications, and operations such as updating or uninstalling a specific version of the shared library can be implemented.
- Fig. 7 shows a schematic flow chart of a method 700 for updating a shared library provided in an embodiment of the present application.
- the method 700 includes:
- the information of the first shared library includes information of one or more versions of the first shared library that are currently installed (already existing).
- the one or more versions of the first shared library may include a first version of the first shared library, a second version of the first shared library, a third version of the first shared library, a first version of the second shared library, a first version of the third shared library, and a second version of the third shared library.
- S702 The application market receives a first reply message sent by the system, where the first reply message is used to indicate information of the first shared library.
- S703 The application market determines whether the first shared library needs to be updated according to the first reply message.
- the application market determines whether the new version of the first shared library exists in the information of the first shared library based on the first reply message. In other words, the application market determines whether the new version of the first shared library has been installed (i.e., whether it already exists) based on the first reply message. If so, it is determined that the first shared library does not need to be updated; if not, the first shared library needs to be updated.
- the application market detects that the third version of the first shared library is released. After obtaining the information of the first shared library, the application market determines whether the information of the third version of the first shared library exists in the information of the first shared library. If not, it determines that the first shared library needs to be updated.
- the application market detects that the third version of the first shared library is released, and when it is determined that the first shared library needs to be updated, the third version of the first shared library is downloaded.
- the system installs a new version of the first shared library at a specific time.
- the specific timing may be, for example, when an application that depends on the first shared library is not running.
- the application market detects that the third version of the first shared library is released, and when it is determined that the first shared library needs to be updated, the third version of the first shared library is downloaded and installed.
- Obtaining the highest version of the first shared library may be obtaining a shared library path of the highest version of the first shared library.
- the third version of the first shared library is the highest version of the first shared library. Then, when the application that depends on the first shared library is started, the third version of the first shared library is enabled.
- the current system is compatible with multiple versions of shared libraries. For example, after a first shared library is updated, when an application that depends on the first shared library is started, the shared library path of the highest version of the first shared library is obtained.
- the current system is not compatible with multiple versions of shared libraries. For example, after a first shared library is updated, when an application that depends on the first shared library is started, the path of the shared library configured by the system is obtained.
- the update of multiple versions of shared libraries is achieved through the collaboration between the mobile phone system and the application market, so that the shared libraries have independent update capabilities, lowering the development threshold for shared library providers, making shared libraries easier to manage and popularize; and, the system can automatically enable the highest version of the shared library it depends on when the application is started, so that the update of the shared library can be reflected in real time, thereby reducing the integration cost and update frequency of application developers when using shared libraries.
- Fig. 8 shows a schematic flow chart of a method 800 for uninstalling a shared library provided in an embodiment of the present application. As shown in Fig. 8, the method 800 includes:
- S801 The application market sends a second query message to the system at a first opportunity, where the second query message is used to query information of a full shared library in a device.
- the application market calls a system interface to query information of the full shared library in the device.
- the full shared library includes one or more shared libraries installed (already existing) in the current system, and the one or more shared libraries carry version information.
- the information of the full shared library includes version information of each shared library in the full shared library, and/or includes dependency information of each shared library in the full shared library.
- the dependency information is used to indicate whether the shared library is dependent on the application, or the dependency information is used to indicate which applications depend on the shared library.
- the one or more shared libraries may include a first version of a first shared library, a second version of the first shared library, a third version of the first shared library, a first version of the second shared library, a first version of the third shared library, and a second version of the third shared library.
- S802 The application market receives a second reply message sent by the system, where the second reply message is used to indicate information about the full shared library.
- the fourth shared library list includes shared libraries in the full shared library that are not relied upon by the application, and/or the third shared library list includes low-version shared libraries in the full shared library, and the current running status of the shared libraries in the fourth shared library list is unknown.
- the application market sends a third query message to the system, the third query message is used to query the running information of each shared library in the fourth shared library list, the running information is used to indicate whether the shared library is currently in a running state.
- the application market calls the system interface to query the running information of each shared library in the fourth shared library list according to the information of all shared libraries.
- the information of the full shared library includes information of multiple shared libraries, which may, for example, include a first version of a first shared library, a second version of the first shared library, a third version of the first shared library, a first version of the second shared library, a first version of the third shared library, and a second version of the third shared library.
- S805 The application market receives a third reply message sent by the system, where the third reply message is used to indicate the running information of each shared library in the fourth shared library list.
- S806 The application market determines a third shared library list according to the third reply message, where the third shared library list includes the currently non-running shared libraries in the fourth shared library list.
- the application market determines the fourth shared library list and the operation information of each shared library in the fourth shared library list. 3. List of shared libraries.
- the third shared library list includes shared libraries in the full shared libraries that are not dependent on the application and/or includes low-version shared libraries in multiple versions of shared libraries that are dependent on the application, wherein the low-version shared libraries are non-highest version shared libraries, and the shared libraries in the third shared library list are all in the currently non-running state.
- the shared library has an independent uninstall capability, which lowers the development threshold of the shared library provider and makes the shared library easy to manage and popularize; it is also possible to uninstall shared libraries that are not relied on by the application and low-version shared libraries at specific times, which improves the user experience and reduces the storage space occupied in the system; and in terms of the uninstall (aging) mechanism, it is specifically divided into two cases: compatible with multi-version shared libraries and incompatible with multi-version shared libraries. For the case of compatible with multi-version shared libraries, the low-version shared libraries can be aged; for the case of incompatible with multi-version shared libraries, unused or infrequently used shared libraries can be aged, making the scope of application of the solution wider.
- FIG9 shows a schematic flow chart of another method 900 for uninstalling a shared library provided in an embodiment of the present application.
- the method 900 includes:
- the first shared library after being updated, includes a first version of the first shared library and an Ath version of the first shared library, and the Ath version is the highest version of the first shared library.
- different versions of the same shared library are treated as different applications.
- a target version of a shared library is uninstalled, only the target version of the shared library is uninstalled, and other versions of the shared library are still retained, thereby enabling multiple versions of the shared library to have independent uninstall capabilities.
- a first shared library that the first application depends on is also depended on by other applications. If not, the first shared library is uninstalled at the same time.
- Fig. 10 shows a schematic flow chart of another method 1000 for managing a shared library provided in an embodiment of the present application.
- the method 1000 includes:
- the shared library currently relied on by the first application is the first version of the first shared library.
- the first shared library After being updated, the first shared library includes the first version of the first shared library and the Ath version of the first shared library, and the Ath version is the highest version of the first shared library.
- the shared library version that the application depends on when the shared library version that the application depends on is uninstalled, the shared library version that the application depends on automatically points to the highest version of the shared library. In this way, when the application is started, the path of the shared library with the highest version is automatically obtained, and the application will not run abnormally due to the uninstallation of the shared library version, which can improve the user experience.
- FIG11 shows a schematic flow chart of a method 100 for updating and uninstalling a shared library provided in an embodiment of the present application.
- the method 1100 includes:
- S1101 A shared library provider (or a shared library user) develops, distributes, and installs a shared library as a special type of application.
- S1102 The shared library provider exports the interface package (har module) and execution package from the shared library module (library module).
- S1103 Upload the interface package (har module) and execution package to the application market to ensure backward compatibility of the shared library version.
- S1104 The shared library user completes its own application development through the application market integration interface package.
- step S1106 When the user triggers the installation operation of the application, execute step S1107.
- step S1110 When the user triggers the start of the application, step S1111 is further executed.
- the operation management module obtains information related to the application from the package management.
- the operation management module passes startup parameters to the application incubation module (AppSpawn).
- S1113 The application incubation module searches for the shared library path from the shared library module (library module).
- the application incubation module obtains the highest version of the shared library path that the application depends on and enters the application process.
- FIG. 12 shows a functional module diagram of a device 1200 for synchronously installing an application and a shared library provided in an embodiment of the present application.
- the device 1200 includes:
- the first acquisition module 1210 is used to download the installation package of the first application in response to the user's operation of installing/updating the first application, and to acquire a first shared library list on which the first application depends.
- the first acquisition module 1210 downloads the installation package of the first application from the cloud and parses a configuration file in the installation package of the first application to obtain a first shared library list on which the first application depends.
- the first shared library list that the first application depends on includes one or more shared libraries that the first application depends on, and the one or more shared libraries carry version information. That is to say, the first shared library list may include one or more different shared libraries, and may also include one or more versions of the same shared library with different versions.
- the first shared library list includes a first version of the first shared library, a second version of the first shared library, a third version of the first shared library, a first version of the second shared library, a first version of the third shared library, and a second version of the third shared library.
- the first transceiver module 1220 is used to send a fourth query message to the package management module, where the fourth query message is used to query the installation status of the shared libraries in the first shared library list.
- the application market queries the installation status of the shared libraries in the first shared library list by calling a package management query interface in the system framework.
- the installation status of the shared libraries in the first shared library list may refer to the installation status of each shared library in the first shared library list (for example, whether it is installed in the system/whether it exists in the system).
- the first transceiver module 1220 is further used to receive a fourth reply message sent by the package management module, where the fourth reply message is used to indicate the installation status of the shared libraries in the first shared library list.
- the first determining module 1230 is configured to determine a second shared library list according to the fourth reply message.
- the second shared library list includes the uninstalled shared libraries in the first shared library list, and/or the second shared library list includes the higher version shared libraries corresponding to the installed shared libraries in the first shared library list.
- the process of the first determining module 1230 determining the second shared library list according to the fourth reply message may be:
- the first determination module 1230 lists the shared libraries that are not installed (or do not exist in the system) in the second shared library list;
- the first determination module 1230 includes the version of the shared library in the first shared library list or a higher version of the shared library in the first shared library list in the second shared library list.
- the first acquisition module 1210 is further configured to download the shared libraries in the second shared library list.
- the first installation module 1240 is used to install the shared libraries in the second shared library list, and install or update the first application.
- the shared library and the third-party application can be installed together, so that the application always has the shared library it depends on, which can reduce the occurrence of application operation failures and improve the user experience.
- Fig. 13 shows a functional module diagram of a device 1300 for updating a shared library provided in an embodiment of the present application.
- the device 1300 includes:
- the second transceiver module 1310 is used to send a first query message to the system when detecting that a new version of the first shared library is released, where the first query message is used to query information of the first shared library.
- the information of the first shared library includes information of one or more versions of the first shared library that are currently installed (already existing).
- the one or more versions of the first shared library may include a first version of the first shared library, a second version of the first shared library, a third version of the first shared library, a first version of the second shared library, a first version of the third shared library, and a second version of the third shared library.
- the second transceiver module 1310 is further used to receive a first reply message sent by the system, where the first reply message is used to indicate information of the first shared library.
- the second determination module 1320 is configured to determine whether the first shared library needs to be updated according to the first reply message.
- the second determination module 1320 determines whether there is a new version of the first shared library in the information of the first shared library based on the first reply message. In other words, the second determination module 1120 determines whether the new version of the first shared library has been installed (i.e., whether it already exists) based on the first reply message. If so, it is determined that the first shared library does not need to be updated; if not, the first shared library needs to be updated.
- the second determination module 1320 determines whether the information of the first shared library contains the information of the third version of the first shared library. If not, the second determination module 1320 determines whether the information of the first shared library contains the information of the third version of the first shared library. The second determination module 1320 determines that the first shared library needs to be updated.
- the second acquisition module 1330 is configured to download a new version of the first shared library when it is determined that the first shared library needs to be updated.
- the second acquisition module (or downloading module) 1330 downloads the third version of the first shared library.
- the second installation module 1340 is used to install the new version of the first shared library.
- the second installation module 1340 installs the new version of the first shared library at a specific time.
- the specific timing may be, for example, when an application that depends on the first shared library is not running.
- the second acquisition module 1330 is further configured to acquire the highest version of the first shared library when the application that depends on the first shared library is started.
- Obtaining the highest version of the first shared library may be obtaining a shared library path of the highest version of the first shared library.
- the third version of the first shared library is the highest version of the first shared library. Then, when the application that depends on the first shared library is started, the third version of the first shared library is enabled.
- the update of multiple versions of shared libraries is achieved through the collaboration between the mobile phone system and the application market, so that the shared libraries have independent update capabilities, lowering the development threshold for shared library providers, making shared libraries easier to manage and popularize; and, the system can automatically enable the highest version of the shared library it depends on when the application is started, so that the update of the shared library can be reflected in real time, thereby reducing the integration cost and update frequency of application developers when using shared libraries.
- Fig. 14 shows a functional module diagram of a device 1400 for uninstalling a shared library provided in an embodiment of the present application.
- the device 1400 includes:
- the third transceiver module 1410 is used to send a second query message to the system at a first opportunity, where the second query message is used to query information of the full shared library in the device.
- the third transceiver module 1410 calls a system interface to obtain information of a full shared library in the device.
- the full shared library refers to one or more shared libraries that are currently installed (already exist), and the one or more shared libraries carry version information.
- the information of the full shared library includes version information of each shared library in the full shared library, and/or includes dependency information of each shared library in the full shared library.
- the dependency information is used to indicate whether the shared library is dependent on the application, or the dependency information is used to indicate which applications depend on the shared library.
- the one or more shared libraries may include a first version of a first shared library, a second version of the first shared library, a third version of the first shared library, a first version of the second shared library, a first version of the third shared library, and a second version of the third shared library.
- the third transceiver module 1410 is further used to receive a second reply message sent by the system, where the second reply message is used to indicate information about the full shared library.
- the third determining module 1420 is configured to determine a fourth shared library list according to the second reply message.
- the fourth shared library list includes shared libraries in the full shared library that are not relied upon by the application, and/or the third shared library list includes low-version shared libraries in the full shared library, and the current running status of the shared libraries in the fourth shared library list is unknown.
- the third transceiver module 1410 is further used to send a third query message to the system, where the third query message is used to query the running information of each shared library in the fourth shared library list, where the running information is used to indicate whether the shared library is currently in a running state.
- the third transceiver module 1410 calls a system interface according to the information of all shared libraries to obtain the running information of each shared library in the fourth shared library list.
- the information of the full shared library includes information of multiple shared libraries, which may, for example, include a first version of a first shared library, a second version of the first shared library, a third version of the first shared library, a first version of the second shared library, a first version of the third shared library, and a second version of the third shared library.
- the third transceiver module 1410 is further used to receive a third reply message sent by the system, where the third reply message is used to indicate the running information of each shared library in the fourth shared library list.
- the third determining module 1420 is configured to determine a third shared library list according to the third reply message, where the third shared library list includes the currently non-running shared libraries in the fourth shared library list.
- the third determining module 1420 is configured to determine the third shared library list according to the fourth shared library list and the running information of each shared library in the fourth shared library list.
- the third shared library list includes the shared libraries in the above-mentioned full sharing that are not relied on by the application, and/or includes the lower version shared libraries in multiple versions of the shared libraries relied on by the application, wherein the lower version shared libraries are non-highest version shared libraries, and the shared libraries in the third shared library list are The shared libraries are not currently running.
- the uninstall module 1430 is used to uninstall the shared libraries in the third shared library list.
- the shared library has an independent uninstall capability, which lowers the development threshold of the shared library provider and makes the shared library easy to manage and popularize; it is also possible to uninstall shared libraries that are not relied on by the application and low-version shared libraries at specific times, which improves the user experience and reduces the storage space occupied in the system; and in terms of the uninstall (aging) mechanism, it is specifically divided into two cases: compatible with multi-version shared libraries and incompatible with multi-version shared libraries. For the case of compatible with multi-version shared libraries, the low-version shared libraries can be aged; for the case of incompatible with multi-version shared libraries, unused or infrequently used shared libraries can be aged, making the scope of application of the solution wider.
- An embodiment of the present application also provides a computer-readable medium, which stores a program code.
- the computer program code runs on a computer, the computer executes any one of the methods in Figures 3 to 11 above.
- An embodiment of the present application also provides a chip, including: at least one processor and a memory, wherein the at least one processor is coupled to the memory and is used to read and execute instructions in the memory to execute any one of the methods in Figures 3 to 11 above.
- An embodiment of the present application also provides an electronic device, comprising: at least one processor and a memory, wherein the at least one processor is coupled to the memory and is used to read and execute instructions in the memory to execute any one of the methods in Figures 3 to 11 above.
- apparatus 1200 may be used alone or in combination with each other.
- apparatus 1300 may be used alone or in combination with each other.
- apparatus 1400 may be used alone or in combination with each other.
- One or more of the modules or units described herein may be implemented in software, hardware, or a combination of the two.
- the software exists in the form of computer program instructions and is stored in a memory, and a processor may be used to execute the program instructions and implement the above method flow.
- the processor may include, but is not limited to, at least one of the following: a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a microcontroller (MCU), or an artificial intelligence processor and other types of computing devices that run software, each of which may include one or more cores for executing software instructions for calculation or processing.
- the processor may be built into an SoC (system on chip) or an application specific integrated circuit (ASIC), or it may be an independent semiconductor chip.
- SoC system on chip
- ASIC application specific integrated circuit
- it may further include necessary hardware accelerators, such as a field programmable gate array (FPGA), a PLD (programmable logic device), or a logic circuit that implements a dedicated logic operation.
- FPGA field programmable gate array
- PLD programmable logic device
- the hardware can be any one or any combination of a CPU, a microprocessor, a DSP, an MCU, an artificial intelligence processor, an ASIC, a SoC, an FPGA, a PLD, a dedicated digital circuit, a hardware accelerator, or a non-integrated discrete device, which can run the necessary software or be independent of the software to execute the above method flow.
- the modules or units described herein When the modules or units described herein are implemented using software, they can be implemented in whole or in part in the form of a computer program product.
- the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part.
- 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 from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center.
- the computer-readable storage medium may be any available medium with a configuration capability similar to a cache that a computer can access, or a server, a data center, or other data storage device that includes one or more available media integrated with a configuration capability similar to a cache.
- the disclosed systems, devices and methods can be implemented in other ways.
- the device embodiments described above are only schematic.
- the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
- Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
- the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application.
- the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, 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
本申请要求于2023年05月26日提交中国专利局、申请号为202310612762.6、申请名称为“管理共享库的方法、装置以及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed with the China Patent Office on May 26, 2023, with application number 202310612762.6 and application name “Method, device and electronic device for managing shared libraries”, the entire contents of which are incorporated by reference in this application.
本申请实施例涉及管理共享库领域,并且更具体地,涉及一种管理共享库的方法、装置以及电子设备。Embodiments of the present application relate to the field of managing shared libraries, and more specifically, to a method, device, and electronic device for managing shared libraries.
随着移动互联网市场的快速迭代,三方应用开发者为了提升效率、降低成本,往往会在开发过程中使用第三方代码,如共享库。目前共享库提供者可以通过动态加载的方式,将自身应用的代码能力提供给三方应用使用,这样三方应用不需要在自身的安装包里集成相关内容(包括代码、资源等),从而达到减少三方应用集成成本的目的。With the rapid iteration of the mobile Internet market, third-party application developers often use third-party code, such as shared libraries, in the development process in order to improve efficiency and reduce costs. Currently, shared library providers can provide the code capabilities of their own applications to third-party applications through dynamic loading, so that third-party applications do not need to integrate related content (including code, resources, etc.) in their own installation packages, thereby achieving the purpose of reducing the integration cost of third-party applications.
然而,当前的共享库无法进行自身的更新,需要依赖该共享库的所有应用进行更新并重新上架,这会导致应用的集成成本提高;并且,针对多版本共享库,没有有效的卸载机制,一些多余共享库版本存储在系统中会占用大量存储空间,导致存储空间的浪费。However, the current shared library cannot update itself, and all applications that rely on the shared library need to be updated and re-listed, which increases the cost of application integration. In addition, there is no effective uninstallation mechanism for multi-version shared libraries, and some redundant shared library versions stored in the system will take up a lot of storage space, resulting in a waste of storage space.
发明内容Summary of the invention
本申请提供一种管理共享库的方法、装置以及电子设备,通过该方法、装置和电子设备,共享库有独立的更新或卸载能力,并且系统能够在应用启动时自动加载其依赖的最高版本共享库,使得共享库的更新得到实时体现,能够降低应用开发者使用共享库的集成成本和更新频率,对多余共享库的及时卸载还能够减少存储空间的占用。The present application provides a method, device and electronic device for managing shared libraries. Through the method, device and electronic device, the shared library has independent update or uninstall capabilities, and the system can automatically load the highest version of the shared library that it depends on when the application is started, so that the update of the shared library can be reflected in real time, which can reduce the integration cost and update frequency of the shared library used by application developers. The timely uninstallation of redundant shared libraries can also reduce the storage space occupied.
第一方面,提供一种管理共享库的方法,该方法包括:当检测到第一共享库的第A版本上架时,判断系统中是否安装有该第一共享库的第A版本;当确定系统中未安装该第一共享库的第A版本时,下载该第一共享库的第A版本。In a first aspect, a method for managing shared libraries is provided, the method comprising: when it is detected that version A of a first shared library is released, determining whether version A of the first shared library is installed in the system; when it is determined that version A of the first shared library is not installed in the system, downloading version A of the first shared library.
其中,第A版本为该第一共享库的最高版本。Among them, version A is the highest version of the first shared library.
本申请实施例中,能够实现多版本共享库的更新,使得共享库有独立的更新能力,降低了共享库提供者的开发门槛,使共享库便于管理和普及,也能够降低应用开发者使用共享库时的集成成本和更新频率。In the embodiments of the present application, it is possible to update multiple versions of shared libraries, so that the shared libraries have independent update capabilities, lowering the development threshold for shared library providers, making shared libraries easier to manage and popularize, and also reducing the integration cost and update frequency of application developers when using shared libraries.
结合第一方面,在一种可能的实现方式中,该方法还包括:安装该第一共享库的第A版本;当检测到第一应用启动时,获取该第一共享库的第A版本,以运行该第一应用,该第一共享库为该第一应用依赖的共享库。In combination with the first aspect, in a possible implementation, the method also includes: installing the Ath version of the first shared library; when it is detected that the first application is started, obtaining the Ath version of the first shared library to run the first application, and the first shared library is a shared library that the first application depends on.
其中,当检测到第一应用启动时,获取该第一共享库的第A版本,可以是获取该第一共享库的第A版本的共享库路径,以便于第一应用根据该第一共享库的第A版本的共享库路径使用该第一共享库的第A版本。When it is detected that the first application is started, the Ath version of the first shared library is obtained, which may be to obtain the shared library path of the Ath version of the first shared library, so that the first application uses the Ath version of the first shared library according to the shared library path of the Ath version of the first shared library.
本申请实施例中,在完成多版本共享库的更新后,系统能够在应用启动时自动加载所依赖的共享库的最高版本,能够使得共享库的更新得到实时体现,从而能够降低应用开发者使用共享库时的集成成本和更新频率。In an embodiment of the present application, after completing the update of multiple versions of shared libraries, the system can automatically load the highest version of the shared library it depends on when the application starts, so that the update of the shared library can be reflected in real time, thereby reducing the integration cost and update frequency of application developers when using shared libraries.
结合第一方面,在一种可能的实现方式中,判断系统中是否安装有该第一共享库的第A版本,包括:获取该第一共享库的信息,该第一共享库的信息包括当前已安装的一个或多个版本的第一共享库的信息;根据该第一共享库的信息判断系统中是否安装有该第一共享库的第A版本。In combination with the first aspect, in a possible implementation method, determining whether the Ath version of the first shared library is installed in the system includes: obtaining information about the first shared library, the information about the first shared library including information about one or more versions of the first shared library currently installed; and determining whether the Ath version of the first shared library is installed in the system based on the information about the first shared library.
本申请实施例中,提供了一种应用市场向系统查询共享库相关信息的方法,能够实现应用市场和系统之间的共享库信息交互。In an embodiment of the present application, a method is provided in which an application market queries a system for information related to a shared library, which can realize the shared library information interaction between the application market and the system.
结合第一方面,在一种可能的实现方式中,判断系统中是否安装有该第一共享库的第A版本,包括: 应用市场通过向系统查询获取当前已安装的最高版本的第一共享库的信息;应用市场根据该最高版本的第一共享库的信息判断该最高版本是否是第A版本,若不是,则应用市场确定系统中未安装有该第一共享库的第A版本。In conjunction with the first aspect, in a possible implementation manner, determining whether the Ath version of the first shared library is installed in the system includes: The application market obtains information about the highest version of the first shared library currently installed by querying the system; the application market determines whether the highest version is the Ath version based on the information about the highest version of the first shared library. If not, the application market determines that the Ath version of the first shared library is not installed in the system.
本申请实施例中,提供了又一种应用市场向系统查询共享库相关信息的方法,能够实现应用市场和系统之间的共享库信息交互。In an embodiment of the present application, another method is provided for an application market to query a system for information related to a shared library, which can realize the shared library information interaction between the application market and the system.
结合第一方面,在一种可能的实现方式中,判断系统中是否安装有该第一共享库的第A版本,包括:应用市场向系统发送询问消息,该询问消息用于询问系统是否安装了该第一共享库的第A版本,应用市场接收该询问消息的回复消息,若该回复消息为否,则应用市场确定系统中未安装有该第一共享库的第A版本。In combination with the first aspect, in a possible implementation method, determining whether the Ath version of the first shared library is installed in the system includes: the application market sends an inquiry message to the system, the inquiry message is used to inquire whether the system has installed the Ath version of the first shared library, the application market receives a reply message to the inquiry message, if the reply message is no, the application market determines that the Ath version of the first shared library is not installed in the system.
本申请实施例中,提供了又一种应用市场向系统查询共享库相关信息的方法,能够实现应用市场和系统之间的共享库信息交互。In an embodiment of the present application, another method is provided for an application market to query a system for information related to a shared library, which can realize the shared library information interaction between the application market and the system.
结合第一方面,在一种可能的实现方式中,根据该第一共享库的信息判断系统中是否安装有该第一共享库的第A版本,包括:当该第一共享库的信息中不包括该第一共享库的第A版本的信息时,确定该系统中未安装该第一共享库的第A版本。In combination with the first aspect, in a possible implementation method, whether the Ath version of the first shared library is installed in the system is determined based on the information of the first shared library, including: when the information of the first shared library does not include the Ath version of the first shared library, determining that the Ath version of the first shared library is not installed in the system.
本申请实施例中,该第一共享库的信息包括系统当前已安装的一个或多个版本的第一共享库的信息,应用市场在获取到该信息后,能够进一步确定系统当前已安装的一个或多个版本的第一共享库中是否有该第一共享库的第A版本,进而确定系统中是否安装有该第一共享库的第A版本。In an embodiment of the present application, the information of the first shared library includes information of one or more versions of the first shared library currently installed in the system. After obtaining the information, the application market can further determine whether there is version A of the first shared library in the one or more versions of the first shared library currently installed in the system, and then determine whether version A of the first shared library is installed in the system.
结合第一方面,在一种可能的实现方式中,获取该第一共享库的信息,包括:应用市场向系统发送第一查询消息,该第一查询消息用于查询该第一共享库的信息;应用市场接收第一回复消息,该第一回复消息包括该第一共享库的信息。In combination with the first aspect, in a possible implementation method, obtaining the information of the first shared library includes: the application market sends a first query message to the system, and the first query message is used to query the information of the first shared library; the application market receives a first reply message, and the first reply message includes the information of the first shared library.
本申请实施例中,系统向应用市场提供了共享库版本的查询接口,使得应用市场能够通过该查询接口实现与系统之间的信息交互,进而从系统获取共享库版本信息。In an embodiment of the present application, the system provides a query interface for the shared library version to the application market, so that the application market can implement information interaction with the system through the query interface, and then obtain the shared library version information from the system.
结合第一方面,在一种可能的实现方式中,该方法还包括:确定第三共享库列表,该第三共享库列表包括全量共享库中的未被应用依赖的共享库,和/或,该第三共享库列表包括该全量共享库中的低版本共享库,该第三共享库列表中的共享库均处于当前未运行状态,该全量共享库包括系统当前已安装的所有共享库;卸载该第三共享库列表中的共享库。In combination with the first aspect, in a possible implementation, the method also includes: determining a third shared library list, the third shared library list including shared libraries in the full shared library that are not dependent on the application, and/or the third shared library list includes lower version shared libraries in the full shared library, the shared libraries in the third shared library list are all in a currently non-running state, and the full shared library includes all shared libraries currently installed in the system; uninstalling the shared libraries in the third shared library list.
其中,可选的,全量共享库中的每个共享库都带有自身的版本标识。Optionally, each shared library in the full shared library has its own version identifier.
其中,低版本共享库为非最高版本共享库。Among them, the low version shared library is a shared library that is not the highest version.
本申请实施例中,共享库具有独立的卸载能力,降低了共享库提供者的开发门槛,使共享库便于管理和普及;能够及时卸载系统中不被应用依赖的共享库和低版本的共享库,能够减少系统中存储空间的占用,进而提高用户体验。In the embodiment of the present application, the shared library has an independent uninstall capability, which lowers the development threshold for shared library providers and makes the shared library easier to manage and popularize; it can timely uninstall shared libraries that are not relied on by applications in the system and low-version shared libraries, which can reduce the storage space occupied in the system and thereby improve the user experience.
结合第一方面,在一种可能的实现方式中,确定第三共享库列表,包括:获取该全量共享库的信息,该全量共享库的信息包括该全量共享库中的每个共享库的版本信息,和/或,该全量共享库的信息包括该全量共享库中的每个共享库的依赖信息,该依赖信息用于表征共享库是否被应用依赖,或该依赖信息用于表征共享库被哪些应用依赖;根据该全量共享库的信息确定第四共享库列表,该第四共享库列表包括该全量共享库中的未被应用依赖的共享库,和/或,该第四共享库列表包括该全量共享库中的低版本共享库;获取该第四共享库列表中的每个共享库的运行信息,该运行信息用于表征共享库当前是否处于运行状态;根据该运行信息确定该第三共享库列表,该第三共享库列表中包括该第四共享库列表中的当前未运行的共享库。In combination with the first aspect, in a possible implementation, determining a third shared library list includes: obtaining information about the full shared library, the information about the full shared library including version information of each shared library in the full shared library, and/or the information about the full shared library including dependency information of each shared library in the full shared library, the dependency information being used to characterize whether a shared library is dependent on an application, or the dependency information being used to characterize which applications depend on a shared library; determining a fourth shared library list based on the information about the full shared library, the fourth shared library list including shared libraries in the full shared library that are not dependent on an application, and/or the fourth shared library list including lower-version shared libraries in the full shared library; obtaining running information of each shared library in the fourth shared library list, the running information being used to characterize whether a shared library is currently in a running state; determining the third shared library list based on the running information, the third shared library list including shared libraries in the fourth shared library list that are not currently running.
其中,可选地,在第一时机获取该全量共享库的信息,该第一时机可以是周期性的时机,例如:可以是每天的晚上22:00,还可以是每天的凌晨2:00,还可以是每隔30小时,还可以是其他任意周期性时机;该第一时机还可以是因用户操作触发的时机,还可以是系统根据设备当前存储或运行情况自动确定的时机,本申请对此不作限定。Among them, optionally, the information of the full shared library is obtained at a first time, and the first time may be a periodic time, for example: it may be 22:00 every night, or 2:00 every morning, or every 30 hours, or any other periodic time; the first time may also be a time triggered by a user operation, or a time automatically determined by the system according to the current storage or operation status of the device, and the present application does not limit this.
本申请实施例中,应用市场能够从系统获取全量共享库的版本信息和运行信息,进而确定需要卸载的共享库列表,以便于后续将该共享库列表中的共享库卸载。In an embodiment of the present application, the application market can obtain version information and operation information of all shared libraries from the system, and then determine a list of shared libraries that need to be uninstalled, so as to facilitate subsequent uninstallation of the shared libraries in the shared library list.
结合第一方面,在一种可能的实现方式中,获取所述全量共享库的信息,包括:应用市场向系统发送第二查询消息,该第二查询消息用于查询该全量共享库的信息;应用市场接收第二回复消息,该第二回复消息包括该全量共享库的信息。 In combination with the first aspect, in a possible implementation method, obtaining the information of the full shared library includes: the application market sends a second query message to the system, and the second query message is used to query the information of the full shared library; the application market receives a second reply message, and the second reply message includes the information of the full shared library.
本申请实施例中,系统向应用市场提供了全量共享库信息的查询接口,使得应用市场能够通过该查询接口实现与系统之间的信息交互,进而从系统获取全量共享库的信息。In an embodiment of the present application, the system provides a query interface for the full shared library information to the application market, so that the application market can implement information interaction with the system through the query interface, and then obtain the full shared library information from the system.
结合第一方面,在一种可能的实现方式中,获取该第四共享库列表中的每个共享库的运行信息,包括:应用市场向系统发送第三查询消息,该第三查询消息用于查询第四共享库列表中的每个共享库的运行信息;该应用市场接收第三回复消息,该第三回复消息用于指示该第四共享库列表中的每个共享库的运行信息。In combination with the first aspect, in a possible implementation method, obtaining the operating information of each shared library in the fourth shared library list includes: the application market sends a third query message to the system, and the third query message is used to query the operating information of each shared library in the fourth shared library list; the application market receives a third reply message, and the third reply message is used to indicate the operating information of each shared library in the fourth shared library list.
本申请实施例中,系统向应用市场提供了共享库的运行信息的查询接口,使得应用市场能够通过该查询接口实现与系统之间的信息交互,进而从系统获取共享库的运行信息。In an embodiment of the present application, the system provides the application market with a query interface for the running information of the shared library, so that the application market can implement information interaction with the system through the query interface, and then obtain the running information of the shared library from the system.
结合第一方面,在一种可能的实现方式中,该全量共享库中包括该第一共享库的第一版本和该第一共享库的第A版本,该第一共享库的第A版本为该第一共享库的最高版本,该方法还包括:当卸载该第一共享库的第一版本时,将该第一应用所依赖的共享库版本指向该第一共享库的第A版本。In combination with the first aspect, in a possible implementation, the full shared library includes the first version of the first shared library and the Ath version of the first shared library, the Ath version of the first shared library is the highest version of the first shared library, and the method also includes: when the first version of the first shared library is uninstalled, pointing the shared library version that the first application depends on to the Ath version of the first shared library.
其中,卸载该第一共享库的第一版本,包括:删除该第一共享库的第一版本的路径信息。Uninstalling the first version of the first shared library includes: deleting path information of the first version of the first shared library.
其中,将该第一应用所依赖的共享库版本指向该第一共享库的第A版本,可以理解为修改第一应用的依赖关系,也就是将第一应用的依赖关系由依赖第一共享库的第一版本指向依赖第一共享库的第A版本。Among them, pointing the shared library version that the first application depends on to the Ath version of the first shared library can be understood as modifying the dependency of the first application, that is, changing the dependency of the first application from relying on the first version of the first shared library to relying on the Ath version of the first shared library.
在与该实施例并列的另一种可能的实现方式中,当卸载该第一共享库的第一版本时,系统不会修改第一应用的依赖关系,而是在每次都在第一应用启动时获取第一共享库的第A版本。In another possible implementation parallel to this embodiment, when the first version of the first shared library is uninstalled, the system does not modify the dependency of the first application, but obtains the Ath version of the first shared library each time the first application is started.
本申请实施例中,在应用使用的共享库版本被卸载时,该应用使用的共享库版本自动指向高版本共享库,这样,在应用启动时,自动启用更高版本的共享库,不会因为共享库版本的卸载而导致应用运行异常,能够提升用户的使用体验。In an embodiment of the present application, when the shared library version used by an application is uninstalled, the shared library version used by the application automatically points to a higher version of the shared library. In this way, when the application is started, the higher version of the shared library is automatically enabled, and the application will not run abnormally due to the uninstallation of the shared library version, thereby improving the user experience.
结合第一方面,在一种可能的实现方式中,该方法还包括:响应于用户安装或更新该第一应用的操作,获取该第一应用依赖的第一共享库列表,该第一共享库列表包括M个共享库,M为大于或等于1的正整数;根据该M个共享库的安装情况确定第二共享库列表,该第二共享库列表中包括该M个共享库中的未安装的共享库;安装该第二共享库列表中的共享库,和,安装或更新该第一应用。In combination with the first aspect, in a possible implementation, the method also includes: in response to a user operation of installing or updating the first application, obtaining a first shared library list that the first application depends on, the first shared library list including M shared libraries, where M is a positive integer greater than or equal to 1; determining a second shared library list based on the installation status of the M shared libraries, the second shared library list including uninstalled shared libraries among the M shared libraries; installing the shared libraries in the second shared library list, and installing or updating the first application.
本申请实施例中,能够实现共享库与三方应用共同安装,能够使得应用始终存在所依赖的共享库,能够减少应用运行失败的情况发生,提高了用户体验。In the embodiment of the present application, the shared library and the third-party application can be installed together, so that the application can always have the shared library it depends on, which can reduce the occurrence of application operation failures and improve the user experience.
结合第一方面,在一种可能的实现方式中,在根据该M个共享库的安装情况确定第二共享库列表之前,该方法还包括:应用市场向系统发送第四查询消息,该第四查询消息用于查询该M个共享库的安装情况;该应用市场接收第四回复消息,该第四回复消息用于指示该M个共享库的安装情况。In combination with the first aspect, in a possible implementation, before determining the second shared library list based on the installation status of the M shared libraries, the method also includes: the application market sends a fourth query message to the system, and the fourth query message is used to query the installation status of the M shared libraries; the application market receives a fourth reply message, and the fourth reply message is used to indicate the installation status of the M shared libraries.
本申请实施例中,系统向应用市场提供了共享库的安装信息的查询接口,使得应用市场能够通过该查询接口实现与系统之间的信息交互,进而从系统获取共享库的安装信息。In an embodiment of the present application, the system provides a query interface for the installation information of the shared library to the application market, so that the application market can implement information interaction with the system through the query interface, and then obtain the installation information of the shared library from the system.
结合第一方面,在一种可能的实现方式中,安装该第二共享库列表中的共享库,包括:将该第二共享库列表中的每个共享库分别安装在不同的路径。In combination with the first aspect, in a possible implementation manner, installing the shared libraries in the second shared library list includes: installing each shared library in the second shared library list in different paths respectively.
本申请实施例中,系统进行不同版本共享库安装时,会根据版本号将不同版本的共享库安装在不同版本路径下,这样,能够使得不同版本的共享库之间相对独立,可以将同一共享库的不同版本作为不同应用处理,能够实现对共享库的特定版本的更新或者卸载等操作。In an embodiment of the present application, when the system installs different versions of shared libraries, it will install different versions of shared libraries in different version paths according to the version numbers. In this way, different versions of shared libraries can be relatively independent of each other, different versions of the same shared library can be treated as different applications, and operations such as updating or uninstalling a specific version of the shared library can be implemented.
第二方面,提供一种管理共享库的方法,该方法包括:确定第三共享库列表,该第三共享库列表包括全量共享库中的未被应用依赖的共享库,和/或,该第三共享库列表包括该全量共享库中的低版本共享库,该全量共享库包括系统当前已安装的所有共享库;卸载该第三共享库列表中的共享库,该第三共享库列表中的共享库均处于当前未运行状态。In a second aspect, a method for managing shared libraries is provided, the method comprising: determining a third shared library list, the third shared library list including shared libraries in the full shared library that are not dependent on applications, and/or the third shared library list including lower version shared libraries in the full shared library, the full shared library including all shared libraries currently installed in the system; uninstalling shared libraries in the third shared library list, the shared libraries in the third shared library list are all in a currently non-running state.
其中,可选的,全量共享库中的每个共享库都带有自身的版本标识。Optionally, each shared library in the full shared library has its own version identifier.
本申请实施例中,共享库具有独立的卸载能力,降低了共享库提供者的开发门槛,使共享库便于管理和普及;能够及时卸载系统中不被应用依赖的共享库和低版本的共享库,能够减少系统中存储空间的占用,进而提高用户体验。In the embodiment of the present application, the shared library has an independent uninstall capability, which lowers the development threshold for shared library providers and makes the shared library easier to manage and popularize; it can timely uninstall shared libraries that are not relied on by applications in the system and low-version shared libraries, which can reduce the storage space occupied in the system and thereby improve the user experience.
结合第二方面,在一种可能的实现方式中,确定第三共享库列表,包括:获取该全量共享库的信息,该全量共享库的信息包括所述全量共享库中的每个共享库的版本信息,和/或,该全量共享库的信息包括该全量共享库中的每个共享库的依赖信息,该依赖信息用于表征共享库是否被应用依赖,或该依赖信息用于表征共享库被哪些应用依赖;根据该全量共享库的信息确定第四共享库列表,该第四共享库列表包 括该全量共享库中的未被应用依赖的共享库,和/或,该第四共享库列表包括该全量共享库中的低版本共享库;获取该第四共享库列表中的每个共享库的运行信息,该运行信息用于表征共享库当前是否处于运行状态;根据该运行信息确定该第三共享库列表,该第三共享库列表中包括该第四共享库列表中的当前未运行的共享库。In combination with the second aspect, in a possible implementation, determining a third shared library list includes: obtaining information about the full shared library, the information about the full shared library including version information of each shared library in the full shared library, and/or the information about the full shared library including dependency information of each shared library in the full shared library, the dependency information being used to characterize whether a shared library is dependent on an application, or the dependency information being used to characterize which applications depend on a shared library; determining a fourth shared library list based on the information about the full shared library, the fourth shared library list including The fourth shared library list includes the shared libraries in the full shared library that are not depended on by the application, and/or the fourth shared library list includes the lower version shared libraries in the full shared library; the running information of each shared library in the fourth shared library list is obtained, and the running information is used to indicate whether the shared library is currently in a running state; the third shared library list is determined according to the running information, and the third shared library list includes the shared libraries in the fourth shared library list that are not currently running.
其中,可选地,在第一时机获取该全量共享库的信息,该第一时机可以是周期性的时机,例如:可以是每天的晚上22:00,还可以是每天的凌晨2:00,还可以是每隔30小时,还可以是其他任意周期性时机;该第一时机还可以是因用户操作触发的时机,还可以是系统根据设备当前存储或运行情况自动确定的时机,本申请对此不作限定。Among them, optionally, the information of the full shared library is obtained at a first time, and the first time may be a periodic time, for example: it may be 22:00 every night, or 2:00 every morning, or every 30 hours, or any other periodic time; the first time may also be a time triggered by a user operation, or a time automatically determined by the system according to the current storage or operation status of the device, and the present application does not limit this.
本申请实施例中,应用市场能够从系统获取全量共享库的版本信息和运行信息,进而确定需要卸载的共享库列表,以便于后续将该共享库列表中的共享库卸载。In an embodiment of the present application, the application market can obtain version information and operation information of all shared libraries from the system, and then determine a list of shared libraries that need to be uninstalled, so as to facilitate subsequent uninstallation of the shared libraries in the shared library list.
结合第二方面,在一种可能的实现方式中,获取该全量共享库的信息,包括:应用市场向系统发送第二查询消息,该第二查询消息用于查询该全量共享库的信息;应用市场接收第二回复消息,该第二回复消息包括该全量共享库的信息。In combination with the second aspect, in a possible implementation method, obtaining the information of the full shared library includes: the application market sends a second query message to the system, and the second query message is used to query the information of the full shared library; the application market receives a second reply message, and the second reply message includes the information of the full shared library.
本申请实施例中,系统向应用市场提供了全量共享库信息的查询接口,使得应用市场能够通过该查询接口实现与系统之间的信息交互,进而从系统获取全量共享库信息。In an embodiment of the present application, the system provides a query interface for the full shared library information to the application market, so that the application market can implement information interaction with the system through the query interface, and then obtain the full shared library information from the system.
结合第二方面,在一种可能的实现方式中,获取该第四共享库列表中的每个共享库的运行信息,包括:应用市场向系统发送第三查询消息,该第三查询消息用于查询该第四共享库列表中的每个共享库的运行信息;应用市场接收第三回复消息,该第三回复消息用于指示该第四共享库列表中的每个共享库的运行信息。In combination with the second aspect, in a possible implementation method, obtaining the operating information of each shared library in the fourth shared library list includes: the application market sends a third query message to the system, and the third query message is used to query the operating information of each shared library in the fourth shared library list; the application market receives a third reply message, and the third reply message is used to indicate the operating information of each shared library in the fourth shared library list.
本申请实施例中,系统向应用市场提供了共享库的运行信息的查询接口,使得应用市场能够通过该查询接口实现与系统之间的信息交互,进而从系统获取共享库的运行信息。In an embodiment of the present application, the system provides the application market with a query interface for the running information of the shared library, so that the application market can implement information interaction with the system through the query interface, and then obtain the running information of the shared library from the system.
结合第二方面,在一种可能的实现方式中,该全量共享库中包括该第一共享库的第一版本和该第一共享库的第A版本,该第一共享库的第A版本为该第一共享库的最高版本,方法还包括:当卸载所述第一共享库的第一版本时,将第一应用所依赖的共享库版本指向该第一共享库的第A版本,该第一共享库为该第一应用依赖的共享库。In combination with the second aspect, in a possible implementation, the full shared library includes the first version of the first shared library and the Ath version of the first shared library, and the Ath version of the first shared library is the highest version of the first shared library. The method also includes: when uninstalling the first version of the first shared library, pointing the shared library version that the first application depends on to the Ath version of the first shared library, and the first shared library is the shared library that the first application depends on.
其中,卸载该第一共享库的第一版本,包括:删除该第一共享库的第一版本的路径信息。Uninstalling the first version of the first shared library includes: deleting path information of the first version of the first shared library.
其中,将该第一应用所依赖的共享库版本指向该第一共享库的第A版本,可以理解为修改第一应用的依赖关系,也就是将第一应用的依赖关系由依赖第一共享库的第一版本指向依赖第一共享库的第A版本。Among them, pointing the shared library version that the first application depends on to the Ath version of the first shared library can be understood as modifying the dependency of the first application, that is, changing the dependency of the first application from relying on the first version of the first shared library to relying on the Ath version of the first shared library.
在与该实施例并列的另一种可能的实现方式中,当卸载该第一共享库的第一版本时,系统不会修改第一应用的依赖关系,而是在每次都在第一应用启动时获取第一共享库的第A版本。In another possible implementation parallel to this embodiment, when the first version of the first shared library is uninstalled, the system does not modify the dependency of the first application, but obtains the Ath version of the first shared library each time the first application is started.
本申请实施例中,在应用使用的共享库版本被卸载时,该应用使用的共享库版本自动指向高版本共享库,这样,在应用启动时,自动启用更高版本的共享库,不会因为共享库版本的卸载而导致应用运行异常,能够提升用户的使用体验。In an embodiment of the present application, when the shared library version used by an application is uninstalled, the shared library version used by the application automatically points to a higher version of the shared library. In this way, when the application is started, the higher version of the shared library is automatically enabled, and the application will not run abnormally due to the uninstallation of the shared library version, thereby improving the user experience.
结合第二方面,在一种可能的实现方式中,该方法还包括:响应于用户安装或更新第一应用的操作,获取该第一应用依赖的第一共享库列表,该第一共享库列表包括M个共享库,M为大于或等于1的正整数;根据该M个共享库的安装情况确定第二共享库列表,该第二共享库列表中包括该M个共享库中的未安装的共享库;安装该第二共享库列表中的共享库,和,安装或更新该第一应用。In combination with the second aspect, in a possible implementation, the method also includes: in response to a user's operation of installing or updating the first application, obtaining a first shared library list that the first application depends on, the first shared library list including M shared libraries, where M is a positive integer greater than or equal to 1; determining a second shared library list based on the installation status of the M shared libraries, the second shared library list including uninstalled shared libraries among the M shared libraries; installing the shared libraries in the second shared library list, and installing or updating the first application.
本申请实施例中,能够实现共享库与三方应用共同安装,能够使得应用始终存在所依赖的共享库,能够减少应用运行失败的情况发生,提高了用户体验。In the embodiment of the present application, the shared library and the third-party application can be installed together, so that the application can always have the shared library it depends on, which can reduce the occurrence of application operation failures and improve the user experience.
结合第二方面,在一种可能的实现方式中,在根据该M个共享库的安装情况确定第二共享库列表之前,该方法还包括:应用市场向系统发送第四查询消息,该第四查询消息用于查询该M个共享库的安装情况;应用市场接收第四回复消息,该第四回复消息用于指示该M个共享库的安装情况。In combination with the second aspect, in a possible implementation, before determining the second shared library list based on the installation status of the M shared libraries, the method also includes: the application market sends a fourth query message to the system, and the fourth query message is used to query the installation status of the M shared libraries; the application market receives a fourth reply message, and the fourth reply message is used to indicate the installation status of the M shared libraries.
本申请实施例中,系统向应用市场提供了共享库的安装信息的查询接口,使得应用市场能够通过该查询接口实现与系统之间的信息交互,进而从系统获取共享库的安装信息。In an embodiment of the present application, the system provides a query interface for the installation information of the shared library to the application market, so that the application market can implement information interaction with the system through the query interface, and then obtain the installation information of the shared library from the system.
结合第二方面,在一种可能的实现方式中,安装该第二共享库列表中的共享库,包括:将该第二共享库列表中的每个共享库安装在不同的路径。In conjunction with the second aspect, in a possible implementation manner, installing the shared libraries in the second shared library list includes: installing each shared library in the second shared library list in a different path.
本申请实施例中,系统进行不同版本共享库安装时,会根据版本号将不同版本的共享库安装在不同 版本路径下,这样,能够使得不同版本的共享库之间相对独立,可以将同一共享库的不同版本作为不同应用处理,能够实现对共享库的特定版本的更新或者卸载等操作。In the embodiment of the present application, when the system installs different versions of shared libraries, it will install different versions of shared libraries in different folders according to the version number. Under the version path, different versions of shared libraries can be relatively independent of each other, different versions of the same shared library can be treated as different applications, and operations such as updating or uninstalling a specific version of the shared library can be implemented.
第三方面,提供一种管理共享库的装置,该装置包括:判断模块,用于在检测到第一共享库的第A版本上架时,判断系统中是否安装有该第一共享库的第A版本;下载模块,用于在确定系统中未安装该第一共享库的第A版本时,下载该第一共享库的第A版本。In a third aspect, a device for managing shared libraries is provided, the device comprising: a judgment module, for judging whether the Ath version of the first shared library is installed in the system when it is detected that the Ath version of the first shared library is put on the shelf; and a download module, for downloading the Ath version of the first shared library when it is determined that the Ath version of the first shared library is not installed in the system.
其中,第A版本为该第一共享库的最高版本。Among them, version A is the highest version of the first shared library.
本申请实施例中,能够实现多版本共享库的更新,使得共享库有独立的更新能力,降低了共享库提供者的开发门槛,使共享库便于管理和普及,也能够降低应用开发者使用共享库时的集成成本和更新频率。In the embodiments of the present application, it is possible to update multiple versions of shared libraries, so that the shared libraries have independent update capabilities, lowering the development threshold for shared library providers, making shared libraries easier to manage and popularize, and also reducing the integration cost and update frequency of application developers when using shared libraries.
结合第三方面,在一种可能的实现方式中,该装置还包括:安装模块,用于安装该第一共享库的第A版本;获取模块,用于在检测到第一应用启动时,获取该第一共享库的第A版本,以运行该第一应用,该第一共享库为该第一应用依赖的共享库。In combination with the third aspect, in a possible implementation, the device also includes: an installation module for installing the Ath version of the first shared library; an acquisition module for acquiring the Ath version of the first shared library when it is detected that the first application is started, so as to run the first application, and the first shared library is a shared library that the first application depends on.
其中,当检测到第一应用启动时,获取模块获取该第一共享库的第A版本,可以是获取模块获取该第一共享库的第A版本的共享库路径,以便于第一应用根据该第一共享库的第A版本的共享库路径使用该第一共享库的第A版本。When it is detected that the first application is started, the acquisition module acquires the Ath version of the first shared library. The acquisition module may acquire the shared library path of the Ath version of the first shared library so that the first application uses the Ath version of the first shared library according to the shared library path of the Ath version of the first shared library.
本申请实施例中,在完成多版本共享库的更新后,系统能够在应用启动时自动加载所依赖的共享库的最高版本,能够使得共享库的更新得到实时体现,从而能够降低应用开发者使用共享库时的集成成本和更新频率。In an embodiment of the present application, after completing the update of multiple versions of shared libraries, the system can automatically load the highest version of the shared library it depends on when the application starts, so that the update of the shared library can be reflected in real time, thereby reducing the integration cost and update frequency of application developers when using shared libraries.
结合第三方面,在一种可能的实现方式中,获取模块用于获取该第一共享库的信息,该第一共享库的信息包括当前已安装的一个或多个版本的第一共享库的信息;该判断模块具体用于:根据该第一共享库的信息判断系统中是否安装有该第一共享库的第A版本。In combination with the third aspect, in a possible implementation method, the acquisition module is used to obtain information about the first shared library, and the information about the first shared library includes information about one or more versions of the first shared library that are currently installed; the judgment module is specifically used to: judge whether version A of the first shared library is installed in the system based on the information about the first shared library.
本申请实施例中,提供了一种应用市场向系统查询共享库相关信息的装置,能够实现应用市场和系统之间的共享库信息交互。In an embodiment of the present application, a device is provided for an application market to query a system for information related to a shared library, which can realize the shared library information interaction between the application market and the system.
结合第三方面,在一种可能的实现方式中,获取模块用于通过向系统查询获取当前已安装的最高版本的第一共享库的信息;该判断模块具体用于:根据该最高版本的第一共享库的信息判断该最高版本是否是第A版本,若不是,则该装置包括的确定模块确定系统中未安装有该第一共享库的第A版本。In combination with the third aspect, in a possible implementation method, the acquisition module is used to obtain information about the highest version of the first shared library currently installed by querying the system; the judgment module is specifically used to: determine whether the highest version is the Ath version based on the information of the highest version of the first shared library; if not, the determination module included in the device determines that the Ath version of the first shared library is not installed in the system.
本申请实施例中,提供了又一种应用市场向系统查询共享库相关信息的装置,能够实现应用市场和系统之间的共享库信息交互。In an embodiment of the present application, another device is provided for the application market to query the system for information related to the shared library, which can realize the shared library information interaction between the application market and the system.
结合第三方面,在一种可能的实现方式中,该装置还包括收发模块,用于向系统发送询问消息,该询问消息用于询问系统是否安装了该第一共享库的第A版本,该收发模块还用于接收该询问消息的回复消息,确定模块,用于在该回复消息为否时,确定系统中未安装有该第一共享库的第A版本。In combination with the third aspect, in a possible implementation, the device also includes a transceiver module for sending an inquiry message to the system, wherein the inquiry message is used to inquire whether the system has installed the Ath version of the first shared library, and the transceiver module is also used to receive a reply message to the inquiry message, and a determination module for determining that the Ath version of the first shared library is not installed in the system when the reply message is no.
本申请实施例中,提供了又一种应用市场向系统查询共享库相关信息的装置,能够实现应用市场和系统之间的共享库信息交互。In an embodiment of the present application, another device is provided for the application market to query the system for information related to the shared library, which can realize the shared library information interaction between the application market and the system.
结合第三方面,在一种可能的实现方式中,该判断模块具体用于:在该第一共享库的信息中不包括该第一共享库的第A版本的信息时,确定该系统中未安装该第一共享库的第A版本。In combination with the third aspect, in a possible implementation, the judgment module is specifically used to: when the information of the first shared library does not include the information of the Ath version of the first shared library, determine that the Ath version of the first shared library is not installed in the system.
本申请实施例中,该第一共享库的信息包括系统当前已安装的一个或多个版本的第一共享库的信息,应用市场在获取到该信息后,能够进一步确定系统当前已安装的一个或多个版本的第一共享库中是否有该第一共享库的第A版本,进而确定系统中是否安装有该第一共享库的第A版本。In an embodiment of the present application, the information of the first shared library includes information of one or more versions of the first shared library currently installed in the system. After obtaining the information, the application market can further determine whether there is version A of the first shared library in the one or more versions of the first shared library currently installed in the system, and then determine whether version A of the first shared library is installed in the system.
结合第三方面,在一种可能的实现方式中,收发模块还用于向系统发送第一查询消息,该第一查询消息用于查询该第一共享库的信息;该收发模块还用于接收第一回复消息,该第一回复消息包括该第一共享库的信息。In combination with the third aspect, in a possible implementation, the transceiver module is also used to send a first query message to the system, and the first query message is used to query the information of the first shared library; the transceiver module is also used to receive a first reply message, and the first reply message includes the information of the first shared library.
本申请实施例中,系统向应用市场提供了共享库版本的查询接口,使得应用市场能够通过该查询接口实现与系统之间的信息交互,进而从系统获取共享库版本信息。In an embodiment of the present application, the system provides a query interface for the shared library version to the application market, so that the application market can implement information interaction with the system through the query interface, and then obtain the shared library version information from the system.
结合第三方面,在一种可能的实现方式中,确定模块还用于:确定第三共享库列表,该第三共享库列表包括全量共享库中的未被应用依赖的共享库,和/或,该第三共享库列表包括该全量共享库中的低版本共享库,该第三共享库列表中的共享库均处于当前未运行状态,该全量共享库包括系统当前已安装的所有共享库;该装置还包括卸载模块,用于卸载该第三共享库列表中的共享库。In combination with the third aspect, in a possible implementation, the determination module is also used to: determine a third shared library list, the third shared library list includes shared libraries in the full shared library that are not dependent on the application, and/or the third shared library list includes lower version shared libraries in the full shared library, the shared libraries in the third shared library list are all in a currently non-running state, and the full shared library includes all shared libraries currently installed in the system; the device also includes an uninstall module for uninstalling the shared libraries in the third shared library list.
其中,可选的,全量共享库中的每个共享库都带有自身的版本标识。 Optionally, each shared library in the full shared library has its own version identifier.
其中,低版本共享库为非最高版本共享库。Among them, the low version shared library is a shared library that is not the highest version.
本申请实施例中,共享库具有独立的卸载能力,降低了共享库提供者的开发门槛,使共享库便于管理和普及;能够及时卸载系统中不被应用依赖的共享库和低版本的共享库,能够减少系统中存储空间的占用,进而提高用户体验。In the embodiment of the present application, the shared library has an independent uninstall capability, which lowers the development threshold for shared library providers and makes the shared library easier to manage and popularize; it can timely uninstall shared libraries that are not relied on by applications in the system and low-version shared libraries, which can reduce the storage space occupied in the system and thereby improve the user experience.
结合第三方面,在一种可能的实现方式中,获取模块还用于:获取该全量共享库的信息,该全量共享库的信息包括该全量共享库中的每个共享库的版本信息,和/或,该全量共享库的信息包括该全量共享库中的每个共享库的依赖信息,该依赖信息用于表征共享库是否被应用依赖,或该依赖信息用于表征共享库被哪些应用依赖;根据该全量共享库的信息确定第四共享库列表,该第四共享库列表包括该全量共享库中的未被应用依赖的共享库,和/或,该第四共享库列表包括该全量共享库中的低版本共享库;获取该第四共享库列表中的每个共享库的运行信息,该运行信息用于表征共享库当前是否处于运行状态;确定模块具体用于:根据该运行信息确定该第三共享库列表,该第三共享库列表中包括该第四共享库列表中的当前未运行的共享库。In combination with the third aspect, in a possible implementation, the acquisition module is also used to: obtain information about the full shared library, the information about the full shared library includes version information of each shared library in the full shared library, and/or the information about the full shared library includes dependency information of each shared library in the full shared library, the dependency information is used to characterize whether the shared library is dependent on the application, or the dependency information is used to characterize which applications depend on the shared library; determine a fourth shared library list based on the information about the full shared library, the fourth shared library list includes shared libraries in the full shared library that are not dependent on the application, and/or the fourth shared library list includes lower-version shared libraries in the full shared library; obtain running information of each shared library in the fourth shared library list, the running information is used to characterize whether the shared library is currently in a running state; the determination module is specifically used to: determine the third shared library list based on the running information, the third shared library list includes shared libraries in the fourth shared library list that are not currently running.
其中,可选地,获取模块在第一时机获取该全量共享库的信息,该第一时机可以是周期性的时机,例如:可以是每天的晚上22:00,还可以是每天的凌晨2:00,还可以是每隔30小时,还可以是其他任意周期性时机;该第一时机还可以是因用户操作触发的时机,还可以是系统根据设备当前存储或运行情况自动确定的时机,本申请对此不作限定。Among them, optionally, the acquisition module acquires the information of the full shared library at a first time, and the first time may be a periodic time, for example: it may be 22:00 every night, or 2:00 every morning, or every 30 hours, or any other periodic time; the first time may also be a time triggered by a user operation, or a time automatically determined by the system according to the current storage or operation status of the device, and the present application does not limit this.
本申请实施例中,应用市场能够从系统获取全量共享库的版本信息和运行信息,进而确定需要卸载的共享库列表,以便于后续将该共享库列表中的共享库卸载。In an embodiment of the present application, the application market can obtain version information and operation information of all shared libraries from the system, and then determine a list of shared libraries that need to be uninstalled, so as to facilitate subsequent uninstallation of the shared libraries in the shared library list.
结合第三方面,在一种可能的实现方式中,收发模块还用于:向系统发送第二查询消息,该第二查询消息用于查询该全量共享库的信息;接收第二回复消息,该第二回复消息包括该全量共享库的信息。In combination with the third aspect, in a possible implementation, the transceiver module is also used to: send a second query message to the system, the second query message is used to query the information of the full shared library; receive a second reply message, the second reply message includes the information of the full shared library.
本申请实施例中,系统向应用市场提供了全量共享库的信息的查询接口,使得应用市场能够通过该查询接口实现与系统之间的信息交互,进而从系统获取全量共享库信息。In an embodiment of the present application, the system provides the application market with a query interface for information of the full shared library, so that the application market can implement information interaction with the system through the query interface, and then obtain the full shared library information from the system.
结合第三方面,在一种可能的实现方式中,收发模块还用于:向系统发送第三查询消息,该第三查询消息用于第四共享库列表中的每个共享库的运行信息;接收第三回复消息,该第三回复消息用于指示该第四共享库列表中的每个共享库的运行信息。In combination with the third aspect, in a possible implementation method, the transceiver module is also used to: send a third query message to the system, the third query message is used for the operation information of each shared library in the fourth shared library list; receive a third reply message, the third reply message is used to indicate the operation information of each shared library in the fourth shared library list.
本申请实施例中,系统向应用市场提供了共享库的运行信息的查询接口,使得应用市场能够通过该查询接口实现与系统之间的信息交互,进而从系统获取共享库的运行信息。In an embodiment of the present application, the system provides the application market with a query interface for the running information of the shared library, so that the application market can implement information interaction with the system through the query interface, and then obtain the running information of the shared library from the system.
结合第三方面,在一种可能的实现方式中,该全量共享库中包括该第一共享库的第一版本和该第一共享库的第A版本,该第一共享库的第A版本为该第一共享库的最高版本,该装置还包括:指向模块,用于在卸载该第一共享库的第一版本时,将该第一应用所依赖的共享库版本指向该第一共享库的第A版本。In combination with the third aspect, in a possible implementation, the full shared library includes the first version of the first shared library and the Ath version of the first shared library, the Ath version of the first shared library being the highest version of the first shared library, and the device also includes: a pointing module, used to point the shared library version on which the first application depends to the Ath version of the first shared library when the first version of the first shared library is uninstalled.
其中,卸载该第一共享库的第一版本,包括:删除该第一共享库的第一版本的路径信息。Uninstalling the first version of the first shared library includes: deleting path information of the first version of the first shared library.
其中,指向模块将该第一应用所依赖的共享库版本指向该第一共享库的第A版本,可以理解为指向模块修改第一应用的依赖关系,也就是将第一应用的依赖关系由依赖第一共享库的第一版本指向依赖第一共享库的第A版本。Among them, the pointing module points the shared library version on which the first application depends to the Ath version of the first shared library, which can be understood as the pointing module modifying the dependency of the first application, that is, changing the dependency of the first application from the first version depending on the first shared library to the Ath version depending on the first shared library.
在与该实施例并列的另一种可能的实现方式中,当卸载该第一共享库的第一版本时,不会修改第一应用的依赖关系,而是在每次都在第一应用启动时通过获取模块获取第一共享库的第A版本。In another possible implementation parallel to this embodiment, when the first version of the first shared library is uninstalled, the dependency of the first application is not modified, but the Ath version of the first shared library is acquired through the acquisition module each time the first application is started.
本申请实施例中,在应用使用的共享库版本被卸载时,该应用使用的共享库版本自动指向高版本共享库,这样,在应用启动时,自动启用更高版本的共享库,不会因为共享库版本的卸载而导致应用运行异常,能够提升用户的使用体验。In an embodiment of the present application, when the shared library version used by an application is uninstalled, the shared library version used by the application automatically points to a higher version of the shared library. In this way, when the application is started, the higher version of the shared library is automatically enabled, and the application will not run abnormally due to the uninstallation of the shared library version, thereby improving the user experience.
结合第三方面,在一种可能的实现方式中,获取模块还用于:响应于用户安装或更新该第一应用的操作,获取该第一应用依赖的第一共享库列表,该第一共享库列表包括M个共享库,M为大于或等于1的正整数;确定模块还用于:根据该M个共享库的安装情况确定第二共享库列表,该第二共享库列表中包括该M个共享库中的未安装的共享库;安装模块还用于:安装该第二共享库列表中的共享库,和,安装或更新该第一应用。In combination with the third aspect, in a possible implementation, the acquisition module is also used to: in response to a user's operation of installing or updating the first application, obtain a first shared library list that the first application depends on, the first shared library list including M shared libraries, M being a positive integer greater than or equal to 1; the determination module is also used to: determine a second shared library list based on the installation status of the M shared libraries, the second shared library list including uninstalled shared libraries among the M shared libraries; the installation module is also used to: install the shared libraries in the second shared library list, and install or update the first application.
本申请实施例中,能够实现共享库与三方应用共同安装,能够使得应用始终存在所依赖的共享库,能够减少应用运行失败的情况发生,提高了用户体验。In the embodiment of the present application, the shared library and the third-party application can be installed together, so that the application can always have the shared library it depends on, which can reduce the occurrence of application operation failures and improve the user experience.
结合第三方面,在一种可能的实现方式中,收发模块还用于:向系统发送第四查询消息,该第四查 询消息用于查询该M个共享库的安装情况;接收第四回复消息,该第四回复消息用于指示该M个共享库的安装情况。In conjunction with the third aspect, in a possible implementation, the transceiver module is further used to: send a fourth query message to the system, the fourth query message A query message is used to query the installation status of the M shared libraries; and a fourth reply message is received, where the fourth reply message is used to indicate the installation status of the M shared libraries.
本申请实施例中,系统向应用市场提供了共享库的安装信息的查询接口,使得应用市场能够通过该查询接口实现与系统之间的信息交互,进而从系统获取共享库的安装信息。In an embodiment of the present application, the system provides a query interface for the installation information of the shared library to the application market, so that the application market can implement information interaction with the system through the query interface, and then obtain the installation information of the shared library from the system.
结合第三方面,在一种可能的实现方式中,安装模块具体用于:将该第二共享库列表中的每个共享库分别安装在不同的路径。In conjunction with the third aspect, in a possible implementation manner, the installation module is specifically configured to: install each shared library in the second shared library list in different paths respectively.
本申请实施例中,系统进行不同版本共享库安装时,会根据版本号将不同版本的共享库安装在不同版本路径下,这样,能够使得不同版本的共享库之间相对独立,可以将同一共享库的不同版本作为不同应用处理,能够实现对共享库的特定版本的更新或者卸载等操作。In an embodiment of the present application, when the system installs different versions of shared libraries, it will install different versions of shared libraries in different version paths according to the version numbers. In this way, different versions of shared libraries can be relatively independent of each other, different versions of the same shared library can be treated as different applications, and operations such as updating or uninstalling a specific version of the shared library can be implemented.
第四方面,提供一种管理共享库的装置,该装置包括:确定模块,用于确定第三共享库列表,该第三共享库列表包括全量共享库中的未被应用依赖的共享库,和/或,该第三共享库列表包括该全量共享库中的低版本共享库,该全量共享库包括系统当前已安装的所有共享库;卸载模块,用于卸载该第三共享库列表中的共享库,该第三共享库列表中的共享库均处于当前未运行状态。In a fourth aspect, a device for managing shared libraries is provided, the device comprising: a determination module, used to determine a third shared library list, the third shared library list including shared libraries in the full shared library that are not dependent on applications, and/or the third shared library list including lower version shared libraries in the full shared library, the full shared library including all shared libraries currently installed in the system; an uninstallation module, used to uninstall shared libraries in the third shared library list, the shared libraries in the third shared library list are all in a currently non-running state.
其中,可选的,全量共享库中的每个共享库都带有自身的版本标识。Optionally, each shared library in the full shared library has its own version identifier.
本申请实施例中,共享库具有独立的卸载能力,降低了共享库提供者的开发门槛,使共享库便于管理和普及;能够及时卸载系统中不被应用依赖的共享库和低版本的共享库,能够减少系统中存储空间的占用,进而提高用户体验。In the embodiment of the present application, the shared library has an independent uninstall capability, which lowers the development threshold for shared library providers and makes the shared library easier to manage and popularize; it can timely uninstall shared libraries that are not relied on by applications in the system and low-version shared libraries, which can reduce the storage space occupied in the system and thereby improve the user experience.
结合第四方面,在一种可能的实现方式中,该装置还包括获取模块,用于获取该全量共享库的信息,该全量共享库的信息包括该全量共享库中的每个共享库的版本信息,和/或,该全量共享库的信息包括该全量共享库中的每个共享库的依赖信息,该依赖信息用于表征共享库是否被应用依赖,或该依赖信息用于表征共享库被哪些应用依赖;根据该全量共享库的信息确定第四共享库列表,该第四共享库列表包括该全量共享库中的未被应用依赖的共享库,和/或,该第四共享库列表包括该全量共享库中的低版本共享库;该获取模块还用于获取该第四共享库列表中的每个共享库的运行信息,该运行信息用于表征共享库当前是否处于运行状态;确定模块具体用于:根据该运行信息确定该第三共享库列表,该第三共享库列表中包括该第四共享库列表中的当前未运行的共享库。In combination with the fourth aspect, in a possible implementation, the device also includes an acquisition module, which is used to obtain information about the full shared library, the information about the full shared library includes version information of each shared library in the full shared library, and/or the information about the full shared library includes dependency information of each shared library in the full shared library, the dependency information is used to characterize whether the shared library is dependent on the application, or the dependency information is used to characterize which applications depend on the shared library; a fourth shared library list is determined based on the information about the full shared library, the fourth shared library list includes shared libraries in the full shared library that are not dependent on the application, and/or the fourth shared library list includes low-version shared libraries in the full shared library; the acquisition module is also used to obtain running information of each shared library in the fourth shared library list, the running information is used to characterize whether the shared library is currently in a running state; the determination module is specifically used to: determine the third shared library list based on the running information, the third shared library list includes shared libraries in the fourth shared library list that are not currently running.
其中,可选地,获取模块在第一时机获取该全量共享库的信息,该第一时机可以是周期性的时机,例如:可以是每天的晚上22:00,还可以是每天的凌晨2:00,还可以是每隔30小时,还可以是其他任意周期性时机;该第一时机还可以是因用户操作触发的时机,还可以是系统根据设备当前存储或运行情况自动确定的时机,本申请对此不作限定。Among them, optionally, the acquisition module acquires the information of the full shared library at a first time, and the first time may be a periodic time, for example: it may be 22:00 every night, or 2:00 every morning, or every 30 hours, or any other periodic time; the first time may also be a time triggered by a user operation, or a time automatically determined by the system according to the current storage or operation status of the device, and the present application does not limit this.
本申请实施例中,应用市场能够从系统获取全量共享库的版本信息和运行信息,进而确定需要卸载的共享库列表,以便于后续将该共享库列表中的共享库卸载。In an embodiment of the present application, the application market can obtain version information and operation information of all shared libraries from the system, and then determine a list of shared libraries that need to be uninstalled, so as to facilitate subsequent uninstallation of the shared libraries in the shared library list.
结合第四方面,在一种可能的实现方式中,该装置还包括收发模块,用于向系统发送第二查询消息,该第二查询消息用于查询该全量共享库的信息;还用于接收第二回复消息,该第二回复消息包括该全量共享库的信息。In combination with the fourth aspect, in a possible implementation, the device also includes a transceiver module, which is used to send a second query message to the system, and the second query message is used to query the information of the full shared library; and is also used to receive a second reply message, and the second reply message includes the information of the full shared library.
本申请实施例中,系统向应用市场提供了全量共享库信息的查询接口,使得应用市场能够通过该查询接口实现与系统之间的信息交互,进而从系统获取全量共享库信息。In an embodiment of the present application, the system provides a query interface for the full shared library information to the application market, so that the application market can implement information interaction with the system through the query interface, and then obtain the full shared library information from the system.
结合第四方面,在一种可能的实现方式中,该收发模块还用于:向系统发送第三查询消息,该第三查询消息用于第四共享库列表中的每个共享库的运行信息;接收第三回复消息,该第三回复消息用于指示该第四共享库列表中的每个共享库的运行信息。In combination with the fourth aspect, in a possible implementation method, the transceiver module is also used to: send a third query message to the system, the third query message is used for the operation information of each shared library in the fourth shared library list; receive a third reply message, the third reply message is used to indicate the operation information of each shared library in the fourth shared library list.
本申请实施例中,系统向应用市场提供了共享库的运行信息的查询接口,使得应用市场能够通过该查询接口实现与系统之间的信息交互,进而从系统获取共享库的运行信息。In an embodiment of the present application, the system provides the application market with a query interface for the running information of the shared library, so that the application market can implement information interaction with the system through the query interface, and then obtain the running information of the shared library from the system.
结合第四方面,在一种可能的实现方式中,该全量共享库中包括该第一共享库的第一版本和该第一共享库的第A版本,该第一共享库的第A版本为该第一共享库的最高版本,该装置还包括:指向模块,用于在卸载该第一共享库的第一版本时,将该第一应用所依赖的共享库版本指向该第一共享库的第A版本,该第一共享库为该第一应用依赖的共享库。In combination with the fourth aspect, in a possible implementation, the full shared library includes the first version of the first shared library and the Ath version of the first shared library, and the Ath version of the first shared library is the highest version of the first shared library. The device also includes: a pointing module, which is used to point the shared library version on which the first application depends to the Ath version of the first shared library when uninstalling the first version of the first shared library, and the first shared library is the shared library on which the first application depends.
其中,卸载该第一共享库的第一版本,包括:删除该第一共享库的第一版本的路径信息。Uninstalling the first version of the first shared library includes: deleting path information of the first version of the first shared library.
其中,指向模块将该第一应用所依赖的共享库版本指向该第一共享库的第A版本,可以理解为指向模块修改第一应用的依赖关系,也就是将第一应用的依赖关系由依赖第一共享库的第一版本指向依赖第 一共享库的第A版本。The pointing module points the shared library version that the first application depends on to the Ath version of the first shared library, which can be understood as the pointing module modifying the dependency of the first application, that is, changing the dependency of the first application from the first version of the first shared library to the Ath version of the first shared library. Version A of a shared library.
在与该实施例并列的另一种可能的实现方式中,当卸载该第一共享库的第一版本时,不会修改第一应用的依赖关系,而是在每次都在第一应用启动时通过获取模块获取第一共享库的第A版本。In another possible implementation parallel to this embodiment, when the first version of the first shared library is uninstalled, the dependency of the first application is not modified, but the Ath version of the first shared library is acquired through the acquisition module each time the first application is started.
本申请实施例中,在应用使用的共享库版本被卸载时,该应用使用的共享库版本自动指向高版本共享库,这样,在应用启动时,自动启用更高版本的共享库,不会因为共享库版本的卸载而导致应用运行异常,能够提升用户的使用体验。In an embodiment of the present application, when the shared library version used by an application is uninstalled, the shared library version used by the application automatically points to a higher version of the shared library. In this way, when the application is started, the higher version of the shared library is automatically enabled, and the application will not run abnormally due to the uninstallation of the shared library version, thereby improving the user experience.
结合第四方面,在一种可能的实现方式中,获取模块还用于:响应于用户安装或更新该第一应用的操作,获取该第一应用依赖的第一共享库列表,该第一共享库列表包括M个共享库,M为大于或等于1的正整数;确定模块还用于:根据该M个共享库的安装情况确定第二共享库列表,该第二共享库列表中包括该M个共享库中的未安装的共享库;该装置还包括安装模块,用于安装该第二共享库列表中的共享库,和,安装或更新该第一应用。In combination with the fourth aspect, in a possible implementation, the acquisition module is also used to: in response to a user's operation of installing or updating the first application, obtain a first shared library list that the first application depends on, the first shared library list including M shared libraries, M being a positive integer greater than or equal to 1; the determination module is also used to: determine a second shared library list based on the installation status of the M shared libraries, the second shared library list including uninstalled shared libraries among the M shared libraries; the device also includes an installation module for installing the shared libraries in the second shared library list, and installing or updating the first application.
本申请实施例中,能够实现共享库与三方应用共同安装,能够使得应用始终存在所依赖的共享库,能够减少应用运行失败的情况发生,提高了用户体验。In the embodiment of the present application, the shared library and the third-party application can be installed together, so that the application can always have the shared library it depends on, which can reduce the occurrence of application operation failures and improve the user experience.
结合第四方面,在一种可能的实现方式中,收发模块还用于:向系统发送第四查询消息,该第四查询消息用于查询该M个共享库的安装情况;接收第四回复消息,该第四回复消息用于指示该M个共享库的安装情况。In combination with the fourth aspect, in a possible implementation method, the transceiver module is also used to: send a fourth query message to the system, the fourth query message is used to query the installation status of the M shared libraries; receive a fourth reply message, the fourth reply message is used to indicate the installation status of the M shared libraries.
本申请实施例中,系统向应用市场提供了共享库的安装信息的查询接口,使得应用市场能够通过该查询接口实现与系统之间的信息交互,进而从系统获取共享库的安装信息。In an embodiment of the present application, the system provides a query interface for the installation information of the shared library to the application market, so that the application market can implement information interaction with the system through the query interface, and then obtain the installation information of the shared library from the system.
结合第四方面,在一种可能的实现方式中,安装模块具体用于:将该第二共享库列表中的每个共享库分别安装在不同的路径。In conjunction with the fourth aspect, in a possible implementation manner, the installation module is specifically used to: install each shared library in the second shared library list in different paths respectively.
本申请实施例中,系统进行不同版本共享库安装时,会根据版本号将不同版本的共享库安装在不同版本路径下,这样,能够使得不同版本的共享库之间相对独立,可以将同一共享库的不同版本作为不同应用处理,能够实现对共享库的特定版本的更新或者卸载等操作。In an embodiment of the present application, when the system installs different versions of shared libraries, it will install different versions of shared libraries in different version paths according to the version numbers. In this way, different versions of shared libraries can be relatively independent of each other, different versions of the same shared library can be treated as different applications, and operations such as updating or uninstalling a specific version of the shared library can be implemented.
第五方面,提供一种电子设备,该电子设备包括存储器和处理器,其中,存储器用于存储计算机程序代码,处理器用于执行存储于存储器中的计算机程序代码,以实现上述第一方面或第一方面中任一种可能实现方式中的方法,或实现上述第二方面或第二方面中任一种可能实现方式中的方法。In a fifth aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory is used to store computer program code, and the processor is used to execute the computer program code stored in the memory to implement the method in the above-mentioned first aspect or any possible implementation of the first aspect, or to implement the above-mentioned second aspect or any possible implementation of the second aspect.
第六方面,提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序或指令,当该计算机程序或指令被执行时,实现上述第一方面或第一方面中任一种可能实现方式中的方法,或实现上述第二方面或第二方面中任一种可能实现方式中的方法。In a sixth aspect, a computer-readable storage medium is provided, in which a computer program or instruction is stored. When the computer program or instruction is executed, the method in the first aspect or any possible implementation of the first aspect is implemented, or the method in the second aspect or any possible implementation of the second aspect is implemented.
第七方面,提供了一种芯片,其中存储有指令,当其在设备上运行时,使得所述芯片执行上述第一方面或第一方面中任一种可能实现方式中的方法,或执行上述第二方面或第二方面中任一种可能实现方式中的方法。In the seventh aspect, a chip is provided, in which instructions are stored. When the chip is executed on a device, the chip executes the method in the first aspect or any possible implementation of the first aspect, or executes the method in the second aspect or any possible implementation of the second aspect.
第八方面,提供了一种计算机程序产品,该计算机程序产品中包括计算机程序代码,当该计算机程序代码在计算机上运行时,实现上述第一方面或第一方面中任一种可能实现方式中的方法,或实现上述第二方面或第二方面中任一种可能实现方式中的方法。In an eighth aspect, a computer program product is provided, which includes a computer program code. When the computer program code runs on a computer, it implements the method in the first aspect or any possible implementation of the first aspect, or implements the method in the second aspect or any possible implementation of the second aspect.
图1是本申请实施例提供的一种电子设备的结构示意图;FIG1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
图2是本申请实施例提供的一种电子设备的软件结构框图;FIG2 is a software structure block diagram of an electronic device provided in an embodiment of the present application;
图3是本申请实施例提供的一种管理共享库的方法的示意性流程图;FIG3 is a schematic flow chart of a method for managing a shared library provided in an embodiment of the present application;
图4是本申请实施例提供的又一种管理共享库的方法的示意性流程图;FIG4 is a schematic flow chart of another method for managing a shared library provided in an embodiment of the present application;
图5是本申请实施例提供的一种共享库和应用同步安装的方法的示意性流程图;FIG5 is a schematic flow chart of a method for synchronously installing a shared library and an application provided in an embodiment of the present application;
图6是本申请实施例提供的多版本共享库的安装方法的示意性流程图;6 is a schematic flow chart of a method for installing a multi-version shared library provided in an embodiment of the present application;
图7是本申请实施例提供的一种更新共享库的方法的示意性流程图;FIG7 is a schematic flow chart of a method for updating a shared library provided in an embodiment of the present application;
图8是本申请实施例提供的一种卸载共享库的方法的示意性流程图;FIG8 is a schematic flow chart of a method for uninstalling a shared library provided in an embodiment of the present application;
图9是本申请实施例提供的又一种卸载共享库的方法的示意性流程图;FIG9 is a schematic flow chart of another method for uninstalling a shared library provided in an embodiment of the present application;
图10是本申请实施例提供的又一种共享库更新的方法的示意性流程图;FIG10 is a schematic flow chart of another method for updating a shared library provided in an embodiment of the present application;
图11是本申请实施例提供的一种共享库更新和卸载的方法的示意性流程图; FIG11 is a schematic flow chart of a method for updating and uninstalling a shared library provided in an embodiment of the present application;
图12是本申请实施例提供的一种应用和共享库同步安装的装置的功能模块示意图;12 is a schematic diagram of functional modules of a device for synchronously installing an application and a shared library provided in an embodiment of the present application;
图13是本申请实施例提供的一种更新共享库的装置的功能模块示意图;13 is a schematic diagram of functional modules of a device for updating a shared library provided in an embodiment of the present application;
图14是本申请实施例提供的一种卸载共享库的装置的功能模块示意图。FIG. 14 is a schematic diagram of functional modules of a device for unloading a shared library provided in an embodiment of the present application.
下面将结合附图,对本申请中的技术方案进行描述。显然,所描述的实施例仅仅是本申请的一部分实施例,而不是全部的实施例。The technical solution in the present application will be described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“复数个”或者“多个”是指两个或多于两个。The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, "/" means or, for example, A/B can mean A or B; "and/or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and/or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "plurality" or "multiple" refers to two or more than two.
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.
以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在也包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请以下各实施例中,“至少一个”、“一个或多个”是指一个、两个或两个以上。术语“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。The terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one, two or more. The term "and/or" is used to describe the association relationship of associated objects, indicating that three relationships may exist; for example, A and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character "/" generally indicates that the objects associated before and after are in an "or" relationship.
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“一个实施例”、“一些实施例”、“另一个实施例”、“另外一些实施例”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "one embodiment", "some embodiments", "another embodiment", "some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
本申请实施例提供的方法可以应用于手机、平板电脑、可穿戴设备、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等电子设备上,本申请实施例对电子设备的具体类型不作任何限制。The method provided in the embodiments of the present application can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR)/virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
以下,先对本申请实施例中涉及到的一些术语进行详细介绍。Below, some terms involved in the embodiments of the present application are first introduced in detail.
1.共享库1. Shared Libraries
一个共享程序库就是一个共享函数库,应用程序可以在运行时连接到该程序库,而不是在编译时连接。在Windows中,共享程序库被称为动态链接库;在Mac OS X系统中,称为framework;在Linux中称为共享目标。A shared library is a library of shared functions that applications can link to at runtime, rather than at compile time. In Windows, shared libraries are called dynamic link libraries; in Mac OS X, they are called frameworks; in Linux, they are called shared objects.
示例性的,图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等。Exemplarily, FIG1 shows a schematic diagram of the structure of an electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor. processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and/or neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors.
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
在一些实施例中,处理器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)接口等。In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (SIM) interface, and/or a universal serial bus (USB) interface, etc.
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现电子设备100的显示功能。The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。The USB interface 130 is an interface that complies with the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充 电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it can also power the electronic device through the power management module 141.
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the 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 number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 can provide solutions for wireless communications including 2G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
无线通信模块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转为电磁波辐射出去。The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) and the like applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering processing, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of the signal, amplify the signal, and convert it into electromagnetic waves for radiation through the antenna 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)。In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and/or a satellite based augmentation system (SBAS).
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
显示屏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的正整数。The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode (OLED), or a display panel. Light emitting diode or active-matrix organic light emitting diode (AMOLED), flexible light emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的App(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an App required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器170A收听音乐,或收听免提通话。The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备100可以设置至少一个麦克风170C。在另一些实施例中,电子设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。 Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The earphone interface 170D is used to connect a wired earphone. The earphone interface 170D may be the USB interface 130, or may be a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当电子设备100是翻盖机时,电子设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。 The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, 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. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
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采用嵌入式SIM(embedded-SIM,eSIM)卡,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an embedded SIM (eSIM) card, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
应理解,本申请实施例中的电话卡包括但不限于SIM卡、eSIM卡、全球用户识别卡(universal subscriber identity module,USIM)、通用集成电话卡(universal integrated circuit card,UICC)等等。It should be understood that the phone cards in the embodiments of the present application include but are not limited to SIM cards, eSIM cards, universal subscriber identity modules (USIM), universal integrated circuit cards (UICC), and the like.
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.
图2是本申请实施例的电子设备100的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。应用程序层可以包括一系列应用程序包。FIG2 is a software structure diagram of the electronic device 100 of an embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer. The application layer can include a series of application packages.
如图2所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。As shown in FIG. 2 , the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
如图2所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。As shown in FIG. 2 , the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。 The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime includes core libraries and virtual machines. Android Runtime is responsible for scheduling and management of the Android system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。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.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(media libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。The system library can include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
2D图形引擎是2D绘图的绘图引擎。A 2D graphics engine is a drawing engine for 2D drawings.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。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.
应理解,本申请实施例中的技术方案可以用于Android、IOS、鸿蒙等系统中。It should be understood that the technical solutions in the embodiments of the present application can be used in Android, IOS, Hongmeng and other systems.
本申请实施例的技术方案可以应用于电子设备。The technical solution of the embodiment of the present application can be applied to electronic devices.
本申请实施例中的电子设备可以是电视机、台式电脑、笔记本电脑,还可以是便携式电子设备,诸如手机、平板电脑、照相机、摄影机、录像机,还可以是其他具有存储功能的电子设备、5G网络中的电子设备或者未来演进的公用陆地移动通信网络(public land mobile network,PLMN)中的电子设备等,本申请对此不做限定。The electronic device in the embodiments of the present application may be a television, a desktop computer, a laptop computer, or a portable electronic device such as a mobile phone, a tablet computer, a camera, a camcorder, a video recorder, or other electronic devices with storage functions, electronic devices in a 5G network, or electronic devices in a future evolving public land mobile communication network (public land mobile network, PLMN), etc., and the present application does not limit this.
随着移动互联网市场的快速迭代,三方应用开发者为了提升效率、降低成本,往往会在开发过程中使用第三方代码,如共享库。目前共享库提供者可以通过动态加载的方式,将自身应用的代码能力提供给三方应用使用,这样三方应用不需要在自身的安装包里集成相关内容(包括代码、资源等),从而达到减少三方应用集成成本的目的。With the rapid iteration of the mobile Internet market, third-party application developers often use third-party code, such as shared libraries, in the development process in order to improve efficiency and reduce costs. Currently, shared library providers can provide the code capabilities of their own applications to third-party applications through dynamic loading, so that third-party applications do not need to integrate related content (including code, resources, etc.) in their own installation packages, thereby achieving the purpose of reducing the integration cost of third-party applications.
目前设备中的共享库与应用整体流程不同,共享库不具备应用的安装等机制,无法进行共享库的更新,例如:当共享库1.0版本存在问题时,共享库无法像应用一样通过更新1.1版本解决问题,而是需要依赖该共享库的所有应用进行更新并重新上更新架才能解决问题,这会导致应用的集成成本提高;并且,当系统中存在同一共享库多个版本向后兼容时,多个低版本共享库是最高版本共享库的子集,只需要存在最高版本共享库即可满足应用需求,由于目前共享库没有有效的卸载机制,没被依赖的共享库和低版本的共享库仍存储在系统中,占用了存储空间,导致存储空间的浪费;另外,目前系统中没有有效的检测共享库是否存在和共享库与三方应用共同安装的机制,这会导致三方应用安装时,当依赖的共享库在系统中不存在时,三方应用会安装失败,从而影响用户的使用体验。At present, the shared library in the device is different from the overall process of the application. The shared library does not have the mechanism of application installation, and the shared library cannot be updated. For example, when there is a problem with the shared library version 1.0, the shared library cannot solve the problem by updating the 1.1 version like the application. Instead, all applications that rely on the shared library need to be updated and re-updated to the update shelf to solve the problem, which will increase the integration cost of the application. In addition, when there are multiple versions of the same shared library in the system that are backward compatible, multiple low-version shared libraries are subsets of the highest-version shared library. Only the highest-version shared library is required to meet the application requirements. Since there is no effective uninstallation mechanism for shared libraries, undepended shared libraries and low-version shared libraries are still stored in the system, occupying storage space and causing a waste of storage space. In addition, there is no effective mechanism in the system to detect whether a shared library exists and to install a shared library together with a third-party application. This will cause the third-party application to fail to install when the dependent shared library does not exist in the system, thereby affecting the user experience.
有鉴于此,本申请实施例提供了一种管理共享库的方法、装置和电子设备,该方法可以通过手机系统、应用市场和云端等主体之间的协同,实现共享库的应用化,使得共享库有独立的开发分发安装、更新或卸载的能力,降低了共享库提供者的开发门槛,使共享库便于管理和普及;并且,系统中能够存在多个版本的共享库,应用启动时自动启用最高版本的共享库,能够使得共享库的更新得到实时体现,降低了应用开发者使用共享库时的集成成本和更新频率;另外,该方法通过系统框架与应用市场之间的协同,能够实现共享库与三方应用共同安装,还能够在特定时机卸载不被应用依赖的共享库和低版本的共享库,提高了用户体验,减少了系统中存储空间的占用。In view of this, the embodiments of the present application provide a method, device and electronic device for managing shared libraries. The method can realize the application of shared libraries through collaboration between subjects such as mobile phone systems, application markets and cloud, so that shared libraries have the ability to be independently developed, distributed, installed, updated or uninstalled, which reduces the development threshold of shared library providers and makes shared libraries easy to manage and popularize; moreover, multiple versions of shared libraries can exist in the system, and the highest version of the shared library is automatically enabled when the application is started, so that the update of the shared library can be reflected in real time, reducing the integration cost and update frequency of application developers when using shared libraries; in addition, the method can realize the joint installation of shared libraries and third-party applications through the collaboration between the system framework and the application market, and can also uninstall shared libraries that are not relied on by applications and low-version shared libraries at specific times, thereby improving user experience and reducing storage space occupied in the system.
示例性地,图3示出了本申请实施例提供的一种管理共享库的方法300的示意性流程图。如图3所示,该方法300包括:Exemplarily, Fig. 3 shows a schematic flow chart of a method 300 for managing a shared library provided in an embodiment of the present application. As shown in Fig. 3, the method 300 includes:
S301:当检测到第一共享库的第A版本上架时,判断系统中是否安装有该第一共享库的第A版本;S301: When it is detected that the Ath version of the first shared library is released, determining whether the Ath version of the first shared library is installed in the system;
S302:当确定系统中未安装该第一共享库的第A版本时,下载该第一共享库的第A版本。S302: When it is determined that the Ath version of the first shared library is not installed in the system, download the Ath version of the first shared library.
其中,第A版本为该第一共享库的最高版本。Among them, version A is the highest version of the first shared library.
S303:安装该第一共享库的第A版本;S303: Install the Ath version of the first shared library;
S304:当检测到第一应用启动时,获取该第一共享库的第A版本,以运行该第一应用,该第一共享库为该第一应用依赖的共享库。S304: When it is detected that the first application is started, the Ath version of the first shared library is obtained to run the first application, and the first shared library is a shared library that the first application depends on.
其中,当检测到第一应用启动时,获取该第一共享库的第A版本,可以是获取该第一共享库的第A版本的共享库路径,以便于第一应用根据该第一共享库的第A版本的共享库路径使用该第一共享库的第 A版本。When it is detected that the first application is started, the Ath version of the first shared library is obtained, which may be to obtain the shared library path of the Ath version of the first shared library, so that the first application uses the Ath version of the first shared library according to the shared library path of the Ath version of the first shared library. Version A.
其中,步骤S301和步骤S302在应用市场侧执行;步骤S303和步骤S304在系统侧执行。Among them, step S301 and step S302 are executed on the application market side; step S303 and step S304 are executed on the system side.
在一种可能的实现方式中,判断系统中是否安装有该第一共享库的第A版本,包括:应用市场通过向系统查询获取当前已安装的最高版本的第一共享库的信息;应用市场根据该最高版本的第一共享库的信息判断该最高版本是否是第A版本,若不是,则应用市场确定系统中未安装有该第一共享库的第A版本。In one possible implementation, determining whether version A of the first shared library is installed in the system includes: the application market obtains information about the highest version of the first shared library currently installed by querying the system; the application market determines whether the highest version is version A based on the information about the highest version of the first shared library; if not, the application market determines that version A of the first shared library is not installed in the system.
在又一种可能的实现方式中,判断系统中是否安装有该第一共享库的第A版本,包括:应用市场向系统发送询问消息,该询问消息用于询问系统是否安装了该第一共享库的第A版本,应用市场接收该询问消息的回复消息,若该回复消息为否,则应用市场确定系统中未安装有该第一共享库的第A版本。In another possible implementation, determining whether version A of the first shared library is installed in the system includes: the application market sends an inquiry message to the system, the inquiry message is used to inquire whether the system has installed version A of the first shared library, the application market receives a reply message to the inquiry message, if the reply message is no, the application market determines that version A of the first shared library is not installed in the system.
示例性地,图4示出了本申请实施例提供的又一种管理共享库的方法400的示意性流程图。如图4所示,该方法400包括:Exemplarily, Fig. 4 shows a schematic flow chart of another method 400 for managing a shared library provided in an embodiment of the present application. As shown in Fig. 4, the method 400 includes:
S401:确定第三共享库列表。S401: Determine a third shared library list.
其中,该第三共享库列表包括全量共享库中的未被应用依赖的共享库,和/或,该第三共享库列表包括该全量共享库中的低版本共享库,该全量共享库包括系统当前已安装的所有共享库。The third shared library list includes shared libraries in the full shared library that are not relied upon by the application, and/or the third shared library list includes lower-version shared libraries in the full shared library, and the full shared library includes all shared libraries currently installed in the system.
在一种实现方式中,确定第三共享库列表,包括:获取该全量共享库的信息,该全量共享库的信息包括所述全量共享库中的每个共享库的版本信息,和/或,包括该全量共享库中的每个共享库的依赖信息。In one implementation, determining the third shared library list includes: obtaining information of the full shared library, the information of the full shared library including version information of each shared library in the full shared library, and/or including dependency information of each shared library in the full shared library.
其中,依赖信息用于表征共享库是否被应用依赖,或者,该依赖信息用于表征共享库被哪些应用依赖。The dependency information is used to indicate whether the shared library is dependent on the application, or the dependency information is used to indicate which applications depend on the shared library.
其中,可选地,在第一时机获取该全量共享库的信息,该第一时机可以是周期性的时机,例如:可以是每天的晚上22:00,还可以是每天的凌晨2:00,还可以是每隔30小时,还可以是其他任意周期性时机;该第一时机还可以是因用户操作触发的时机,还可以是系统根据设备当前存储或运行情况自动确定的时机,本申请对此不作限定。Among them, optionally, the information of the full shared library is obtained at a first time, and the first time may be a periodic time, for example: it may be 22:00 every night, or 2:00 every morning, or every 30 hours, or any other periodic time; the first time may also be a time triggered by a user operation, or a time automatically determined by the system according to the current storage or operation status of the device, and the present application does not limit this.
在一些实施例中,该第三共享库列表中的共享库均处于当前未运行状态,具体地,该第三共享库列表的确定步骤可以为:In some embodiments, all shared libraries in the third shared library list are currently not running. Specifically, the step of determining the third shared library list may be:
(1)获取全量共享库的信息,该全量共享库的信息包括所述全量共享库中的每个共享库的版本信息,和/或,包括该全量共享库中的每个共享库的依赖信息。(1) Acquire information of a full shared library, where the information of the full shared library includes version information of each shared library in the full shared library and/or dependency information of each shared library in the full shared library.
(2)根据全量共享库的信息确定第四共享库列表,该第四共享库列表中包括全量共享库中的未被应用依赖的共享库,和/或,该第三共享库列表包括该全量共享库中的低版本共享库,该第四共享库列表中的共享库的当前运行状态未知。(2) determining a fourth shared library list based on information of the full shared library, wherein the fourth shared library list includes shared libraries in the full shared library that are not depended on by applications, and/or the third shared library list includes lower-version shared libraries in the full shared library, and the current running status of the shared libraries in the fourth shared library list is unknown.
(3)获取第四共享库列表中的每个共享库的运行信息,该运行信息用于表征共享库当前是否处于运行状态。(3) Obtaining running information of each shared library in the fourth shared library list, where the running information is used to indicate whether the shared library is currently in a running state.
(4)确定第三共享库列表,该第三共享库列表中包括第四共享库列表中的当前未运行的共享库。(4) Determine a third shared library list, where the third shared library list includes the currently non-running shared libraries in the fourth shared library list.
S402:卸载该第三共享库列表中的共享库。S402: Uninstall the shared libraries in the third shared library list.
其中,可选的,全量共享库中的每个共享库都带有自身的版本标识。Optionally, each shared library in the full shared library has its own version identifier.
示例性地,图5示出了本申请实施例提供的一种共享库和应用同步安装的方法500的示意性流程图。如图5所示,该方法500包括:For example, FIG5 shows a schematic flow chart of a method 500 for synchronously installing a shared library and an application provided in an embodiment of the present application. As shown in FIG5 , the method 500 includes:
S501:响应于用户安装/更新第一应用的操作,应用市场下载该第一应用的安装包,并获取该第一应用所依赖的第一共享库列表。S501: In response to a user's operation of installing/updating a first application, the application market downloads an installation package of the first application and obtains a first shared library list on which the first application depends.
可选地,应用市场从云端下载该第一应用的安装包并解析该第一应用的安装包中的配置文件,以获取该第一应用所依赖的第一共享库列表。Optionally, the application market downloads the installation package of the first application from the cloud and parses a configuration file in the installation package of the first application to obtain a first shared library list on which the first application depends.
其中,第一应用所依赖的第一共享库列表中包括第一应用所依赖的一个或多个共享库,该一个或多个共享库带有版本信息,也就是说,该第一共享库列表中可以包括一个或多个互不相同的共享库,还可以包括一个或多个版本互不相同的同一共享库。Among them, the first shared library list that the first application depends on includes one or more shared libraries that the first application depends on, and the one or more shared libraries carry version information. That is to say, the first shared library list may include one or more different shared libraries, and may also include one or more versions of the same shared library with different versions.
在一个示例中,第一共享库列表中包括第一共享库的第一版本、第一共享库的第二版本、第一共享库的第三版本、第二共享库的第一版本、第三共享库的第一版本、第三共享库的第二版本。In an example, the first shared library list includes a first version of the first shared library, a second version of the first shared library, a third version of the first shared library, a first version of the second shared library, a first version of the third shared library, and a second version of the third shared library.
S502:应用市场向包管理发送第四查询消息,该第四查询消息用于查询第一共享库列表中的共享库的安装情况。S502: The application market sends a fourth query message to the package management, where the fourth query message is used to query the installation status of the shared libraries in the first shared library list.
可选的,应用市场通过调用系统框架中的包管理查询接口,以查询第一共享库列表中的共享库的安 装情况。Optionally, the application market queries the installation directory of the shared libraries in the first shared library list by calling the package management query interface in the system framework. Installation situation.
其中,第一共享库列表中的共享库的安装情况可以是指第一共享库列表中的每个共享库的安装情况(例如:是否在系统中安装/是否在系统中存在)。The installation status of the shared libraries in the first shared library list may refer to the installation status of each shared library in the first shared library list (for example, whether it is installed in the system/whether it exists in the system).
S503:接收包管理发送的第四回复消息,该第四回复消息用于指示第一共享库列表中的共享库的安装情况。S503: Receive a fourth reply message sent by the package management, where the fourth reply message is used to indicate the installation status of the shared libraries in the first shared library list.
S504:应用市场根据第四回复消息确定第二共享库列表。S504: The application market determines a second shared library list according to the fourth reply message.
其中,该第二共享库列表中包括第一共享库列表中的未安装的共享库,和/或,该第二共享库列表中包括第一共享库列表中的已安装的共享库对应的更高版本的共享库。The second shared library list includes the uninstalled shared libraries in the first shared library list, and/or the second shared library list includes the higher version shared libraries corresponding to the installed shared libraries in the first shared library list.
可选地,应用市场根据第四回复消息确定第二共享库列表的过程可以是:Optionally, the process of the application market determining the second shared library list according to the fourth reply message may be:
(1)第一共享库列表中的一个或多个共享库中,哪些共享库是已经安装了的(或在系统中存在的),哪些共享库(或共享库更高版本)是没有安装的(或在系统中不存在的),将没有安装的(或在系统中不存在的)共享库列入第二共享库列表;(1) Among one or more shared libraries in the first shared library list, which shared libraries are already installed (or exist in the system), which shared libraries (or higher versions of shared libraries) are not installed (or do not exist in the system), and the shared libraries that are not installed (or do not exist in the system) are listed in the second shared library list;
(2)针对已安装(已存在)的共享库,该已安装(已存在)的共享库的版本是否大于或者等于第一共享库列表中的该共享库的版本,若否,则将第一共享库列表中的该共享库的版本或第一共享库列表中的该共享库的更高版本列入第二共享库列表。(2) For an installed (already existing) shared library, whether the version of the installed (already existing) shared library is greater than or equal to the version of the shared library in the first shared library list; if not, the version of the shared library in the first shared library list or a higher version of the shared library in the first shared library list is included in the second shared library list.
S505:下载第二共享库列表中的共享库。S505: Download the shared libraries in the second shared library list.
S506:安装第二共享库列表中的共享库,和,安装或更新第一应用。S506: Install the shared libraries in the second shared library list, and install or update the first application.
本申请实施例中,通过系统框架与应用市场之间的协同,能够实现共享库与三方应用共同安装,能够使得应用始终存在所依赖的共享库,能够减少应用运行失败的情况发生,提高了用户体验。In the embodiment of the present application, through the collaboration between the system framework and the application market, the shared library and the third-party application can be installed together, so that the application always has the shared library it depends on, which can reduce the occurrence of application operation failures and improve the user experience.
为了更加清楚地理解多版本共享库的安装过程,示例性地,图6示出了本申请实施例提供的多版本共享库的安装方法600的示意性流程图。如图6所示,该方法600包括:In order to more clearly understand the installation process of a multi-version shared library, illustratively, FIG6 shows a schematic flow chart of a method 600 for installing a multi-version shared library provided in an embodiment of the present application. As shown in FIG6 , the method 600 includes:
S601:当存在待安装的第一共享库的第一版本和第一共享库的第二版本时,将第一共享库的第一版本安装在第一路径下,并生成第一共享库信息;将第一共享库的第二版本安装在第二路径下,并生成第二共享库信息。S601: When there is a first version of a first shared library and a second version of the first shared library to be installed, install the first version of the first shared library in a first path and generate first shared library information; install the second version of the first shared library in a second path and generate second shared library information.
其中,第一共享库信息包括第一共享库的标识信息和第一共享库的版本信息;第二共享库信息包括第二共享库的标识信息和第二共享库的版本信息。The first shared library information includes identification information of the first shared library and version information of the first shared library; the second shared library information includes identification information of the second shared library and version information of the second shared library.
可选地,为保证系统的安全性,共享库需要的权限由依赖其的应用申请,共享库自身无法申请权限,并且,共享库自身没有数据目录。Optionally, to ensure the security of the system, the permissions required by the shared library are applied for by the applications that depend on it, and the shared library itself cannot apply for permissions, and the shared library itself does not have a data directory.
本申请实施例中,系统进行不同版本共享库安装时,会根据版本号将不同版本的共享库安装在不同版本路径下,并根据版本在系统中生成多个共享库信息,这样,能够使得不同版本的共享库之间相对独立,可以将同一共享库的不同版本作为不同应用处理,能够实现对共享库的特定版本的更新或者卸载等操作。In an embodiment of the present application, when the system installs different versions of shared libraries, it will install different versions of shared libraries in different version paths according to the version number, and generate multiple shared library information in the system according to the version. In this way, different versions of shared libraries can be relatively independent, different versions of the same shared library can be treated as different applications, and operations such as updating or uninstalling a specific version of the shared library can be implemented.
示例性地,图7示出了本申请实施例提供的一种更新共享库的方法700的示意性流程图。如图7所示,该方法700包括:For example, Fig. 7 shows a schematic flow chart of a method 700 for updating a shared library provided in an embodiment of the present application. As shown in Fig. 7, the method 700 includes:
S701:应用市场检测到第一共享库的新版本上架时,向系统发送第一查询消息,该第一查询消息用于查询第一共享库的信息。S701: When the application market detects that a new version of the first shared library is released, it sends a first query message to the system, where the first query message is used to query information of the first shared library.
其中,第一共享库的信息包括当前已安装(已存在)的一个或多个版本的第一共享库的信息。The information of the first shared library includes information of one or more versions of the first shared library that are currently installed (already existing).
在一个示例中,该一个或多个版本的第一共享库可以包括第一共享库的第一版本、第一共享库的第二版本、第一共享库的第三版本、第二共享库的第一版本、第三共享库的第一版本、第三共享库的第二版本。In an example, the one or more versions of the first shared library may include a first version of the first shared library, a second version of the first shared library, a third version of the first shared library, a first version of the second shared library, a first version of the third shared library, and a second version of the third shared library.
S702:应用市场接收系统发送的第一回复消息,该第一回复消息用于指示第一共享库的信息。S702: The application market receives a first reply message sent by the system, where the first reply message is used to indicate information of the first shared library.
S703:应用市场根据第一回复消息,确定是否需要更新第一共享库。S703: The application market determines whether the first shared library needs to be updated according to the first reply message.
具体地,应用市场根据第一回复消息确定第一共享库的信息中是否存在该上架的第一共享库的新版本,换种说法,应用市场根据第一回复消息确定该上架的第一共享库的新版本是否已经被安装(即是否已经存在),若是,则确定不需要更新第一共享库;若否,则需要更新第一共享库。Specifically, the application market determines whether the new version of the first shared library exists in the information of the first shared library based on the first reply message. In other words, the application market determines whether the new version of the first shared library has been installed (i.e., whether it already exists) based on the first reply message. If so, it is determined that the first shared library does not need to be updated; if not, the first shared library needs to be updated.
在一个示例中,应用市场检测到第一共享库的第三版本上架,应用市场获取第一共享库的信息后,确定该第一共享库的信息中是否存在第一共享库的第三版本的信息,若不存在,则确定需要更新第一共享库。 In one example, the application market detects that the third version of the first shared library is released. After obtaining the information of the first shared library, the application market determines whether the information of the third version of the first shared library exists in the information of the first shared library. If not, it determines that the first shared library needs to be updated.
S704:当确定需要更新第一共享库时,下载该第一共享库的新版本。S704: When it is determined that the first shared library needs to be updated, a new version of the first shared library is downloaded.
在一个示例中,应用市场检测到第一共享库的第三版本上架,当确定需要更新该第一共享库时,下载第一共享库的第三版本。In one example, the application market detects that the third version of the first shared library is released, and when it is determined that the first shared library needs to be updated, the third version of the first shared library is downloaded.
S705:安装该第一共享库的新版本。S705: Install the new version of the first shared library.
可选地,系统在特定时机安装该第一共享库的新版本。Optionally, the system installs a new version of the first shared library at a specific time.
可选地,该特定时机例如可以是依赖该第一共享库的应用处于未运行状态时。Optionally, the specific timing may be, for example, when an application that depends on the first shared library is not running.
在一个示例中,应用市场检测到第一共享库的第三版本上架,当确定需要更新该第一共享库时,下载并安装第一共享库的第三版本。In one example, the application market detects that the third version of the first shared library is released, and when it is determined that the first shared library needs to be updated, the third version of the first shared library is downloaded and installed.
S706:当依赖该第一共享库的应用启动时,获取该第一共享库的最高版本。S706: When the application that depends on the first shared library is started, the highest version of the first shared library is obtained.
获取该第一共享库的最高版本,可以是获取该第一共享库的最高版本的共享库路径。Obtaining the highest version of the first shared library may be obtaining a shared library path of the highest version of the first shared library.
在一个示例中,第一共享库更新后,该第一共享库的第三版本为该第一共享库的最高版本,那么,当依赖该第一共享库的应用启动时,启用该第一共享库的第三版本。In one example, after the first shared library is updated, the third version of the first shared library is the highest version of the first shared library. Then, when the application that depends on the first shared library is started, the third version of the first shared library is enabled.
在一种可能的实现形式中,当前系统兼容多版本共享库,例如:第一共享库进行版本更新后,当依赖该第一共享库的应用启动时,获取该第一共享库的最高版本的共享库路径。In a possible implementation form, the current system is compatible with multiple versions of shared libraries. For example, after a first shared library is updated, when an application that depends on the first shared library is started, the shared library path of the highest version of the first shared library is obtained.
在又一种可能的实现形式中,当前系统不兼容多版本共享库,例如:第一共享库进行版本更新后,当依赖该第一共享库的应用启动时,获取系统配置的共享库的路径。In another possible implementation form, the current system is not compatible with multiple versions of shared libraries. For example, after a first shared library is updated, when an application that depends on the first shared library is started, the path of the shared library configured by the system is obtained.
本申请实施例中,通过手机系统、应用市场之间的协同,实现多版本共享库的更新,使得共享库有独立的更新能力,降低了共享库提供者的开发门槛,使共享库便于管理和普及;并且,系统中能够在应用启动时自动启用所依赖的共享库的最高版本,能够使得共享库的更新得到实时体现,从而能够降低应用开发者使用共享库时的集成成本和更新频率。In the embodiments of the present application, the update of multiple versions of shared libraries is achieved through the collaboration between the mobile phone system and the application market, so that the shared libraries have independent update capabilities, lowering the development threshold for shared library providers, making shared libraries easier to manage and popularize; and, the system can automatically enable the highest version of the shared library it depends on when the application is started, so that the update of the shared library can be reflected in real time, thereby reducing the integration cost and update frequency of application developers when using shared libraries.
示例性地,图8示出了本申请实施例提供的一种卸载共享库的方法800的示意性流程图。如图8所示,该方法800包括:Exemplarily, Fig. 8 shows a schematic flow chart of a method 800 for uninstalling a shared library provided in an embodiment of the present application. As shown in Fig. 8, the method 800 includes:
S801:应用市场在第一时机向系统发送第二查询消息,该第二查询消息用于查询设备中的全量共享库的信息。S801: The application market sends a second query message to the system at a first opportunity, where the second query message is used to query information of a full shared library in a device.
可选地,应用市场调用系统接口查询设备中的全量共享库的信息。Optionally, the application market calls a system interface to query information of the full shared library in the device.
其中,全量共享库包括当前系统中已安装(已存在)的一个或多个共享库,该一个或多个共享库带有版本信息。The full shared library includes one or more shared libraries installed (already existing) in the current system, and the one or more shared libraries carry version information.
其中,全量共享库的信息包括全量共享库中的每个共享库的版本信息,和/或,包括全量共享库中的每个共享库的依赖信息。The information of the full shared library includes version information of each shared library in the full shared library, and/or includes dependency information of each shared library in the full shared library.
其中,依赖信息用于表征共享库是否被应用依赖,或者,该依赖信息用于表征共享库被哪些应用依赖。The dependency information is used to indicate whether the shared library is dependent on the application, or the dependency information is used to indicate which applications depend on the shared library.
在一个示例中,该一个或多个共享库可以包括第一共享库的第一版本、第一共享库的第二版本、第一共享库的第三版本、第二共享库的第一版本、第三共享库的第一版本、第三共享库的第二版本。In one example, the one or more shared libraries may include a first version of a first shared library, a second version of the first shared library, a third version of the first shared library, a first version of the second shared library, a first version of the third shared library, and a second version of the third shared library.
S802:应用市场接收系统发送的第二回复消息,该第二回复消息用于指示全量共享库的信息。S802: The application market receives a second reply message sent by the system, where the second reply message is used to indicate information about the full shared library.
S803:根据第二回复消息确定第四共享库列表。S803: Determine a fourth shared library list according to the second reply message.
其中,该第四共享库列表中包括全量共享库中的未被应用依赖的共享库,和/或,该第三共享库列表包括该全量共享库中的低版本共享库,该第四共享库列表中的共享库的当前运行状态未知。The fourth shared library list includes shared libraries in the full shared library that are not relied upon by the application, and/or the third shared library list includes low-version shared libraries in the full shared library, and the current running status of the shared libraries in the fourth shared library list is unknown.
S804:应用市场向系统发送第三查询消息,该第三查询消息用于查询该第四共享库列表中的每个共享库的运行信息,该运行信息用于表征共享库当前是否处于运行状态。可选地,应用市场根据全量共享库的信息调用系统接口查询该第四共享库列表中的每个共享库的运行信息。S804: The application market sends a third query message to the system, the third query message is used to query the running information of each shared library in the fourth shared library list, the running information is used to indicate whether the shared library is currently in a running state. Optionally, the application market calls the system interface to query the running information of each shared library in the fourth shared library list according to the information of all shared libraries.
在一个示例中,全量共享库的信息中包括多个共享库的信息,该多个共享库例如可以包括第一共享库的第一版本、第一共享库的第二版本、第一共享库的第三版本、第二共享库的第一版本、第三共享库的第一版本、第三共享库的第二版本。In one example, the information of the full shared library includes information of multiple shared libraries, which may, for example, include a first version of a first shared library, a second version of the first shared library, a third version of the first shared library, a first version of the second shared library, a first version of the third shared library, and a second version of the third shared library.
S805:应用市场接收系统发送的第三回复消息,该第三回复消息用于指示该第四共享库列表中的每个共享库的运行信息。S805: The application market receives a third reply message sent by the system, where the third reply message is used to indicate the running information of each shared library in the fourth shared library list.
S806:应用市场根据第三回复消息确定第三共享库列表,该第三共享库列表中包括第四共享库列表中的当前未运行的共享库。S806: The application market determines a third shared library list according to the third reply message, where the third shared library list includes the currently non-running shared libraries in the fourth shared library list.
也就是说,应用市场根据该第四共享库列表和该第四共享库列表中的每个共享库的运行信息确定第 三共享库列表。That is, the application market determines the fourth shared library list and the operation information of each shared library in the fourth shared library list. 3. List of shared libraries.
其中,第三共享库列表中包括全量共享库中的未被应用依赖的共享库和/或包括被应用依赖的共享库的多个版本中的低版本共享库,其中,低版本共享库为非最高版本共享库,第三共享库列表中的共享库均处于当前未运行状态。Among them, the third shared library list includes shared libraries in the full shared libraries that are not dependent on the application and/or includes low-version shared libraries in multiple versions of shared libraries that are dependent on the application, wherein the low-version shared libraries are non-highest version shared libraries, and the shared libraries in the third shared library list are all in the currently non-running state.
S807:卸载第三共享库列表中的共享库。S807: Uninstall the shared libraries in the third shared library list.
本申请实施例中,通过系统和应用市场之间的协同,使得共享库有独立的卸载能力,降低了共享库提供者的开发门槛,使共享库便于管理和普及;还能够在特定时机卸载不被应用依赖的共享库和低版本的共享库,提高了用户体验,减少了系统中存储空间的占用;并且,在卸载(老化)机制上,具体分为兼容多版本共享库和不兼容多版本共享库两种情况,对于兼容多版本共享库的情况,可以老化低版本共享库;对于不兼容多版本共享库的情况,可以老化不使用或不常使用的共享库,使得该方案的适用范围更广。In the embodiments of the present application, through the collaboration between the system and the application market, the shared library has an independent uninstall capability, which lowers the development threshold of the shared library provider and makes the shared library easy to manage and popularize; it is also possible to uninstall shared libraries that are not relied on by the application and low-version shared libraries at specific times, which improves the user experience and reduces the storage space occupied in the system; and in terms of the uninstall (aging) mechanism, it is specifically divided into two cases: compatible with multi-version shared libraries and incompatible with multi-version shared libraries. For the case of compatible with multi-version shared libraries, the low-version shared libraries can be aged; for the case of incompatible with multi-version shared libraries, unused or infrequently used shared libraries can be aged, making the scope of application of the solution wider.
为了更加清楚地理解图8所示实施例中所述的卸载共享库的方法,示例性地,图9示出了本申请实施例提供的又一种卸载共享库的方法900的示意性流程图。如图9所示,该方法900包括:In order to more clearly understand the method for uninstalling a shared library in the embodiment shown in FIG8 , illustratively, FIG9 shows a schematic flow chart of another method 900 for uninstalling a shared library provided in an embodiment of the present application. As shown in FIG9 , the method 900 includes:
在本实施例中,第一共享库更新后包括第一共享库的第一版本和第一共享库的第A版本,该第A版本为第一共享库的最高版本。In this embodiment, after being updated, the first shared library includes a first version of the first shared library and an Ath version of the first shared library, and the Ath version is the highest version of the first shared library.
S901:当卸载第一共享库的第一版本时,删除该第一共享库的第一版本的路径信息。S901: When uninstalling the first version of the first shared library, deleting the path information of the first version of the first shared library.
可以理解:卸载第一共享库的第一版本后,只删除了该第一共享库的第一版本的路径信息,第一共享库的其他版本的路径信息仍然保留。It can be understood that after uninstalling the first version of the first shared library, only the path information of the first version of the first shared library is deleted, and the path information of other versions of the first shared library is still retained.
本申请实施例中,将同一共享库的不同版本作为不同应用处理,目标版本的共享库卸载时,只卸载目标版本的共享库,其他版本的共享库仍保留,能够使得多版本共享库拥有独立的卸载能力。In an embodiment of the present application, different versions of the same shared library are treated as different applications. When a target version of a shared library is uninstalled, only the target version of the shared library is uninstalled, and other versions of the shared library are still retained, thereby enabling multiple versions of the shared library to have independent uninstall capabilities.
在一种可实现的方式中,当第一应用卸载时,先判断该第一应用依赖的第一共享库是否还被其他应用依赖,若没有,则同时卸载该第一共享库。In one achievable manner, when a first application is uninstalled, it is first determined whether a first shared library that the first application depends on is also depended on by other applications. If not, the first shared library is uninstalled at the same time.
示例性地,图10示出了本申请实施例提供的又一种管理共享库的方法1000的示意性流程图。如图10所示,该方法1000包括:Exemplarily, Fig. 10 shows a schematic flow chart of another method 1000 for managing a shared library provided in an embodiment of the present application. As shown in Fig. 10, the method 1000 includes:
在本实施例中,第一应用当前所依赖的共享库为第一共享库的第一版本,第一共享库更新后包括第一共享库的第一版本和第一共享库的第A版本,该第A版本为第一共享库的最高版本。In this embodiment, the shared library currently relied on by the first application is the first version of the first shared library. After being updated, the first shared library includes the first version of the first shared library and the Ath version of the first shared library, and the Ath version is the highest version of the first shared library.
S1001:当卸载第一共享库的第一版本时,将第一应用所依赖的共享库自动指向第一共享库的第A版本。S1001: When the first version of the first shared library is uninstalled, the shared library on which the first application depends is automatically pointed to the Ath version of the first shared library.
本申请实施例中,在应用依赖的共享库版本被卸载时,该应用依赖的共享库版本自动指向最高版本的共享库,这样,在应用启动时,自动获取最高版本的共享库路径,不会因为共享库版本的卸载而导致应用运行异常,能够提升用户的使用体验。In an embodiment of the present application, when the shared library version that the application depends on is uninstalled, the shared library version that the application depends on automatically points to the highest version of the shared library. In this way, when the application is started, the path of the shared library with the highest version is automatically obtained, and the application will not run abnormally due to the uninstallation of the shared library version, which can improve the user experience.
示例性地,图11示出了本申请实施例提供的一种共享库更新和卸载的方法100的示意性流程图。如图11所示,该方法1100包括:For example, FIG11 shows a schematic flow chart of a method 100 for updating and uninstalling a shared library provided in an embodiment of the present application. As shown in FIG11 , the method 1100 includes:
S1101:共享库提供方(或共享库使用方)将共享库作为应用中的一种特殊类型进行开发分发与安装。S1101: A shared library provider (or a shared library user) develops, distributes, and installs a shared library as a special type of application.
S1102:共享库提供方从共享库模块(library module)导出接口包(har module)和执行包。S1102: The shared library provider exports the interface package (har module) and execution package from the shared library module (library module).
S1103:将该接口包(har module)和执行包上传到应用市场,以保证共享库版本向后兼容。S1103: Upload the interface package (har module) and execution package to the application market to ensure backward compatibility of the shared library version.
S1104:共享库使用方通过应用市场集成接口包完成自身应用开发。S1104: The shared library user completes its own application development through the application market integration interface package.
S1105:将开发的应用上架到应用市场。S1105: Put the developed application on the application market.
S1106:当用户触发该应用的安装操作时,执行步骤S1107。S1106: When the user triggers the installation operation of the application, execute step S1107.
S1107:下载该应用所依赖的共享库。S1107: Download the shared library that the application depends on.
S1108:安装该应用所依赖的共享库。S1108: Install the shared libraries that the application depends on.
S1109:安装该应用。S1109: Install the application.
S1110:当用户触发启动该应用时,进一步执行步骤S1111。S1110: When the user triggers the start of the application, step S1111 is further executed.
S1111:运行管理模块从包管理获取该应用相关的信息。S1111: The operation management module obtains information related to the application from the package management.
S1112:运行管理模块向应用孵化模块(AppSpawn)传递启动参数。S1112: The operation management module passes startup parameters to the application incubation module (AppSpawn).
S1113:应用孵化模块从共享库模块(library module)搜索共享库路径。S1113: The application incubation module searches for the shared library path from the shared library module (library module).
S1114:应用孵化模块获取该应用依赖的最高版本的共享库路径,进入应用进程。S1114: The application incubation module obtains the highest version of the shared library path that the application depends on and enters the application process.
示例性地,图12示出了本申请实施例提供的一种应用和共享库同步安装的装置1200的功能模块示 意图。如图12所示,该装置1200包括:For example, FIG. 12 shows a functional module diagram of a device 1200 for synchronously installing an application and a shared library provided in an embodiment of the present application. As shown in FIG12 , the device 1200 includes:
第一获取模块1210,用于响应于用户安装/更新第一应用的操作,下载该第一应用的安装包,并获取该第一应用所依赖的第一共享库列表。The first acquisition module 1210 is used to download the installation package of the first application in response to the user's operation of installing/updating the first application, and to acquire a first shared library list on which the first application depends.
可选地,第一获取模块1210从云端下载该第一应用的安装包并解析该第一应用的安装包中的配置文件,以获取该第一应用所依赖的第一共享库列表。Optionally, the first acquisition module 1210 downloads the installation package of the first application from the cloud and parses a configuration file in the installation package of the first application to obtain a first shared library list on which the first application depends.
其中,第一应用所依赖的第一共享库列表中包括第一应用所依赖的一个或多个共享库,该一个或多个共享库带有版本信息,也就是说,该第一共享库列表中可以包括一个或多个互不相同的共享库,还可以包括一个或多个版本互不相同的同一共享库。Among them, the first shared library list that the first application depends on includes one or more shared libraries that the first application depends on, and the one or more shared libraries carry version information. That is to say, the first shared library list may include one or more different shared libraries, and may also include one or more versions of the same shared library with different versions.
在一个示例中,第一共享库列表中包括第一共享库的第一版本、第一共享库的第二版本、第一共享库的第三版本、第二共享库的第一版本、第三共享库的第一版本、第三共享库的第二版本。In an example, the first shared library list includes a first version of the first shared library, a second version of the first shared library, a third version of the first shared library, a first version of the second shared library, a first version of the third shared library, and a second version of the third shared library.
第一收发模块1220,用于向包管理模块发送第四查询消息,该第四查询消息用于查询第一共享库列表中的共享库的安装情况。The first transceiver module 1220 is used to send a fourth query message to the package management module, where the fourth query message is used to query the installation status of the shared libraries in the first shared library list.
可选的,应用市场通过调用系统框架中的包管理查询接口,以查询第一共享库列表中的共享库的安装情况。Optionally, the application market queries the installation status of the shared libraries in the first shared library list by calling a package management query interface in the system framework.
其中,第一共享库列表中的共享库的安装情况可以是指第一共享库列表中的每个共享库的安装情况(例如:是否在系统中安装/是否在系统中存在)。The installation status of the shared libraries in the first shared library list may refer to the installation status of each shared library in the first shared library list (for example, whether it is installed in the system/whether it exists in the system).
第一收发模块1220,还用于接收包管理模块发送的第四回复消息,该第四回复消息用于指示第一共享库列表中的共享库的安装情况。The first transceiver module 1220 is further used to receive a fourth reply message sent by the package management module, where the fourth reply message is used to indicate the installation status of the shared libraries in the first shared library list.
第一确定模块1230,用于根据第四回复消息确定第二共享库列表。The first determining module 1230 is configured to determine a second shared library list according to the fourth reply message.
其中,该第二共享库列表中包括第一共享库列表中的未安装的共享库,和/或,该第二共享库列表中包括第一共享库列表中的已安装的共享库对应的更高版本的共享库。The second shared library list includes the uninstalled shared libraries in the first shared library list, and/or the second shared library list includes the higher version shared libraries corresponding to the installed shared libraries in the first shared library list.
可选地,第一确定模块1230根据第四回复消息确定第二共享库列表的过程可以是:Optionally, the process of the first determining module 1230 determining the second shared library list according to the fourth reply message may be:
(1)第一共享库列表中的一个或多个共享库中,哪些共享库是已经安装了的(或在系统中存在的),哪些共享库(或共享库更高版本)是没有安装的(或在系统中不存在的),第一确定模块1230将没有安装的(或在系统中不存在的)共享库列入第二共享库列表;(1) Among the one or more shared libraries in the first shared library list, which shared libraries are already installed (or exist in the system), and which shared libraries (or higher versions of shared libraries) are not installed (or do not exist in the system), and the first determination module 1230 lists the shared libraries that are not installed (or do not exist in the system) in the second shared library list;
(2)针对已安装(已存在)的共享库,该已安装(已存在)的共享库的版本是否大于或者等于第一共享库列表中的该共享库的版本,若否,则第一确定模块1230将第一共享库列表中的该共享库的版本或第一共享库列表中的该共享库的更高版本列入第二共享库列表。(2) For an installed (already existing) shared library, whether the version of the installed (already existing) shared library is greater than or equal to the version of the shared library in the first shared library list; if not, the first determination module 1230 includes the version of the shared library in the first shared library list or a higher version of the shared library in the first shared library list in the second shared library list.
第一获取模块1210,还用于下载第二共享库列表中的共享库。The first acquisition module 1210 is further configured to download the shared libraries in the second shared library list.
第一安装模块1240,用于安装第二共享库列表中的共享库,和,安装或更新第一应用。The first installation module 1240 is used to install the shared libraries in the second shared library list, and install or update the first application.
本申请实施例中,通过系统框架与应用市场之间的协同,能够实现共享库与三方应用共同安装,能够使得应用始终存在所依赖的共享库,能够减少应用运行失败的情况发生,提高了用户体验。In the embodiment of the present application, through the collaboration between the system framework and the application market, the shared library and the third-party application can be installed together, so that the application always has the shared library it depends on, which can reduce the occurrence of application operation failures and improve the user experience.
示例性地,图13示出了本申请实施例提供的一种更新共享库的装置1300的功能模块示意图。如图13所示,该装置1300包括:For example, Fig. 13 shows a functional module diagram of a device 1300 for updating a shared library provided in an embodiment of the present application. As shown in Fig. 13, the device 1300 includes:
第二收发模块1310,用于在检测到第一共享库的新版本上架时,向系统发送第一查询消息,该第一查询消息用于查询第一共享库的信息。The second transceiver module 1310 is used to send a first query message to the system when detecting that a new version of the first shared library is released, where the first query message is used to query information of the first shared library.
其中,第一共享库的信息包括当前已安装(已存在)的一个或多个版本的第一共享库的信息。The information of the first shared library includes information of one or more versions of the first shared library that are currently installed (already existing).
在一个示例中,该一个或多个版本的第一共享库可以包括第一共享库的第一版本、第一共享库的第二版本、第一共享库的第三版本、第二共享库的第一版本、第三共享库的第一版本、第三共享库的第二版本。In an example, the one or more versions of the first shared library may include a first version of the first shared library, a second version of the first shared library, a third version of the first shared library, a first version of the second shared library, a first version of the third shared library, and a second version of the third shared library.
第二收发模块1310,还用于接收系统发送的第一回复消息,该第一回复消息用于指示第一共享库的信息。The second transceiver module 1310 is further used to receive a first reply message sent by the system, where the first reply message is used to indicate information of the first shared library.
第二确定模块1320,用于根据第一回复消息,确定是否需要更新第一共享库。The second determination module 1320 is configured to determine whether the first shared library needs to be updated according to the first reply message.
具体地,第二确定模块1320根据第一回复消息确定第一共享库的信息中是否存在该上架的第一共享库的新版本,换种说法,第二确定模块1120根据第一回复消息确定该上架的第一共享库的新版本是否已经被安装(即是否已经存在),若是,则确定不需要更新第一共享库;若否,则需要更新第一共享库。Specifically, the second determination module 1320 determines whether there is a new version of the first shared library in the information of the first shared library based on the first reply message. In other words, the second determination module 1120 determines whether the new version of the first shared library has been installed (i.e., whether it already exists) based on the first reply message. If so, it is determined that the first shared library does not need to be updated; if not, the first shared library needs to be updated.
在一个示例中,检测到第一共享库的第三版本上架时,第二收发模块1310获取第一共享库的信息后,第二确定模块1320确定该第一共享库的信息中是否存在第一共享库的第三版本的信息,若不存在,则第 二确定模块1320确定需要更新第一共享库。In one example, when it is detected that the third version of the first shared library is released, after the second transceiver module 1310 obtains the information of the first shared library, the second determination module 1320 determines whether the information of the first shared library contains the information of the third version of the first shared library. If not, the second determination module 1320 determines whether the information of the first shared library contains the information of the third version of the first shared library. The second determination module 1320 determines that the first shared library needs to be updated.
第二获取模块1330,用于在确定需要更新第一共享库时,下载该第一共享库的新版本。The second acquisition module 1330 is configured to download a new version of the first shared library when it is determined that the first shared library needs to be updated.
在一个示例中,检测到第一共享库的第三版本上架,当第二确定模块1320确定需要更新该第一共享库时,第二获取模块(或下载模块)1330下载第一共享库的第三版本。In one example, it is detected that the third version of the first shared library is released, and when the second determination module 1320 determines that the first shared library needs to be updated, the second acquisition module (or downloading module) 1330 downloads the third version of the first shared library.
第二安装模块1340,用于安装该第一共享库的新版本。The second installation module 1340 is used to install the new version of the first shared library.
可选地,第二安装模块1340在特定时机安装该第一共享库的新版本。Optionally, the second installation module 1340 installs the new version of the first shared library at a specific time.
可选地,该特定时机例如可以是依赖该第一共享库的应用处于未运行状态时。Optionally, the specific timing may be, for example, when an application that depends on the first shared library is not running.
第二获取模块1330,还用于在依赖该第一共享库的应用启动时,获取该第一共享库的最高版本。The second acquisition module 1330 is further configured to acquire the highest version of the first shared library when the application that depends on the first shared library is started.
获取该第一共享库的最高版本,可以是获取该第一共享库的最高版本的共享库路径。Obtaining the highest version of the first shared library may be obtaining a shared library path of the highest version of the first shared library.
在一个示例中,第一共享库更新后,该第一共享库的第三版本为该第一共享库的最高版本,那么,当依赖该第一共享库的应用启动时,启用该第一共享库的第三版本。In one example, after the first shared library is updated, the third version of the first shared library is the highest version of the first shared library. Then, when the application that depends on the first shared library is started, the third version of the first shared library is enabled.
本申请实施例中,通过手机系统、应用市场之间的协同,实现多版本共享库的更新,使得共享库有独立的更新能力,降低了共享库提供者的开发门槛,使共享库便于管理和普及;并且,系统中能够在应用启动时自动启用所依赖的共享库的最高版本,能够使得共享库的更新得到实时体现,从而能够降低应用开发者使用共享库时的集成成本和更新频率。In the embodiments of the present application, the update of multiple versions of shared libraries is achieved through the collaboration between the mobile phone system and the application market, so that the shared libraries have independent update capabilities, lowering the development threshold for shared library providers, making shared libraries easier to manage and popularize; and, the system can automatically enable the highest version of the shared library it depends on when the application is started, so that the update of the shared library can be reflected in real time, thereby reducing the integration cost and update frequency of application developers when using shared libraries.
示例性地,图14示出了本申请实施例提供的一种卸载共享库的装置1400的功能模块示意图。如图14所示,该装置1400包括:For example, Fig. 14 shows a functional module diagram of a device 1400 for uninstalling a shared library provided in an embodiment of the present application. As shown in Fig. 14, the device 1400 includes:
第三收发模块1410,用于在第一时机向系统发送第二查询消息,该第二查询消息用于查询设备中的全量共享库的信息。The third transceiver module 1410 is used to send a second query message to the system at a first opportunity, where the second query message is used to query information of the full shared library in the device.
可选地,第三收发模块1410调用系统接口获取设备中的全量共享库的信息。Optionally, the third transceiver module 1410 calls a system interface to obtain information of a full shared library in the device.
其中,全量共享库是指包括当前已安装(已存在)的一个或多个共享库,该一个或多个共享库带有版本信息。The full shared library refers to one or more shared libraries that are currently installed (already exist), and the one or more shared libraries carry version information.
其中,全量共享库的信息包括全量共享库中的每个共享库的版本信息,和/或,包括全量共享库中的每个共享库的依赖信息。The information of the full shared library includes version information of each shared library in the full shared library, and/or includes dependency information of each shared library in the full shared library.
其中,依赖信息用于表征共享库是否被应用依赖,或者,该依赖信息用于表征共享库被哪些应用依赖。The dependency information is used to indicate whether the shared library is dependent on the application, or the dependency information is used to indicate which applications depend on the shared library.
在一个示例中,该一个或多个共享库可以包括第一共享库的第一版本、第一共享库的第二版本、第一共享库的第三版本、第二共享库的第一版本、第三共享库的第一版本、第三共享库的第二版本。In one example, the one or more shared libraries may include a first version of a first shared library, a second version of the first shared library, a third version of the first shared library, a first version of the second shared library, a first version of the third shared library, and a second version of the third shared library.
第三收发模块1410,还用于接收系统发送的第二回复消息,该第二回复消息用于指示全量共享库的信息。The third transceiver module 1410 is further used to receive a second reply message sent by the system, where the second reply message is used to indicate information about the full shared library.
第三确定模块1420,用于根据第二回复消息确定第四共享库列表。The third determining module 1420 is configured to determine a fourth shared library list according to the second reply message.
其中,该第四共享库列表中包括全量共享库中的未被应用依赖的共享库,和/或,该第三共享库列表包括该全量共享库中的低版本共享库,该第四共享库列表中的共享库的当前运行状态未知。The fourth shared library list includes shared libraries in the full shared library that are not relied upon by the application, and/or the third shared library list includes low-version shared libraries in the full shared library, and the current running status of the shared libraries in the fourth shared library list is unknown.
第三收发模块1410,还用于向系统发送第三查询消息,该第三查询消息用于查询该第四共享库列表中的每个共享库的运行信息,该运行信息用于表征共享库当前是否处于运行状态。The third transceiver module 1410 is further used to send a third query message to the system, where the third query message is used to query the running information of each shared library in the fourth shared library list, where the running information is used to indicate whether the shared library is currently in a running state.
可选地,第三收发模块1410根据全量共享库的信息调用系统接口获取该第四共享库列表中的每个共享库的运行信息。Optionally, the third transceiver module 1410 calls a system interface according to the information of all shared libraries to obtain the running information of each shared library in the fourth shared library list.
在一个示例中,全量共享库的信息中包括多个共享库的信息,该多个共享库例如可以包括第一共享库的第一版本、第一共享库的第二版本、第一共享库的第三版本、第二共享库的第一版本、第三共享库的第一版本、第三共享库的第二版本。In one example, the information of the full shared library includes information of multiple shared libraries, which may, for example, include a first version of a first shared library, a second version of the first shared library, a third version of the first shared library, a first version of the second shared library, a first version of the third shared library, and a second version of the third shared library.
第三收发模块1410,还用于接收系统发送的第三回复消息,该第三回复消息用于指示该第四共享库列表中的每个共享库的运行信息。The third transceiver module 1410 is further used to receive a third reply message sent by the system, where the third reply message is used to indicate the running information of each shared library in the fourth shared library list.
第三确定模块1420,用于根据第三回复消息确定第三共享库列表,该第三共享库列表中包括第四共享库列表中的当前未运行的共享库。The third determining module 1420 is configured to determine a third shared library list according to the third reply message, where the third shared library list includes the currently non-running shared libraries in the fourth shared library list.
也就是说,第三确定模块1420用于根据该第四共享库列表和该第四共享库列表中的每个共享库的运行信息确定第三共享库列表。That is, the third determining module 1420 is configured to determine the third shared library list according to the fourth shared library list and the running information of each shared library in the fourth shared library list.
其中,第三共享库列表中包括上述全量共享中的未被应用依赖的共享库,和/或包括被应用依赖的共享库的多个版本中的低版本共享库,其中,低版本共享库为非最高版本共享库,第三共享库列表中的共 享库均处于当前未运行状态。The third shared library list includes the shared libraries in the above-mentioned full sharing that are not relied on by the application, and/or includes the lower version shared libraries in multiple versions of the shared libraries relied on by the application, wherein the lower version shared libraries are non-highest version shared libraries, and the shared libraries in the third shared library list are The shared libraries are not currently running.
卸载模块1430,用于卸载第三共享库列表中的共享库。The uninstall module 1430 is used to uninstall the shared libraries in the third shared library list.
本申请实施例中,通过系统和应用市场之间的协同,使得共享库有独立的卸载能力,降低了共享库提供者的开发门槛,使共享库便于管理和普及;还能够在特定时机卸载不被应用依赖的共享库和低版本的共享库,提高了用户体验,减少了系统中存储空间的占用;并且,在卸载(老化)机制上,具体分为兼容多版本共享库和不兼容多版本共享库两种情况,对于兼容多版本共享库的情况,可以老化低版本共享库;对于不兼容多版本共享库的情况,可以老化不使用或不常使用的共享库,使得该方案的适用范围更广。In the embodiments of the present application, through the collaboration between the system and the application market, the shared library has an independent uninstall capability, which lowers the development threshold of the shared library provider and makes the shared library easy to manage and popularize; it is also possible to uninstall shared libraries that are not relied on by the application and low-version shared libraries at specific times, which improves the user experience and reduces the storage space occupied in the system; and in terms of the uninstall (aging) mechanism, it is specifically divided into two cases: compatible with multi-version shared libraries and incompatible with multi-version shared libraries. For the case of compatible with multi-version shared libraries, the low-version shared libraries can be aged; for the case of incompatible with multi-version shared libraries, unused or infrequently used shared libraries can be aged, making the scope of application of the solution wider.
本申请实施例还提供一种计算机可读介质,该计算机可读介质存储有程序代码,当该计算机程序代码在计算机上运行时,使得该计算机执行上述图3至图11中的任一种方法。An embodiment of the present application also provides a computer-readable medium, which stores a program code. When the computer program code runs on a computer, the computer executes any one of the methods in Figures 3 to 11 above.
本申请实施例还提供一种芯片,包括:至少一个处理器和存储器,该至少一个处理器与该存储器耦合,用于读取并执行该存储器中的指令,以执行上述图3至图11中的任一种方法。An embodiment of the present application also provides a chip, including: at least one processor and a memory, wherein the at least one processor is coupled to the memory and is used to read and execute instructions in the memory to execute any one of the methods in Figures 3 to 11 above.
本申请实施例还提供一种电子设备,包括:至少一个处理器和存储器,该至少一个处理器与该存储器耦合,用于读取并执行该存储器中的指令,以执行上述图3至图11中的任一种方法。An embodiment of the present application also provides an electronic device, comprising: at least one processor and a memory, wherein the at least one processor is coupled to the memory and is used to read and execute instructions in the memory to execute any one of the methods in Figures 3 to 11 above.
以上各个实施例可以单独使用,也可以相互结合使用,以实现不同的技术效果。The above embodiments may be used alone or in combination with each other to achieve different technical effects.
例如:以上装置1200、装置1300和装置1400可以单独使用,也可以相互结合使用。For example, the above apparatus 1200 , apparatus 1300 , and apparatus 1400 may be used alone or in combination with each other.
本文中所描述的模块或单元的一个或多个可以软件、硬件或二者结合来实现。当以上任一模块或单元以软件实现的时候,所述软件以计算机程序指令的方式存在,并被存储在存储器中,处理器可以用于执行所述程序指令并实现以上方法流程。所述处理器可以包括但不限于以下至少一种:中央处理单元(central processing unit,CPU)、微处理器、数字信号处理器(DSP)、微控制器(microcontroller unit,MCU)、或人工智能处理器等各类运行软件的计算设备,每种计算设备可包括一个或多个用于执行软件指令以进行运算或处理的核。该处理器可以内置于SoC(片上系统)或专用集成电路(application specificintegrated circuit,ASIC),也可是一个独立的半导体芯片。该处理器内处理用于执行软件指令以进行运算或处理的核外,还可进一步包括必要的硬件加速器,如现场可编程门阵列(field programmable gate array,FPGA)、PLD(可编程逻辑器件)、或者实现专用逻辑运算的逻辑电路。One or more of the modules or units described herein may be implemented in software, hardware, or a combination of the two. When any of the above modules or units are implemented in software, the software exists in the form of computer program instructions and is stored in a memory, and a processor may be used to execute the program instructions and implement the above method flow. The processor may include, but is not limited to, at least one of the following: a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a microcontroller (MCU), or an artificial intelligence processor and other types of computing devices that run software, each of which may include one or more cores for executing software instructions for calculation or processing. The processor may be built into an SoC (system on chip) or an application specific integrated circuit (ASIC), or it may be an independent semiconductor chip. In addition to the core used to execute software instructions for calculation or processing in the processor, it may further include necessary hardware accelerators, such as a field programmable gate array (FPGA), a PLD (programmable logic device), or a logic circuit that implements a dedicated logic operation.
当本文中所描述的模块或单元以硬件实现的时候,该硬件可以是CPU、微处理器、DSP、MCU、人工智能处理器、ASIC、SoC、FPGA、PLD、专用数字电路、硬件加速器或非集成的分立器件中的任一个或任一组合,其可以运行必要的软件或不依赖于软件以执行以上方法流程。When the modules or units described in this document are implemented in hardware, the hardware can be any one or any combination of a CPU, a microprocessor, a DSP, an MCU, an artificial intelligence processor, an ASIC, a SoC, an FPGA, a PLD, a dedicated digital circuit, a hardware accelerator, or a non-integrated discrete device, which can run the necessary software or be independent of the software to execute the above method flow.
当本文中所描述的模块或单元使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何具备类似高速缓存的配置能力的可用介质或者是包含一个或多个具备类似高速缓存的配置能力的可用介质集成的服务器、数据中心等数据存储设备。When the modules or units described herein are implemented using software, they can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. 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 from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium with a configuration capability similar to a cache that a computer can access, or a server, a data center, or other data storage device that includes one or more available media integrated with a configuration capability similar to a cache.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及方法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。 In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。 The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims (29)
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310612762.6A CN119025125A (en) | 2023-05-26 | 2023-05-26 | Method, device and electronic device for managing shared library |
CN202310612762.6 | 2023-05-26 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2024244598A1 true WO2024244598A1 (en) | 2024-12-05 |
Family
ID=93523774
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2024/081001 WO2024244598A1 (en) | 2023-05-26 | 2024-03-11 | Method for managing shared library, apparatus and electronic device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN119025125A (en) |
WO (1) | WO2024244598A1 (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102393845A (en) * | 2011-06-30 | 2012-03-28 | 北京新媒传信科技有限公司 | Shared library management method and system |
CN103425512A (en) * | 2013-08-19 | 2013-12-04 | 曙光信息产业股份有限公司 | Software package management method and system |
CN107085514A (en) * | 2017-03-06 | 2017-08-22 | 北京安博通科技股份有限公司 | Shared library upgrade method and device |
CN109791483A (en) * | 2017-03-14 | 2019-05-21 | 谷歌有限责任公司 | For calculating the shareware library of equipment |
US20190243636A1 (en) * | 2018-02-05 | 2019-08-08 | Infosys Limited | System and method for seamlessly patching shared libraries in server environment |
US20200285488A1 (en) * | 2019-03-05 | 2020-09-10 | International Business Machines Corporation | Loading dependency library files from a shared library repository in an application runtime environment |
CN112667285A (en) * | 2021-01-25 | 2021-04-16 | 青岛海信传媒网络技术有限公司 | Application upgrading method, display device and server |
-
2023
- 2023-05-26 CN CN202310612762.6A patent/CN119025125A/en active Pending
-
2024
- 2024-03-11 WO PCT/CN2024/081001 patent/WO2024244598A1/en unknown
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102393845A (en) * | 2011-06-30 | 2012-03-28 | 北京新媒传信科技有限公司 | Shared library management method and system |
CN103425512A (en) * | 2013-08-19 | 2013-12-04 | 曙光信息产业股份有限公司 | Software package management method and system |
CN107085514A (en) * | 2017-03-06 | 2017-08-22 | 北京安博通科技股份有限公司 | Shared library upgrade method and device |
CN109791483A (en) * | 2017-03-14 | 2019-05-21 | 谷歌有限责任公司 | For calculating the shareware library of equipment |
US20190243636A1 (en) * | 2018-02-05 | 2019-08-08 | Infosys Limited | System and method for seamlessly patching shared libraries in server environment |
US20200285488A1 (en) * | 2019-03-05 | 2020-09-10 | International Business Machines Corporation | Loading dependency library files from a shared library repository in an application runtime environment |
CN112667285A (en) * | 2021-01-25 | 2021-04-16 | 青岛海信传媒网络技术有限公司 | Application upgrading method, display device and server |
Also Published As
Publication number | Publication date |
---|---|
CN119025125A (en) | 2024-11-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021159746A1 (en) | File sharing method and system, and related device | |
CN113704205B (en) | Log storage method, chip, electronic device and readable storage medium | |
CN110737493A (en) | theme switching method and device | |
CN113805797B (en) | Processing method of network resource, electronic equipment and computer readable storage medium | |
WO2021253975A1 (en) | Permission management method and apparatus for application, and electronic device | |
US12032938B2 (en) | Plug-in installation method, apparatus, and storage medium | |
CN113641271B (en) | Application window management method, terminal device and computer readable storage medium | |
WO2021238376A1 (en) | Function pack loading method and apparatus, and server and electronic device | |
CN114765768B (en) | Network selection method and device | |
WO2025036044A1 (en) | Resource scheduling method and apparatus, and electronic device | |
CN115185652A (en) | Application optimization method and device and electronic equipment | |
CN116048629B (en) | System service switching method and control device, electronic device and storage medium | |
CN114691248B (en) | Method, device, equipment and readable storage medium for displaying virtual reality interface | |
WO2024244598A1 (en) | Method for managing shared library, apparatus and electronic device | |
CN117390604B (en) | Local authentication method and electronic equipment | |
CN117707562B (en) | Parameter updating method and terminal device | |
CN115421644B (en) | Method and device for determining message source of pop-up window | |
WO2024131823A1 (en) | Installation-free application upgrading method and electronic device | |
WO2023071472A1 (en) | Application download and installation method, application aging method, and electronic device | |
CN115952564B (en) | Data writing method and terminal equipment | |
WO2024109573A1 (en) | Method for floating window display and electronic device | |
WO2025020945A1 (en) | Process control method and apparatus for electronic device, and electronic device | |
WO2024093703A1 (en) | Instance management method and apparatus, and electronic device and storage medium | |
CN118672531A (en) | Method and device for cross-container display | |
WO2025002248A1 (en) | Application running method, electronic device and storage medium |
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: 24813804 Country of ref document: EP Kind code of ref document: A1 |