System capability loading method and electronic equipment
By unifying the shared library calling method and mapping relationship configuration, the problems of complex application calling system capabilities and high resource consumption are solved, and efficient and stable system capability calling and management are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2026-03-10
AI Technical Summary
In existing technologies, the implementation of applications calling system capabilities is complex and inefficient, resulting in high resource consumption, large maintenance workload, and difficulty in unifying the management and version compatibility of different shared libraries.
By unifying the way shared libraries are called in the operating system and configuring the mapping relationship between system capabilities and shared library files through the shared library software development kit, application development is simplified, dependency file configuration is reduced, and centralized management and version compatibility of shared libraries are achieved.
It simplifies the process of calling system capabilities, improves calling efficiency, optimizes resource consumption, enhances application stability and system performance, and reduces maintenance difficulty.
Smart Images

Figure CN121635984A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a system capability loading method and an electronic device. Background Technology
[0002] With the development of terminal technology, applications (APPs) can perform increasingly richer functions. Shared libraries include system-level functions or services (also described as system capabilities) provided by the operating system. To expand the functionality of applications and simplify the development process, application developers usually configure their applications to call dependency files provided by shared libraries, so that the application can implement corresponding functions or services based on the dependency files at runtime.
[0003] During application runtime, system capabilities are accessed based on configured dependency files. The application interacts with these capabilities via inter-process communication (IPC). The application receives the execution results returned by the system capabilities, thus enabling the invocation of those capabilities. For example, when application A invokes the camera function, it accesses the system camera application that provides the camera function through a dependency file and interacts with it via IPC. The system camera application performs operations such as taking a picture and returns the result to application A. Currently, the implementation of applications invoking system capabilities based on shared libraries is relatively complex and inefficient. Summary of the Invention
[0004] This application provides a system capability loading method and an electronic device, which uses the mapping relationship between the interface / address of the system capability and the corresponding shared library file to simplify the system capability calling steps, speed up the system capability calling efficiency, and optimize the system capability calling configuration.
[0005] To achieve the above objectives, this application adopts the following technical solution:
[0006] In a first aspect, this application provides a system capability loading method applied to an electronic device. The electronic device includes a first shared library, which includes one or more shared library files, each of which is used to implement a system capability. The method includes: receiving a first operation for a first application installed in the electronic device; wherein the first application integrates a first mapping relationship, which includes a mapping relationship between the first system capability and the interfaces / addresses of the first shared library files; the first shared library file is used to implement the first system capability, and the one or more shared library files contain the first shared library file; in response to the first operation, obtaining the first shared library file through the first mapping relationship; and running the first shared library file.
[0007] In this application, when an application of an electronic device calls a system capability, the electronic device quickly obtains the shared library file corresponding to that system capability based on the mapping relationship integrated with the application, and runs the shared library file. This simplifies the system capability calling process, speeds up the system capability calling efficiency, and optimizes the system capability calling configuration.
[0008] According to the first aspect, or any implementation of the first aspect above, the electronic device includes a shared library group, the shared library group includes one or more shared libraries, the one or more shared libraries have the same interface / address, and the interface / address of the one or more shared libraries is used to obtain a first shared library file.
[0009] In this application, the shared libraries within a shared library group in the electronic device share the same interface / address, meaning all shared libraries in the electronic device are called in the same way. Multiple shared libraries in the electronic device can be installed, managed, and maintained uniformly, simplifying the management and maintenance of shared libraries in the operating system, thus enabling efficient management and calling of shared libraries later. Centralized management of different shared libraries, with each shared library file having the same version, avoids version conflicts and incompatibilities. Different applications can connect to and access the shared libraries through the same interface / address, using the system capabilities within the shared libraries, improving the efficiency and convenience of calling system capabilities.
[0010] According to the first aspect, or any implementation of the first aspect above, in response to the first operation, obtaining the first shared library file through the first mapping relationship includes: in response to the first operation, determining the identifier of the first system capability corresponding to the first operation; accessing the first shared library according to the identifier of the first system capability and the interface / address of one or more shared libraries; and obtaining the first shared library file from the first shared library according to the first mapping relationship.
[0011] According to the first aspect, or any implementation of the first aspect above, the first application configures the first mapping relationship through the shared library software development kit; the shared library software development kit includes the mapping relationship between the interface / address of each system capability in the shared library group and the shared library file corresponding to the system capability.
[0012] In some examples, the first application configures the first mapping relationship through a shared library software development kit based on development needs.
[0013] In this application, the first application using the shared library software development kit only needs to configure the mapping relationship between the system capabilities and the corresponding shared library files' interfaces / addresses. This reduces the application's size and resource consumption, avoids repeatedly introducing the same information, eliminates information redundancy, optimizes the application development method, simplifies application development and maintenance, and saves resource consumption. Furthermore, the shared library SDK uses the same versions of different system capabilities, avoiding version conflicts and incompatibility issues, thus improving the application's stability and maintainability.
[0014] According to the first aspect, or any implementation of the first aspect above, in response to the first operation, the first shared library file is obtained through the first mapping relationship, including: when the first application version and the first shared library version are adapted, in response to the first operation, the first shared library file is obtained through the first mapping relationship.
[0015] In some examples, if the application version is not lower than the minimum version requirement of the shared library, the first shared library file is obtained through the first mapping relationship in response to the first operation.
[0016] In this application, by comparing the application version and the shared library version, if the application version is not lower than the minimum version requirement of the shared library, it indicates that the application is compatible with the shared library and the application can use the shared library. This method ensures the compatibility between the application and the shared library and improves the stability of system capability calls.
[0017] According to the first aspect, or any implementation of the first aspect above, the method further includes: in the event that the first application version and the first shared library version are incompatible, in response to the first operation, interacting with a process in the electronic device that has the first system capability through a system call interface to realize the first system capability.
[0018] In this application, when the application version and the shared library version do not match, the first system capability can be implemented through system services.
[0019] According to the first aspect, or any implementation of the first aspect above, the method further includes: if the first mapping relationship does not include the second system capability required by the first application, the first application updates the first mapping relationship through a shared library software development kit; the updated first mapping relationship includes the mapping relationship between the interface / address of the second system capability and the second shared library file, and the shared library software development kit includes the mapping relationship between the interface / address of each system capability in the shared library group and the shared library file corresponding to the system capability.
[0020] In some examples, electronic devices can also update shared libraries. For instance, shared libraries can be updated via over-the-air (OTA) technology.
[0021] Understandably, the way each system capability is invoked within the shared library remains unchanged and will not change with updates to the shared library. The shared library software development kit (SDK) is updated based on the updated shared library. The updated shared software development kit will include information from the previous shared library SSDK.
[0022] In this application, the shared library software development kit includes the mapping relationships between the interfaces / addresses of all system capabilities provided by the operating system and the corresponding shared library files. The required system capabilities and their corresponding shared library file interface / address mapping relationships should be integrated according to development needs. If an application needs to call new system capabilities, it needs to obtain the shared library software development kit to update its mapping relationships and enrich the application's functionality.
[0023] In a second aspect, this application provides a system capability loading device, which includes a processor and a memory coupled to the processor. The memory is used to store computer-readable instructions, and when the processor reads the computer-readable instructions from the memory, it causes the electronic device to perform the method as described in the first aspect and any embodiment of the first aspect.
[0024] Thirdly, this application provides an electronic device comprising: a processor and a memory, the memory being coupled to the processor, the memory being used to store computer-readable instructions, wherein when the processor reads the computer-readable instructions from the memory, the electronic device causes the electronic device to perform the method as described in the first aspect and any embodiment of the first aspect.
[0025] Fourthly, this application provides a chip system including at least one processor and at least one interface circuit. The at least one interface circuit is used to perform transceiver functions and send instructions to the at least one processor. The at least one processor executes the instructions and performs the method as described in the first aspect and any embodiment of the first aspect.
[0026] Fifthly, this application provides a computer-readable storage medium including a computer program that, when run on an electronic device, causes the electronic device to perform the method as described in the first aspect and any embodiment of the first aspect.
[0027] In a sixth aspect, this application provides a computer program product comprising: a computer program or instructions that, when executed on a computer, cause the computer to perform a method as described in the first aspect and any of the embodiments described in the first aspect.
[0028] The technical effects corresponding to any implementation method of aspects two through six, as well as any aspect, can be found in the first aspect and the technical effects corresponding to any implementation method of the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0029] Figure 1 This is a schematic diagram of the system capability invocation process provided in an embodiment of this application;
[0030] Figure 2 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;
[0031] Figure 3 System architecture diagram of the electronic device provided in the embodiments of this application;
[0032] Figure 4 Flowchart of the system capability loading method provided in the embodiments of this application Figure 1 ;
[0033] Figure 5 This application provides a schematic diagram of a system capability loading scenario. Figure 1 ;
[0034] Figure 6 This application provides a schematic diagram of a system capability loading scenario. Figure 2 ;
[0035] Figure 7 This application provides a schematic diagram of a system capability loading scenario. Figure 3 ;
[0036] Figure 8 Flowchart of the system capability loading method provided in the embodiments of this application Figure 2 ;
[0037] Figure 9 This is a schematic diagram of the system capability loading device provided in the embodiments of this application;
[0038] Figure 10 This is a schematic diagram of the chip system provided in an embodiment of this application. Detailed Implementation
[0039] The technical solutions of the embodiments of this application are described below with reference to the accompanying drawings. In the description of the embodiments of this application, the terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to be a limitation of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include expressions such as “one or more,” unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, “at least one” and “one or more” refer to one or more (including two).
[0040] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized. The term "connection" includes direct connections and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.
[0041] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0042] In some examples, such as Figure 1 As shown, a shared library can be a codebase provided by the operating system (i.e., the shared library provider) that can be shared and used by multiple applications (i.e., the callers). The shared library includes system capabilities provided by the operating system. The shared library provides dependency files so that different applications can integrate the corresponding functions or services by configuring these dependency files during development. These dependency files can include information such as the mapping relationship between the system capability and how it is invoked.
[0043] Operating systems typically generate multiple shared libraries based on system capabilities. Each shared library can implement one or more system capabilities, and different shared libraries can implement different system capabilities. Each shared library corresponds to a dependency file, which can include the mapping relationship between each system capability in the shared library and how that system capability is invoked.
[0044] For example, an operating system can provide three shared libraries: shared library a, shared library b, and shared library c. Each shared library implements a specific function; for instance, shared library a can be used to implement a camera function, shared library b can be used to implement a map function, and shared library c can be used to implement a message notification function. Each shared library is invoked differently, and their dependency files are also different. For example, shared library a depends on dependency file a, shared library b depends on dependency file b, and shared library c depends on dependency file c.
[0045] During application development, the application retrieves dependency files from the operating system based on functional requirements and configures these dependency files. For example, if the application needs to implement photo-taking and map functions, it can retrieve dependency file 'a' for shared library 'a' and dependency file 'b' for shared library 'b' from the operating system. Then, the application configures dependency files 'a' and 'b', compiles the application code and each dependency file into an application package, and uploads the application package to the server for users to download.
[0046] The user downloads the application package from the server and then installs the application based on that package. During application use, in response to user input to activate a specific system capability, the application retrieves the dependency files corresponding to that capability. Based on the dependency files, it determines the invocation method for that system capability and invokes the capability using that method.
[0047] For example, the system capabilities in the shared libraries of the corresponding operating system are used by applications for inter-process communication (IPC) with other applications that possess these capabilities. The application receives the execution results returned by the system capabilities, thus enabling the invocation of those capabilities. For instance, after an application is installed on a user's electronic device, during application use, if the user uses the application's camera function (e.g., clicking the camera control in the application), the application detects the user's action and determines that the user wants to activate the camera function. In response to the user's action, the application obtains the dependency file 'a' corresponding to the camera function and determines the interface or address for calling the system-level camera function based on dependency file 'a'. The application accesses the camera function in shared library 'a' through the interface or address indicated by the dependency file. The operating system runs the camera function as a background process, launching the system camera application. The system camera application interacts with the application via IPC communication, responding to the user's camera action in the application. The system camera application takes a picture, returns the result to the application, and the application displays the result.
[0048] Understandably, operating systems can also update shared libraries to optimize functionality or provide new features. If an application wants to implement the updated functionality of a shared library, it needs to configure the dependency files for the updated shared library to ensure that the application can correctly use the functionality provided by the updated shared library.
[0049] However, in this example, the application development requires configuring the dependency files corresponding to different shared libraries according to functional requirements. The application package includes multiple dependency files, which increases the size of the application installation package and consumes more storage resources when installing the application.
[0050] If multiple dependency files need to be configured during application development, then the dependency files corresponding to each shared library need to be obtained, which increases the complexity and workload of application development.
[0051] Moreover, each system capability invoked by the application at runtime is managed only by the shared library corresponding to that system capability. The management methods of each shared library may be different, and multiple shared system capabilities cannot be managed and maintained in a unified manner.
[0052] Furthermore, when multiple applications use the same shared library, each application needs to configure the dependency file of the shared library separately, and multiple applications need to configure the same dependency file, resulting in the same dependency file being imported repeatedly, which increases the consumption of storage resources.
[0053] When applications call system capabilities, they need to perform cross-process communication, which on the one hand brings additional resource overhead and degrades system performance; on the other hand, the implementation of system capabilities through interaction between multiple processes is relatively complex, resulting in low efficiency for applications to call system capabilities.
[0054] In addition, when the shared library is updated, the dependency files in the application also need to be updated synchronously, which increases the maintenance workload.
[0055] In view of this, this application provides a system capability loading method applied to electronic devices. The operating system uses a unified shared library calling method based on multiple shared libraries. Application development configures the mapping relationship between the operating system's system capabilities and the calling methods of the corresponding shared library files using a shared library software development kit (SDK). When an application calls a system capability of the operating system, it can call the shared library using the shared library calling method and obtain the code corresponding to that system capability based on the mapping relationship between the system capability and the calling method. The application then runs the code corresponding to that system capability to implement the system capability. In the above scheme, the mapping relationship between system capabilities and the calling methods of the corresponding shared library files is configured through the shared library SDK during application development, eliminating the need for additional dependency file configuration, thus simplifying application development and reducing the size of the initial application installation package. When different applications in an electronic device call system capabilities, they can access the shared library based on the unified shared library calling method and obtain the corresponding code as needed. This unified approach to accessing shared libraries facilitates system maintenance and management. Moreover, applications can dynamically invoke system capabilities based on usage needs. The code for system capabilities can be run within the application, which simplifies the implementation of application calls to system capabilities, reduces the overhead of inter-process communication, improves system performance and execution efficiency of calling system capabilities, and optimizes the configuration of system capability calls.
[0056] The electronic devices described in this application may include, but are not limited to, devices in any field such as smart terminals, vehicles, smart homes, industry, municipal facilities, medical care, and education.
[0057] Taking the field of smart terminals as an example, the electronic devices described in this application embodiment may include, but are not limited to, smartphones, netbooks, tablet computers, handheld computers, in-vehicle computers, personal computers (PCs), personal digital assistants (PDAs), artificial intelligence (AI) devices, portable multimedia players (PMPs), augmented reality (AR) / virtual reality (VR) devices, smart TVs, projection devices, or motion-sensing game consoles in human-computer interaction scenarios. Of course, the electronic devices described in this application embodiment may also be wearable devices, such as smartwatches, smart bracelets, phone watches, or other types or structures of electronic devices; this application is not limited to these.
[0058] Figure 2A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown.
[0059] like Figure 2 As shown, the electronic device 200 may include a processor 210, a memory 220, an antenna 1, an antenna 2, a mobile communication module 230, a wireless communication module 240, a display screen 250, etc.
[0060] Processor 210 may include one or more processing units, such as application processors (APs), system-on-chips (SoCs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, memory, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). Different processing units may be independent devices or integrated into one or more processors. The controller may serve as the central nervous system and command center of the electronic device 200. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.
[0061] The processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. This memory can store instructions or data that the processor 210 has just used or that are used repeatedly. If the processor 210 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.
[0062] In some embodiments, processor 210 may include one or more interfaces. These one or more interfaces can be used to connect processor 210 to memory 220, etc.
[0063] In some embodiments of this application, the processor 210 can be used to install and obtain a shared library installation package, and install a shared library based on the shared library installation package. The shared library in this shared library uses a preset calling method. The processor 210 is also used to install an application. This application is an application that integrates the mapping relationship between the calling methods of system capabilities and the corresponding shared library files through a shared library SDK. The processor 210 is also used to create an application process and enable the application in response to a user's startup operation. The processor 210 is also used to obtain the shared library file corresponding to the trigger operation in response to a user's trigger operation based on the application. This trigger operation is an operation initiated by the user based on the application, triggering the application to call system capabilities. The processor 210 is also used to run the shared library file in the application process to implement the system capabilities corresponding to the shared library file. For details, please refer to the following description.
[0064] The memory 220 can be used to store computer executable program code, which includes instructions. The processor 210 executes various functional applications and data processing of the electronic device 200 by running the instructions stored in the memory 220. The memory 220 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of the electronic device 200 (such as audio data, phonebook, etc.). Furthermore, the memory 220 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0065] The wireless communication function of electronic device 200 can be implemented through antenna 1, antenna 2, mobile communication module 230, wireless communication module 240, modem processor, and baseband processor.
[0066] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 200 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.
[0067] The mobile communication module 230 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for use on the electronic device 200. The mobile communication module 230 can receive electromagnetic waves via the antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to the modem processor for demodulation. The mobile communication module 230 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 230 can be housed in the processor 210. In some embodiments, at least some functional modules of the mobile communication module 230 and at least some modules of the processor 210 can be housed in the same device.
[0068] The wireless communication module 240 can provide solutions for wireless communication applications on the electronic device 200, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 240 can be one or more devices integrating at least one communication processing module. The wireless communication module 240 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 210. The wireless communication module 240 can also receive signals to be transmitted from processor 210, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0069] In some embodiments, antenna 1 of electronic device 200 is coupled to mobile communication module 230, and antenna 2 is coupled to wireless communication module 240, enabling electronic device 200 to communicate with networks and other devices via 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 technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0070] For example, the electronic device 200 provided in this application embodiment can send messages or instructions to other electronic devices through antenna 1, antenna 2, mobile communication module 230, wireless communication module 240, etc. Alternatively, the electronic device provided in this embodiment can receive information or instructions sent by other electronic devices through antenna 1, antenna 2, mobile communication module 230, wireless communication module 240, etc.
[0071] Electronic device 200 implements display functions through a GPU, display screen 250, and application processor. The GPU is a microprocessor for image processing, connecting the display screen 250 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0072] The display screen 250 is used to display images, videos, etc. The display screen 250 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 (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 200 may include one or N displays 250, where N is a positive integer greater than 1.
[0073] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 200. In other embodiments of this application, the electronic device 200 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0074] The system capability loading method in this application embodiment can be applied to any application scenario where an application calls a shared library. Examples include hardware access, performance optimization, file and storage management, network communication, system services and notifications, user interface integration, and security and permission management.
[0075] Hardware access can refer to applications accessing hardware devices such as cameras, microphones, GPS, and sensors. For example, map navigation applications need to use GPS for positioning. Shopping applications need to use the camera to take pictures. Banking or payment applications need to use the camera to take facial photos to verify user identity. Music or communication applications need to use the microphone to listen to the user's voice. Performance optimization can refer to applications accessing graphics processing libraries or multi-threaded processing libraries to improve application processing capabilities. For example, video editing software uses graphics processing libraries to accelerate video rendering. File and storage management can refer to applications needing to read and write system files, access local storage, or cloud storage services. For example, image processing software accesses the local photo album. Network communication can refer to applications needing to use system-provided network libraries to handle network connections, send data, or perform network security operations. For example, communication applications send messages over the network. System services and notifications can refer to applications needing to interact with system services. For example, sending push notifications (such as calendar applications sending event reminders), accessing system settings, or calling system services. User interface integration can refer to applications needing to utilize the system's user interface components or design patterns to maintain a consistent user experience. Security and access control can refer to applications needing to call system-level security functions, such as encryption, authentication, or access control. This application does not limit the application scenarios for applications calling shared libraries.
[0076] like Figure 3 The diagram shown is a system architecture diagram of an electronic device provided in an embodiment of this application. The electronic device includes an application layer, a framework layer, and a service layer. The application layer includes a loading module and an execution module. The framework layer includes an interface module, a compilation module, and a preview module. The service layer includes an installation module and an update module. The modules in the electronic device are interconnected and communicate with each other.
[0077] Loading modules are used to load shared library files into the application process. For example, a loading module is a virtual machine that loads the code files from a shared library file into the application process's virtual machine.
[0078] The loading module is also used to load application code from application files into the application process. For example, the loading module is a virtual machine, which loads application code into the application process.
[0079] The execution module is used to execute the code files in a shared library file to implement the system capabilities corresponding to that shared library file. For example, if the execution module is a virtual machine, the virtual machine in the application process runs the code file to implement the system capabilities corresponding to that shared library file.
[0080] The execution module is also used to execute application code to implement the application's functionality. For example, the execution module is a virtual machine. When the virtual machine starts in the application process, it is responsible for loading and running the application code, launching the application, and executing the application code to implement the corresponding application functionality.
[0081] The interface module provides a unified access method for shared libraries in electronic devices. For example, it provides a shared library calling method for managing shared libraries. Different applications in the electronic device can access shared libraries, obtain shared library files, and implement system capabilities through this method.
[0082] The compilation module is used to compile and link application code into a shared library calling method.
[0083] The preview module is used to preview the system functions provided by the shared library when the system capability supports previewing.
[0084] The installation module is used to install shared libraries. It is also used to install applications.
[0085] The update module is used to update shared libraries.
[0086] The system capability loading method of this application will be described in detail below with reference to specific embodiments and accompanying drawings. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0087] Figure 4 This is a flowchart illustrating a system capability loading method provided in an embodiment of this application, applied to an electronic device. For example... Figure 4 As shown, the method may include:
[0088] S401. The electronic device obtains the shared library installation package and installs the shared library based on the shared library installation package.
[0089] In this embodiment of the application, the operating system developer develops a shared library that contains multiple system capabilities provided by the operating system for application invocation.
[0090] It is understood that the operating system in this application embodiment can develop multiple shared libraries, and each shared library can integrate one or more system capabilities. Taking the integration of multiple system capabilities by a shared library as an example, the shared library contains multiple shared library files, and each shared library file is used to implement a system capability. The shared library file may include the system capability name, code file, calling method, etc. The calling method can be an interface or an address. For example, taking the calling method as an address, the shared library includes shared library file a, shared library file b, and shared library file c. The system capability corresponding to shared library file a is the camera function, and the calling method of shared library file a is address a. The system capability corresponding to shared library file b is the map function, and the calling method of shared library file b is address b. The system capability corresponding to shared library file c is the message notification function, and the calling method of shared library file c is address c.
[0091] Among them, the operating system includes but is not limited to Or other operating systems. This application embodiment does not specify the operating system.
[0092] Understandably, in existing technologies, each shared library is installed, managed, and maintained separately. The installation locations and management methods of different shared libraries vary, making it difficult for the operating system to uniformly manage the shared libraries within the operating system.
[0093] To avoid the aforementioned problems, this embodiment of the application standardizes the installation address of shared libraries in the operating system and sets a preset calling method. That is, an address or interface is pre-defined. When the preset calling method is a preset address, this preset address is also used as the installation address, and each shared library in the operating system is installed under this installation address. Alternatively, when the preset calling method is a preset interface, an installation address is set for the preset interface, and the preset interface corresponds to this installation address, with each shared library in the operating system installed under this installation address. In this way, shared libraries in the operating system can be centrally stored under one installation address, eliminating the need for distributed installations. This allows the operating system to uniformly manage and maintain the operating system under this installation address, simplifying management processes.
[0094] It's understandable that after each shared library is installed, system capabilities need to be accessed by calling that shared library through its installation address. Therefore, when developing an operating system, the shared library calling method is set to the default calling method.
[0095] In one example, the process of developing a shared library by an operating system developer includes: conducting requirements analysis to clarify the system capabilities the shared library needs to implement, defining functional requirements and performance standards. For example, which system capabilities should be included in the shared library. Designing the shared library architecture, designing a modular structure for each system capability, and determining the functional modules for each system capability. Writing specific implementation code, i.e., code files, for each functional module to ensure the designed functionality is achieved. Performing resource management, establishing a resource file management system, and determining the resource files for each functional module, such as the calling methods. Defining the shared library calling methods according to preset calling methods to ensure that other systems or applications can call it correctly. Conducting functional testing, integration testing, etc., to discover and fix potential problems to ensure the reliability and compatibility of the shared library. Writing usage instructions and interface documentation to facilitate developers' installation, configuration, and use of the shared library. Integrating the code files, resource files (such as calling methods), and the corresponding system capability names of each functional module to obtain the shared library file for each functional module. Integrating each shared library file and shared library calling methods to obtain the shared library.
[0096] The shared library is invoked using a preset method, such as a preset address or a preset interface.
[0097] As we can understand, each functional module in the shared library corresponds to a shared library file. A shared library file implements a system capability, and the calling method within the shared library file is to call its address or interface. In other words, when other applications call a system capability within this shared library, they first need to call the shared library using the shared library calling method, then call the shared library file according to the calling interface corresponding to the system capability, load and run the code file in the shared library file, and finally implement the system capability.
[0098] As can be understood, the above explanation uses the development of a single shared library as an example. An operating system can develop multiple shared libraries, defining a default calling method for each. This unifies the installation addresses and calling methods of multiple shared libraries within the operating system. This allows for the subsequent installation of multiple shared libraries based on a unified installation address; the retrieval of a shared library based on a unified calling method; and the location of the corresponding shared library file based on the system's capabilities, thus enabling the implementation of the desired functionality.
[0099] In this embodiment of the application, for each shared library that has been developed, the shared library can be compiled into a shared library installation package through an integrated development environment (IDE).
[0100] Understandably, operating system developers can develop shared libraries and compile shared library installers on servers. Alternatively, they can develop shared libraries and compile shared library installers on development-side electronic devices. These development-side electronic devices typically have greater computing power, performance, and storage capacity than user-side electronic devices.
[0101] The server can be a cloud server or a network server, or any other server with computing capabilities. This server can be a single server, a server cluster consisting of multiple servers, or a cloud computing service center.
[0102] The embodiments of this application do not limit the specific implementation of developing shared libraries and compiling shared library installation packages.
[0103] In some examples, the server can proactively send a shared library installation package to the electronic device with the operating system installed (hereinafter referred to as the user-side electronic device). Accordingly, the user-side electronic device receives the shared library installation package sent by the server.
[0104] In other examples, the user-side electronic device proactively sends a shared library request to the server, and the server responds by sending a shared library installation package to the user-side electronic device. Accordingly, the user-side electronic device receives the shared library installation package sent by the server.
[0105] For example, if an operating system developer develops shared libraries and compiles shared library installation packages on the server, the server can proactively send the shared library installation packages to the user's electronic device after obtaining them; or, in response to a shared library request, send the shared library installation packages to the user's electronic device.
[0106] For example, if an operating system developer develops a shared library on the development-side electronic device and compiles the shared library installation package, the development-side electronic device uploads the shared library installation package to the server so that the server can proactively send the shared library installation package to the user-side electronic device; or, in response to a shared library request, the server can send the shared library installation package to the user-side electronic device.
[0107] It is understandable that user-side electronic devices typically obtain shared library installation packages for all shared libraries developed and compiled by the operating system, and install the shared libraries according to the shared library installation packages, thereby integrating all the shared libraries of the operating system to provide different functions.
[0108] Understandably, user-side electronic devices should obtain the shared library installation packages corresponding to their installed operating systems to ensure compatibility between the operating systems and shared libraries.
[0109] In this embodiment, after obtaining the shared library installation package, the user-side electronic device installs the shared library according to the shared library installation package, installing the shared library to a preset address or the installation address corresponding to a preset interface. Specifically, the user-side electronic device installs the shared library according to the shared library installation package through a package management service.
[0110] For example, the user-side electronic device unzips the shared library installation package and determines the installation location based on the shared library calling method. The user-side electronic device then copies the unzipped shared library installation package to that installation location, updates system configurations (such as the runtime environment), and completes the installation.
[0111] It is understood that in this embodiment, multiple shared libraries of the operating system in the user-side electronic device are installed at the same address. Compared to existing technologies, where different shared libraries are installed and managed separately, the solution in this application allows for unified installation, management, and maintenance of multiple shared libraries, simplifying the management and maintenance of shared libraries in the operating system and facilitating efficient management and access to these libraries later. Centralized management of different shared libraries, with each shared library file having the same version, avoids version conflicts and incompatibilities. With only one installation address, different applications can link to and access the shared libraries through that address, utilizing the system capabilities within the shared libraries, thus improving the efficiency and convenience of accessing system capabilities.
[0112] In this embodiment of the application, after the shared library is developed, the operating system can also create a shared library software development kit (SDK) so that the application can configure the shared library SDK and interact with the shared library by calling the shared library SDK.
[0113] The shared library SDK includes a mapping relationship between the system capabilities of all shared libraries in the operating system and the calling methods of the corresponding shared library files.
[0114] For example, a shared library SDK includes header files, sample code, etc. The header files include the mapping relationship between the system capabilities of all shared libraries in the operating system and the calling methods of the corresponding shared library files. The sample code is used to demonstrate how to use the functions of the shared library SDK so that application developers can get started quickly.
[0115] For example, taking the calling method as an interface, based on the shared library files in all shared libraries of the operating system, define the shared library's application program interface (API). This API can be a mapping relationship between the system capabilities of all shared libraries in the operating system and the interfaces of the corresponding shared library files. Write a header file that includes the shared library's API so that application developers can understand how to call the shared library. Write sample code. Package the header file and sample code into a compressed file or installer; the packaged compressed file or installer is the shared library SDK.
[0116] For example, taking the calling method as an address, based on the above example, the shared library SDK may include a photo-taking function—address a, a map function—address b, and a message notification function—address c.
[0117] The shared library SDK is integrated into the operating system SDK so that when application developers develop applications based on the operating system SDK, they can obtain the mapping relationship between the system capabilities in the shared library SDK and the calling methods of the corresponding shared library files, and compile them into the application.
[0118] Optionally, the shared library SDK may also include system call interfaces, which provide applications with the ability to directly access underlying operating system functions or services. For example, a set of system call interfaces can be defined in the shared library SDK, mapping to native system calls of the underlying operating system. These system call interfaces are then implemented in code and encapsulated within the shared library SDK.
[0119] S402. The electronic device obtains the application installation package and installs the application based on the application installation package.
[0120] The application can be a downloadable application installed on the user's electronic device. A downloadable application is an application that can provide its own Internet Protocol Multimedia Subsystem (IMS) connection. This downloadable application can be an application pre-installed on the user's electronic device or a third-party application that can be downloaded and installed by the user on the user's electronic device.
[0121] For example, applications can be pre-installed on the user's electronic device, such as a calendar or notepad. Pre-installed applications are typically system applications, but can also be third-party applications. Applications can also be third-party applications downloaded and installed by the user on their electronic device, such as map navigation applications, shopping applications, video applications, banking applications, payment applications, music applications, and communication applications.
[0122] In this embodiment, when application developers develop applications based on the operating system SDK, they can obtain the mapping relationship between all system capabilities in the shared library SDK and the calling methods of the corresponding shared library files. Application developers can then define system capability development requirements based on development needs and the system capability development requirements declared in the shared library SDK. These requirements represent the system capabilities that the application needs to configure. The application is then determined based on the application code and the system capability development requirements.
[0123] For example, and as in the example of S401 above, the application's development requirement is to have a camera function and a map function among the system capabilities. Therefore, the application determines the system capability development requirements based on the shared library SDK and the development requirements, requiring a camera function and a map function.
[0124] In this embodiment of the application, after the application developer has completed the development of the application, the application developer compiles the application into an application installation package through an IDE.
[0125] Specifically, during application package compilation, the mapping relationship between system capabilities and calling methods in the shared library SDK is used to determine the calling methods corresponding to the system capability development requirements. This obtains the mapping relationship between system capabilities and calling methods, which is then compiled into the application installation package. For example, the camera function (address a) and the map function (address b) are configured in the application installation package so that the camera or map function can be implemented after the application installation package is installed, decompressed, and run.
[0126] Thus, the functions that an application corresponding to an application installation package can implement include both the functions written by the application developer and the system capabilities of one or more operating systems configured for the application.
[0127] Understandably, application developers can develop applications and compile application installation packages on servers. Alternatively, they can develop applications and compile application installation packages on development-side electronic devices. These development-side electronic devices typically have greater computing power, performance, and storage capacity than user-side electronic devices.
[0128] The embodiments of this application do not limit the specific implementation of the application development and the compilation of the application installation package.
[0129] It is understandable that the application is configured with a mapping relationship between system capabilities and the calling methods of the corresponding shared library files during development. Therefore, when the user's electronic device installs the application and uses it, it can quickly call the system capabilities of the user's electronic device through the configured information.
[0130] Understandably, in existing technologies, each shared library configures dependency files based on the mapping relationship between each system capability within the shared library and its invocation method. Application development requires integrating these dependency files. At runtime, the application needs to determine the invocation method for each system capability through the dependency files. In other words, existing technologies require integrating dependency files to obtain the mapping relationship between system capabilities and invocation methods when invoking system capabilities. However, in the solution of this application, the application directly configures and integrates the mapping relationship between system capabilities and invocation methods. When using the application, it can quickly invoke these capabilities based on the configured information, eliminating the need to search through dependency files and saving invocation time.
[0131] Furthermore, in existing technologies, if an application implements multiple system capabilities, it may need to integrate dependency files from multiple shared libraries. This increases the application size and consumes more storage. If the shared library corresponding to the system capability that the application actually wants to call contains multiple system capabilities, and the application integrates the dependency files corresponding to that shared library, the application will only use one system capability from the dependency files, leading to redundancy of other information. Alternatively, if the application integrates multiple dependency files, these files may contain the same information, also leading to information redundancy. The same information is repeatedly introduced, increasing the consumption of storage resources.
[0132] In this application, the shared library SDK contains the mapping relationships between all system capabilities and calling methods of the operating system. Applications only need to obtain the required system capability and calling method mapping relationships from the shared library SDK according to their own development needs. Development requirements are declared during application development, and these requirements are used for the required system capabilities. During application compilation, the development requirements are converted into corresponding calling methods based on the system capability and calling method mapping relationships in the shared library SDK. In this way, the mapping relationships between system capabilities and calling methods are obtained. Compared with existing technologies, in this application, application development only requires specifying the system capability development requirements, and the mapping relationships between system capabilities and calling methods are completed based on the shared library SDK during compilation. No dependency files need to be configured during development, simplifying application development. The storage space required for the system capability and calling method mapping relationships in this application is less than the storage space occupied by dependency files, reducing the size of the application installation package and resource consumption. Moreover, this application does not require configuring multiple dependency files, avoids repeatedly introducing the same information, avoids information redundancy, optimizes the application development method, simplifies application development and maintenance, and saves resource consumption. Unified management of shared libraries, with identical versions of capabilities across different systems within the shared library SDK, avoids version conflicts and incompatibility issues, thereby improving application stability and maintainability.
[0133] In some examples, the server responds to an installation request from a user's electronic device by sending an application installation package to the user's electronic device. The user's electronic device then receives the application installation package from the server.
[0134] In other examples, the server proactively sends the application installation package to the user's electronic device. Correspondingly, the user's electronic device receives the application installation package sent by the server.
[0135] For example, if an application developer develops the application and compiles the application installation package on the server, the server can proactively send the application installation package to the user's electronic device after obtaining the application installation package; or, in response to an installation request, send the application installation package to the user's electronic device.
[0136] For example, if an application developer develops an application on a development-side electronic device and compiles the application installation package, the development-side electronic device uploads the application installation package to the server, so that the server can proactively send the application installation package to the user-side electronic device; or, in response to an installation request, the server can send the application installation package to the user-side electronic device.
[0137] Optionally, the user's electronic device can also copy the application installation package from other electronic devices.
[0138] This application does not limit the specific implementation method of the user-side electronic device obtaining the application installation package.
[0139] In this embodiment, after obtaining the application installation package, the user-side electronic device installs the application according to the application installation package. Specifically, the user-side electronic device installs the application according to the application installation package through a package management service.
[0140] For example, the user's electronic device unzips the application installation package and determines the application's installation location. This installation location can be a default location specified by the operating system or the application installation package. The user's electronic device then copies the unzipped application installation package to the specified installation location, updates system configurations (such as the runtime environment), and completes the installation.
[0141] S403. In response to the user's startup operation, the electronic device creates an application process and enables the application based on the application process.
[0142] The "launch operation" refers to the user's action of launching the application. This operation can be a preset shortcut, such as clicking the application icon. It can also be a preset voice command, such as issuing a voice command to the user's electronic device via a voice assistant. This application does not limit the specific implementation of the user launching the application.
[0143] This application is a mapping relationship between system capabilities and the calling methods of the corresponding shared library files in user-side electronic devices through a shared library SDK.
[0144] In this embodiment, the user-side electronic device creates an application process and enables the application in response to the user's operation of launching the application.
[0145] Specifically, in response to a user's action to launch an application, the electronic device generates an application launch request. The electronic device then creates an application process, loads the application code into that process, and launches the application.
[0146] For example, such as Figure 5 As shown, the user-side electronic device receives the user's action of clicking the application icon (i.e., launching the application).
[0147] In response to the application launch operation, the user-side electronic device's operation management service sends a notification to the application process incubator, informing the incubator to create the application process. This operation management service can be a process manager, responsible for creating and managing processes. For example, in response to the user's application launch operation, the electronic device generates an application launch request and sends it to the operation management service. The operation management service then sends a notification to the application process incubator in response to the application launch request.
[0148] Upon receiving the notification, the application process incubator retrieves the application's mount address (i.e., the application's installation address mentioned above) from the package management service to obtain the application's code, etc. The application process incubator is responsible for managing and starting the application process. It can create, initialize, and configure the process environment so that the application code can run within it. The mount address is the storage location of the application file (i.e., the unzipped application installation package mentioned above) on the user's electronic device (usually stored in the file system). This application file may include mappings between the application code and system capabilities, and the calling methods of the corresponding shared library files. The application process incubator creates and initializes the application process based on this mount address, and loads the application code from the file system into the application process according to the mount address.
[0149] After an application process is created, the application model within that process creates a virtual machine and sets up the runtime environment. When the virtual machine starts, it is responsible for loading and running the application code, thus launching the application. The application model defines the application's runtime environment and structure, specifying how the application interacts with the system and user. The application model handles the configuration and startup of the virtual machine. The virtual machine is a software environment responsible for loading and executing application code and handling the application's runtime logic. The virtual machine can be one of the environments described above. Figure 3 The package manager can be the module that loads and executes the module. Figure 3 The installation module in [the system / platform].
[0150] It is understandable that the above example is based on starting an application. In actual applications, the virtual machine can also run application code to implement the application's functions.
[0151] S404. In response to a user's trigger operation based on application input, the electronic device retrieves the shared library file corresponding to the trigger operation from the shared library.
[0152] Among these, the triggered operation is an action that the user takes based on application input and triggers the application to invoke system capabilities. This triggered operation can be a preset shortcut, for example, taking a shopping application as an example, after the user's electronic device launches the shopping application, the user clicks on the camera control in the shopping application, etc.
[0153] Specifically, in response to a user's trigger operation input within the application, the user-side electronic device determines the identifier of the system capability indicated by the trigger operation. Based on this identifier, the user-side electronic device obtains the shared library calling method and determines the corresponding shared library for that system capability. According to the mapping relationship between the calling methods of the system capability and its corresponding shared library file within the application, the user-side electronic device retrieves the shared library file corresponding to that system capability from the shared library.
[0154] For example, examples based on S401-S403, such as Figure 6 As shown, the user-side electronic device responds to the user's click on the camera control in the shopping application (i.e., the trigger operation), determining that the system capability indicated by the trigger operation is the photo-taking function. The application process, based on this photo-taking function, interacts with the application process incubator and package management service to obtain the application's mount address. Based on the mount address, it obtains the mapping relationship between the photo-taking function in the application file and the calling method of the corresponding shared library file (i.e., photo-taking function – address a). The application process also determines the application's system calling capabilities based on this photo-taking function, and interacts with the application process incubator and package management service to obtain the shared library calling method. The application process connects to the shared library based on this shared library calling method. The application process obtains the shared library file corresponding to the photo-taking function (i.e., shared library file a) from the shared library based on the calling method (i.e., address a) in the mapping relationship. Here, the virtual machine can be as described above... Figure 3 The loading module and execution module in the program.
[0155] It is understandable that any application in a user-side electronic device that integrates the system capabilities and the mapping relationship between the calling methods of the shared library files corresponding to those capabilities through the shared library SDK can execute the above S403-S404.
[0156] It is understood that, in this embodiment of the application, when different applications in the user-side electronic device call system capabilities, they can all access the shared library based on a unified shared library calling method, and then obtain the shared library file of that system capability according to the mapping relationship between the system capability and the calling method in the application. This unifies the way different applications access the shared library, improves system consistency, and facilitates system management and maintenance. A unified shared library address and sharing mechanism can avoid duplication of work, reduce resource waste, and improve the utilization rate of system resources. Moreover, at runtime, the application can quickly obtain the shared library file of the currently called system capability based on the mapping relationship between the system capability in the application and the calling method of the corresponding shared library file, eliminating the need to implement system calls based on dependency files, simplifying the system capability calling steps, and accelerating the efficiency of system capability calling. Applications can dynamically load shared libraries according to actual needs, allowing applications to adjust functions according to different usage scenarios or user needs, and also enhancing the applicability and scalability of the application.
[0157] S405. The electronic device runs the shared library file in the application process to realize the system capabilities corresponding to the shared library file.
[0158] In this embodiment of the application, after the application process of the user-side electronic device obtains the shared library file, it loads and runs the shared file in the application process to realize the system capabilities corresponding to the shared library file.
[0159] Specifically, such as Figure 6As shown, after the application process obtains the shared library file, it loads the code file in the shared library file into the application process's virtual machine. The virtual machine runs the code file to implement the system capabilities corresponding to the shared library file.
[0160] It is understandable that any application in a user-side electronic device that integrates the system capabilities and the mapping relationship between the calling methods of the shared library files corresponding to those capabilities through a shared library SDK can execute the above S405.
[0161] As is understood, in this embodiment, the application loads the acquired shared library file into its own application process, and the application runs and implements the system capabilities corresponding to the shared library file. This eliminates the need for inter-process communication, reducing its overhead and improving system performance and execution efficiency. The application can load the shared library file and run it to implement system capabilities as needed, simplifying the way applications call system capabilities and improving system response speed and efficiency.
[0162] like Figure 7 The diagram shown is a timing diagram of the electronic device executing the system capability loading method in an embodiment of this application. (Above) Figure 4 The system capability loading method shown is also applicable to the electronic device provided in this embodiment, and will not be described in detail in this embodiment.
[0163] In this embodiment, the user-side electronic device can also receive an updated shared library installation package and update the shared library. The user-side electronic device can then execute steps S403-S405 based on the updated shared library.
[0164] In this embodiment, the user-side electronic device can also update the shared library via over-the-air (OTA) technology. This method allows for automatic updates of applications or system components without manual user intervention.
[0165] Understandably, shared library upgrades typically involve version management. The new version of the shared library is uploaded to the server, and user-side electronic devices download and replace the old version via OTA (Over-The-Air) updates. Specifically, during an OTA upgrade, user-side electronic devices usually ensure that the application can still function correctly when using the old version of the shared library, while simultaneously downloading and preparing the new version in the background. Once the new version is downloaded, the user-side electronic device will replace the old version at an appropriate time, achieving a smooth transition and ensuring an uninterrupted user experience. This appropriate time is usually when the application is not running. This ensures that the updated shared library takes effect the next time the application starts, without causing problems for the user.
[0166] It's understandable that shared libraries provide system capabilities and invocation methods, while applications are the users of these capabilities and invocation relationships. Shared libraries can provide updated shared library SDKs to applications, which can then update or not update their own mappings of system capabilities and invocation relationships as needed.
[0167] Understandably, if a shared library adds new features, the shared library SDK and calling methods will also be updated accordingly.
[0168] For example, a shared library includes shared library file a, shared library file b, and shared library file c. If a system capability m is added to the shared library, a corresponding shared library file m is added to the shared library to implement system capability m. The operating system updates the shared library SDK based on the updated shared library. For example, the updated shared library SDK may include a camera function (address a), a map function (address b), and a message notification function (address c).
[0169] It's understandable that the calling method for each system capability in the shared library is configured and fixed, and will not change with updates to the shared library. That is, updates to the shared library SDK only include information on adding new system capabilities, and will not change information on already configured system capabilities. Furthermore, the updated shared library SDK will include information from the previous shared library SDK.
[0170] Applications can obtain the updated shared library SDK. If the application's functional requirements remain unchanged, there is no need to modify the mapping relationship between the application's system capabilities and the corresponding shared library files. If the application's functional requirements change, adding system capability m, then the mapping relationship between system capability m and the corresponding shared library files must be added based on the updated shared library SDK. In other words, the application has been updated. The updated application can then call system capability m according to the mapping relationship between system capability m and the corresponding shared library files.
[0171] Optionally, to ensure application compatibility with shared libraries, a minimum version requirement is typically set for the shared libraries. In S404, the user-side electronic device determines whether the application version meets the minimum version requirement of the shared libraries in the current electronic device.
[0172] Provided the application version is not lower than the minimum version requirement of the shared library, the application can execute S404-S405 as described above. That is, it accesses the shared library through the shared library call method, obtains the shared library file according to the mapping relationship between system capabilities and the calling methods of the corresponding shared library files, and runs it in the application.
[0173] If the application version is lower than the minimum version requirement of the shared library, the application can access the function or service corresponding to the triggered operation through the system call interface in the shared library SDK. The application interacts with the process with the system capability through IPC via the system call interface and receives the returned running result.
[0174] like Figure 8 As shown, another system capability loading method provided in this application embodiment is applied to an electronic device. The electronic device includes a first shared library, which includes one or more shared library files, each shared library file being used to implement a system capability. The method includes:
[0175] S801, receiving a first operation for a first application installed in an electronic device; wherein the first application integrates a first mapping relationship, the first mapping relationship including a mapping relationship between the interface / address of a first system capability and a first shared library file; the first shared library file is used to implement the first system capability, and one or more shared library files contain the first shared library file.
[0176] The first shared library is any one of the shared libraries in the operating system, such as shared library a or shared library b mentioned above. The first application is any application mentioned above that integrates the system capabilities and the mapping relationship between the calling methods of the corresponding shared library files through the shared library SDK.
[0177] The first mapping relationship is a mapping between one or more system capabilities integrated by the first application and the calling methods of the corresponding shared library files of that system capability. The calling method can be an interface or an address.
[0178] The first system capability is any one of the system capabilities integrated in the first application, and the first shared library file is the shared library file corresponding to that first system capability. The first system capability is any one of the system capabilities in the first shared library. The first shared library contains the first shared library file.
[0179] For example, the first mapping relationship includes the mapping relationship between the interface / address of the first system capability and the first shared library file.
[0180] The first action can be the user's action of triggering the first application to implement the first system capability. The first action is the triggering action mentioned above.
[0181] In this embodiment, the electronic device includes a shared library group, which includes one or more shared libraries. The one or more shared libraries have the same interface / address, and the interface / address of the one or more shared libraries is used to obtain a first shared library file.
[0182] The interface / address of the shared library is the same as the shared library calling method mentioned above. For example, one or more shared libraries in an electronic device can be shared library a, shared library b, and shared library c as described above.
[0183] In this embodiment, the first application configures a first mapping relationship through a shared library software development kit; the shared library software development kit includes a mapping relationship between the interface / address of each system capability in the shared library group and the shared library file corresponding to the system capability.
[0184] S802, In response to the first operation, obtain the first shared library file through the first mapping relationship.
[0185] In some examples, in response to a first operation, obtaining a first shared library file through a first mapping relationship includes: in response to the first operation, determining the identifier of a first system capability corresponding to the first operation; accessing the first shared library based on the identifier of the first system capability and the interface / address of one or more shared libraries; and obtaining the first shared library file from the first shared library based on the first mapping relationship.
[0186] The identifier of the first system capability can be the name of the first system capability, etc.
[0187] In some examples, where the first application version is compatible with the first shared library version, the first shared library file is obtained through the first mapping relationship in response to the first operation.
[0188] In other examples, when the first application version and the first shared library version are incompatible, in response to the first operation, the system calls the process in the electronic device that has the first system capability interacts with the process in the electronic device to realize the first system capability.
[0189] S803, Run the first shared library file.
[0190] In this embodiment of the application, the method further includes: if the first mapping relationship does not include the second system capability required by the first application, the first application updates the first mapping relationship through a shared library software development kit; the updated first mapping relationship includes the mapping relationship between the interface / address of the second system capability and the second shared library file, and the shared library software development kit includes the mapping relationship between the interface / address of each system capability in the shared library group and the shared library file corresponding to the system capability.
[0191] As is understandable, the specific implementation methods of S801-S803 are described above. Figure 4 As previously mentioned, this will not be repeated here.
[0192] In this application, the above-described scheme allows different applications to access shared libraries using a unified shared library access method when calling system capabilities, obtaining the corresponding shared library files as needed. This unified approach to accessing shared libraries by different applications improves system consistency and facilitates system management and maintenance. Furthermore, applications can dynamically call system capabilities based on usage requirements, running the code for system capabilities within the application. This simplifies the implementation of application-based system capability calls, reduces inter-process communication overhead, improves system performance and execution efficiency, and optimizes system capability call configuration. Moreover, application development only requires integrating the shared library SDK, eliminating the need for additional dependency configuration files, thus simplifying application development and reducing the initial installation package size.
[0193] The foregoing mainly describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0194] This application embodiment can divide the above-described electronic device into functional modules based on the method example described above. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware or as software functional modules. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0195] Based on the same inventive concept, embodiments of this application provide a system capability loading device. The system capability loading device provided in embodiments of this application is applied to… Figure 2 The electronic device 200 shown is an example. Figure 9 The diagram shown is a structural schematic of a system capability loading device provided in an embodiment of this application. The system capability loading device 900 can be used to implement the methods described in the above method embodiments. For example, the system capability loading device 900 may specifically include a processing module 901 and a transceiver module 902.
[0196] The processing module 901 is used to support the execution of the system capability loading device 900. Figures 4-8The transceiver module 902 is used to support the system capability loading device 900 in performing any of the processing functions. Figures 4-8 Send and receive functions for any item in the list.
[0197] The system capability loading device 900 may also include a storage module. Figure 9 (not shown in the image), this storage module stores a program or instruction. When the processing module 901 and the transceiver module 902 execute the program or instruction, it causes... Figure 9 The system capability loading device 900 shown can execute the system capability loading method described in the above method embodiments. Of course, the system capability loading device 900 may also include other modules, or it may include even fewer modules. This application embodiment does not limit this.
[0198] Figure 9 The technical effects of the system capability loading device 900 shown can be referred to the technical effects of the method described in the above method embodiments, and will not be repeated here. Figure 9 The processing module 901 involved in the system capability loading device 900 shown can be implemented by a processor or processor-related circuit components, and can be a processor or a processing module.
[0199] This application also provides a chip system, such as... Figure 10 As shown, the chip system 1000 includes at least one processor 1001 and at least one interface circuit 1002. As an example, when the chip system 1000 includes a processor and an interface circuit, the processor can be... Figure 10 The processor 1001 shown in the solid box (or the processor 1001 shown in the dashed box) may have an interface circuit that can be... Figure 10 The interface circuit 1002 is shown in the solid box (or the dashed box). When the chip system 1000 includes two processors and two interface circuits, the two processors include... Figure 10 The processor 1001 shown in the solid box and the processor 1001 shown in the dashed box, the two interface circuits include Figure 10 Interface circuit 1002 is shown in both solid and dashed boxes. No limitations are imposed on this.
[0200] Processor 1001 and interface circuit 1002 can be interconnected via lines. For example, interface circuit 1002 can be used to receive signals. As another example, interface circuit 1002 can be used to send signals to other devices (e.g., processor 1001). Exemplarily, interface circuit 1002 can read instructions stored in memory and send the instructions to processor 1001. When the instructions are executed by processor 1001, the steps in the above embodiments can be performed. Of course, the chip system may also include other discrete devices, and this application embodiment does not specifically limit this.
[0201] Optionally, there can be one or more processors in the chip system. The processor can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor that reads software code stored in memory.
[0202] Optionally, the chip system may also include a memory ( Figure 10 (As shown in the image), the memory can be one or more, and can be integrated with the processor or set separately from the processor; this application is not limited in this regard. For example, the memory can be a non-transient processor, such as read-only memory (ROM), which can be integrated with the processor on the same chip or set separately on different chips. This application does not specifically limit the type of memory or the arrangement of the memory and processor. For example, the chip system can be a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), a system-on-a-chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD), or other integrated chips.
[0203] It should be understood that each step in the above method embodiments can be completed by integrated logic circuits in the processor hardware or by instructions in software form. The method steps disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor.
[0204] This application also provides a computer storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the method described in the above-described method embodiments.
[0205] Computer-readable storage media include, but are not limited to, any of the following: USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and other media capable of storing program code.
[0206] This application provides a computer program product, which includes a computer program or instructions that, when run on a computer, cause the computer to perform the methods described in the above-described method embodiments.
[0207] In addition, this application also provides an apparatus, which may specifically be a chip, component or module. The apparatus may include a connected processor and a memory. The memory is used to store computer execution instructions. When the apparatus is running, the processor can execute the computer execution instructions stored in the memory to cause the apparatus to perform the methods in the above-described method embodiments.
[0208] In addition, this application also provides a system, which may specifically be a chip, component or module. The system may include a connected processor and a memory. The memory is used to store computer execution instructions. When the system is running, the processor can execute the computer execution instructions stored in the memory to enable the system to perform the methods in the above-described method embodiments.
[0209] In this embodiment, the electronic device, computer storage medium, computer program product or chip are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding method provided above, and will not be repeated here.
[0210] The steps of the methods or algorithms described in conjunction with the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, compact disc read-only memory (CD-ROM), or any other form of storage medium well known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an application-specific integrated circuit (ASIC).
[0211] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, the division of the above functional modules is only used as an example. In practical applications, the above functions can be assigned to different functional modules as needed; that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0212] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The embodiments can be combined with or referenced to each other without conflict. The apparatus embodiments described above are merely illustrative; for example, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0213] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0214] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0215] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0216] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A system capability loading method, characterized by, The method is applied to an electronic device, the electronic device comprising a first shared library, the first shared library comprising one or more shared library files, each of the shared library files being used to implement a system capability; the method comprising: receiving a first operation for a first application installed in the electronic device; wherein the first application integrates a first mapping relationship, the first mapping relationship comprising a mapping relationship between a first system capability and an interface / address of a first shared library file; the first shared library file being used to implement the first system capability, the one or more shared library files comprising the first shared library file; in response to the first operation, obtaining the first shared library file through the first mapping relationship; running the first shared library file.
2. The method of claim 1, wherein, The electronic device comprises a shared library group, the shared library group comprising one or more shared libraries, the interface / address of the one or more shared libraries being the same, the interface / address of the one or more shared libraries being used to obtain the first shared library file.
3. The method of claim 2, wherein, The response to the first operation, the first shared library file is obtained through the first mapping relationship, comprising: in response to the first operation, determining an identifier of a first system capability corresponding to the first operation; according to the identifier of the first system capability and the interface / address of the one or more shared libraries, accessing the first shared library; according to the first mapping relationship, obtaining the first shared library file from the first shared library.
4. The method according to claim 2 or 3, characterized in that, The first application configures the first mapping relationship through a shared library software development kit; the shared library software development kit comprises a mapping relationship between each system capability in the shared library group and an interface / address of a shared library file corresponding to the system capability.
5. The method according to any one of claims 1-4, characterized in that, The response to the first operation, the first shared library file is obtained through the first mapping relationship, comprising: in the case that the first application version and the first shared library version are adapted, in response to the first operation, the first shared library file is obtained through the first mapping relationship.
6. The method according to any one of claims 1-5, characterized in that, The method further comprises: in the case that the first application version and the first shared library version are not adapted, in response to the first operation, a system call interface is used to interact with a process in the electronic device having the first system capability, so as to implement the first system capability.
7. The method according to any one of claims 1 to 6, characterized in that, The method further comprises: in the case that the first mapping relationship does not comprise a second system capability required by the first application, the first application updates the first mapping relationship through a shared library software development kit; the updated first mapping relationship comprises a mapping relationship between the second system capability and an interface / address of a second shared library file, the shared library software development kit comprising a mapping relationship between each system capability in the shared library group and an interface / address of a shared library file corresponding to the system capability.
8. An electronic device, comprising: The electronic device comprises a processor and a memory, the memory being coupled with the processor, the memory being used to store computer readable instructions, when the processor reads the computer readable instructions from the memory, the electronic device executes the method as claimed in any one of claims 1-7.
9. A chip system, characterized by The computer readable storage medium comprises a computer program, which, when executed on an electronic device, causes the electronic device to perform the method of any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises a computer program, which, when executed on an electronic device, causes the electronic device to perform the method of any one of claims 1-7.
11. A computer program product, characterised in that, The computer program product comprises a computer program or instructions, which, when executed on a computer, cause the computer to perform the method of any one of claims 1-7.