Information expansion method, device and electronic equipment
Through API extension and preset kernel implementation, the problem of low adaptation efficiency caused by API fragmentation in the Android system is solved, the adaptation complexity and cost are reduced, and the adaptation efficiency between applications and operating systems is improved.
Patent Information
- Application Number
- CN201910625772.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-07-11
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-03-05
AI Technical Summary
In the Android system, due to differences in the component APIs of different versions, the adaptation efficiency of third-party applications to the operating system is low. The existing technology requires customizing WebView and integrating it with the underlying kernel, which increases complexity and cost.
By determining the target system components and their corresponding APIs to be extended, perform API expansion, generate target function extension objects, and implement the extended functions in the preset kernel, bypassing the steps of integrating custom components with the underlying kernel and directly integrating them into third parties. app.
It improves the efficiency of adaptation between applications and operating systems, reduces adaptation time and operation complexity, and avoids the cost of integrating custom components.
Smart Images

Figure CN112214252B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to an information expansion method, device and electronic equipment. Background Art
[0002] The Android system usually improves old functions, adds new functions, provides more supported file formats, and makes up for some defects in use through system upgrades to provide better services to users.
[0003] Among them, there are various components set up in the Android system, and the API (Application Programming Interface) in the same component of different versions of Android systems may be different, resulting in the problem of API fragmentation; for example, WebView (web view is a view component in the Android system, which loads and displays web pages based on the information extension of the underlying kernel of WebView); for example, a new API is added to the WebView of the upgraded Android system, or the API parameters in the WebView of the Android system before the upgrade are changed, or the API in the WebView of the Android system before the upgrade is not supported, etc.
[0004] Therefore, in order to make third-party applications compatible with various versions of Android systems, in the process of developing third-party applications, the existing technology customizes a WebView based on the API in the existing WebView as a prototype, adds the API of the WebView of all versions of Android systems and the customized API to the customized WebView, and then integrates the customized WebView into the underlying kernel, which has a long implementation cycle and complex operations, and makes the efficiency of adapting the application to the operating system low. Summary of the invention
[0005] The embodiment of the present invention provides an information expansion method to improve the efficiency of adapting an application program to an operating system.
[0006] Correspondingly, the embodiment of the present invention further provides an information expansion device and an electronic device to ensure the implementation and application of the above method.
[0007] In order to solve the above problems, an embodiment of the present invention discloses an information extension method, which specifically includes: determining a target system component; determining a target function object of the target system component corresponding to an application editing interface API to be extended, and determining that the target function object corresponds to the API to be extended; performing API expansion on the target function object to obtain a target function extension object containing the API to be extended; and implementing the function corresponding to the API to be extended in the target function extension object in a preset kernel.
[0008] Optionally, implementing the function corresponding to the API to be extended in the target function extension object in the preset kernel includes: binding the target function object with the corresponding target function extension object in the preset kernel; adding function implementation information corresponding to the API to be extended in the target function extension object.
[0009] Optionally, the target function object is API-expanded to obtain a target function extension object containing the corresponding API to be extended, including: if the API to be extended is the original API contained in the target function object, then changing the parameters of the original API in the target function object, and adding the original API with changed parameters to the corresponding target function extension object; or adding the original API to the corresponding target function extension object; if the API to be extended is not the original API contained in the target function object, then adding the API to be extended to the corresponding target function extension object.
[0010] Optionally, the preset kernel includes a first link interface object, which is used to link the target system component and the preset kernel; the adding of function implementation information corresponding to the API to be extended in the target function extension object includes: obtaining a second link interface object by inheriting the first link interface object; and adding the function implementation information corresponding to the API to be extended in the target function extension object in the second link interface object.
[0011] Optionally, the method further comprises: generating a software development kit SDK according to the target function extension object and the preset kernel; and integrating the SDK into a third-party application to be developed.
[0012] Optionally, the method further includes: installing a third-party application after integrating the SDK; the target system component sends a call request for the API to be called to a preset kernel based on the received startup instruction for the third-party application; the preset kernel returns a callback message corresponding to the API to be called; and the target system component displays the interface of the third-party application based on the callback message.
[0013] An embodiment of the present invention also discloses an information expansion device, which specifically includes: a component determination module, which is used to determine a target system component; an object determination module, which is used to determine a target function object of the target system component corresponding to an application programming interface API to be expanded, and to determine that the target function object corresponds to the API to be expanded; an object expansion module, which is used to perform API expansion on the target function object to obtain a target function expansion object containing the API to be expanded; and a function implementation module, which is used to implement the function corresponding to the API to be expanded in the target function expansion object in a preset kernel.
[0014] Optionally, the function implementation module includes: an object binding submodule, used to bind the target function object with the corresponding target function extension object in a preset kernel; and a function adding submodule, used to add function implementation information corresponding to the API to be extended in the target function extension object.
[0015] Optionally, the object extension module is specifically used to change the parameters of the original API in the target function object and add the original API with changed parameters to the corresponding target function extension object if the API to be extended is the original API contained in the target function object; or to add the original API to the corresponding target function extension object; if the API to be extended is not the original API contained in the target function object, then add the API to be extended to the corresponding target function extension object.
[0016] Optionally, the preset kernel includes a first link interface object, which is used to link the target system component and the preset kernel; the function adding submodule is used to obtain a second link interface object by inheriting the first link interface object; and add function implementation information corresponding to the API to be expanded in the target function extension object in the second link interface object.
[0017] Optionally, the device further comprises: an integration module, configured to generate a software development kit SDK according to the target function extension object and the preset kernel; and integrate the SDK into a third-party application to be developed.
[0018] Optionally, the device also includes: a running module, used to install a third-party application after integrating the SDK; the target system component sends a call request for the API to be called to a preset kernel based on the received startup instruction for the third-party application; the preset kernel returns a callback message corresponding to the API to be called; and the target system component displays the interface of the third-party application based on the callback message.
[0019] An embodiment of the present invention further discloses a readable storage medium. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the information expansion method as described in any one of the embodiments of the present invention.
[0020] An embodiment of the present invention also discloses an electronic device, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations: determining a target system component; determining a target function object of the target system component corresponding to an application programming interface API to be expanded, and determining that the target function object corresponds to the API to be expanded; performing API expansion on the target function object to obtain a target function extension object including the API to be expanded; and implementing the function corresponding to the API to be expanded in the target function extension object in a preset kernel.
[0021] Optionally, implementing the function corresponding to the API to be extended in the target function extension object in the preset kernel includes: binding the target function object with the corresponding target function extension object in the preset kernel; adding function implementation information corresponding to the API to be extended in the target function extension object.
[0022] Optionally, the target function object is API-expanded to obtain a target function extension object containing the corresponding API to be extended, including: if the API to be extended is the original API contained in the target function object, then changing the parameters of the original API in the target function object, and adding the original API with changed parameters to the corresponding target function extension object; or adding the original API to the corresponding target function extension object; if the API to be extended is not the original API contained in the target function object, then adding the API to be extended to the corresponding target function extension object.
[0023] Optionally, the preset kernel includes a first link interface object, which is used to link the target system component and the preset kernel; the adding of function implementation information corresponding to the API to be extended in the target function extension object includes: obtaining a second link interface object by inheriting the first link interface object; and adding the function implementation information corresponding to the API to be extended in the target function extension object in the second link interface object.
[0024] Optionally, it also includes instructions for performing the following operations: generating a software development kit SDK according to the target function extension object and the preset kernel; and integrating the SDK into a third-party application to be developed.
[0025] Optionally, it also includes instructions for performing the following operations: installing a third-party application after integrating the SDK; the target system component sends a call request for the API to be called to the preset kernel based on the received startup instruction for the third-party application; the preset kernel returns a callback message corresponding to the API to be called; the target system component displays the interface of the third-party application based on the callback message.
[0026] The embodiments of the present invention include the following advantages:
[0027] In an embodiment of the present invention, a target system component can be determined, as well as a target function object of the target system component corresponding to the application editing interface API to be expanded and an API to be expanded corresponding to the target function object; then, the target function object is API-expanded to obtain a target function extension object including the API to be expanded, and the function corresponding to the API to be expanded in the target function extension object is implemented in a preset kernel; subsequently, the target function extension object and the preset kernel can be integrated into a third-party application, so that the third-party application can be adapted to different versions of operating systems. Compared with the prior art, the embodiment of the present invention does not require customized system components and integration of customized system components with the corresponding underlying kernel, which reduces the integration cost, and can reduce the adaptation time and operation complexity, thereby improving the efficiency of adapting the application to the operating system. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 is a flowchart of a method for information expansion according to an embodiment of the present invention;
[0029] Figure 2 is a flowchart of steps of an optional embodiment of an information expansion method of the present invention;
[0030] Figure 3 A flowchart of a method for displaying a third-party application program interface according to an embodiment of the present invention;
[0031] Figure 4 is a structural block diagram of an embodiment of an information expansion device of the present invention;
[0032] Figure 5 is a structural block diagram of an optional embodiment of an information expansion device of the present invention;
[0033] Figure 6 A structural block diagram of an electronic device for information extension according to an exemplary embodiment;
[0034] Figure 7 It is a structural schematic diagram of an electronic device for information extension according to another exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0036] One of the core concepts of the embodiments of the present invention is to perform API expansion on the functional objects of the system components to obtain the extended functional objects, and then implement the API of the extended functional objects in a preset kernel; thereby, there is no need to build custom system components and integrate the custom components with the underlying kernel, thereby improving the efficiency of adapting the application to the operating system.
[0037] The embodiments of the present invention can be applied to a variety of operating systems, such as Android systems, etc., and can be extended for the API of system components (such as WebView, etc.) in the operating system; specifically as follows:
[0038] Reference Figure 1 , shows a flowchart of a method for information expansion according to an embodiment of the present invention, which may specifically include the following steps:
[0039] Step 102: Determine the target system component.
[0040] Step 104: Determine the target function object of the target system component corresponding to the application programming interface API to be extended, and determine the API to be extended corresponding to the target function object.
[0041] Step 106: Perform API expansion on the target function object to obtain a target function expansion object including the corresponding API to be expanded.
[0042] In an embodiment of the present invention, the system components required by the third-party application can be determined from the system components corresponding to the operating system, and then it can be determined whether these system components have an API fragmentation problem; for each system component required by the third-party application, if the system component has an API fragmentation problem, the system component can be determined as a target system component.
[0043] In the embodiment of the present invention, in order to enable the third-party application to adapt to different versions of operating systems, for each target system component, the functional object (hereinafter referred to as the target functional object) that needs to extend the API in the target system component can be determined based on the differences in the target system components corresponding to the different versions of the operating systems, and the API (hereinafter referred to as the API to be extended) that the target functional object corresponds to can be determined. In addition, in order to meet the functional requirements of the third-party application, the target functional object in the target system component and the API to be extended corresponding to the target functional object can also be determined based on the functional requirements of the third-party application. Then, based on the API to be extended, the corresponding target functional object is extended. Of course, if the third-party application has no functional requirements other than the corresponding functions of the target system component, at this time, it is only necessary to determine the target functional object and the API to be extended based on the differences in the target system components corresponding to the different versions of the operating systems; wherein, the target functional object can be used to implement the functions of the target system component, and different target objects correspond to different functions.
[0044] In an embodiment of the present invention, one method for determining the functional objects in the target system components that require API extension based on the differences in the target system components corresponding to different versions of the operating system may be that, for each functional object of the target system component, the API differences between the functional objects corresponding to each version may be compared to determine the APIs with differences; when there are differences in the APIs between the functional objects corresponding to any two versions, the functional object may be determined as a functional object that requires API extension, and the APIs with differences may be determined as APIs to be extended. For example, taking the functional objects of the target system components including: WebView and WebSettings as an example, the APIs corresponding to version 1.0 of WebView include: API11, API12, API13, API14, and the APIs corresponding to WebSettings include: API21, API22, API23, and API24; the APIs corresponding to version 2.0 of WebView include: API11, API12, API14, and API15, and the APIs corresponding to WebSettings include: API21, API22, API23, and API24; the APIs corresponding to version 3.0 of WebView include: API11, API12, API13, and API17, and the APIs corresponding to WebSettings include: API21, API22, API23, and API24. Among them, the target system components of versions 1.0, 2.0 and 3.0 correspond to different APIs in WebView, including: API13, API15 and API17. At this time, WebView can be determined as the functional object that needs to extend the API, that is, the target functional object, and API13, API15 and API17 can be determined as the API to be extended; there is no difference in the API in WebSettings.
[0045] In an embodiment of the present invention, a method for determining the functional object that needs to extend the API in the target system component based on the functional requirements of a third-party application can be to determine the function required by the third-party application and the API corresponding to the required function, search for a functional object that matches the function required by the third-party application from the corresponding functional objects in the target system component, and then determine whether there is an API in the matching functional objects that can implement the required function; if not, the matching functional object can be determined as the functional object of the extended API, that is, the target functional object; and the API corresponding to the required function can be determined as the API to be extended.
[0046] In an embodiment of the present invention, the target function object can be API-extended according to the API to be extended to obtain a corresponding target function extension object; wherein the target function extension object includes the API to be extended. For example, the target function object WebView corresponds to API13, API15 and API17 to be extended, then the target function object WebView is API-extended to obtain a target function extension object WebViewExtension, which can include API13, API15 and API17.
[0047] Step 108: Implement the function corresponding to the API to be extended in the target function extension object in the preset kernel.
[0048] Since the underlying kernel (which can be called the system kernel) corresponding to the target system component in the operating system is usually not allowed to be modified, it is impossible to implement the functions corresponding to each API to be extended by modifying the system kernel in the operating system; therefore, in order to improve the efficiency of implementing the API to be extended, the embodiment of the present invention can obtain a preset kernel, use the preset kernel as the underlying kernel corresponding to the target system component, and then process the preset kernel to implement the functions corresponding to the API to be extended in the target function extension object. Among them, the preset kernel can implement all the functions of the system kernel, and can also include other extended functions, and is also better than the system kernel in performance.
[0049] In an embodiment of the present invention, the system component implements each API function therein by calling the corresponding underlying kernel. Therefore, after obtaining the target function extension object, the function corresponding to the API to be extended in each target function extension object can be implemented in the preset kernel, for example, the function implementation information corresponding to each target API is added to the preset kernel, such as code, etc.
[0050] Subsequently, the target function extension object and the preset kernel can be integrated into the third-party application. After the third-party application is installed in the operating system, the target system component can call the preset kernel to implement the functions of each API, so that the third-party application can be adapted to different versions of the operating system.
[0051] Of course, when the functional requirements of other third-party applications are the same as those of the third-party application, the target functional extension object and the preset kernel can also be integrated into the other third-party applications so that the other third-party applications can be adapted to different versions of the operating system.
[0052] In summary, in the embodiments of the present invention, the target system component can be determined, as well as the target function object of the target system component corresponding to the application editing interface API to be expanded and the API to be expanded corresponding to the target function object; then the target function object is API expanded to obtain a target function extension object including the API to be expanded, and the function corresponding to the API to be expanded in the target function extension object is implemented in the preset kernel; subsequently, the target function extension object and the preset kernel can be integrated into a third-party application, so that the third-party application can be adapted to different versions of operating systems. Compared with the prior art, the embodiments of the present invention do not require customized system components and integration of customized system components with the corresponding underlying kernel, which reduces the integration cost, and can reduce the adaptation time and operation complexity, thereby improving the efficiency of adapting the application to the operating system.
[0053] In another embodiment of the present invention, how to implement the function corresponding to the API to be extended in the target function extension object in a preset kernel is described.
[0054] Reference Figure 2 , shows a flowchart of an optional embodiment of an information expansion method of the present invention, which may specifically include the following steps:
[0055] Step 202: Determine the target system component.
[0056] Step 204: Determine the target function object of the target system component corresponding to the application programming interface API to be extended, and determine the API to be extended corresponding to the target function object.
[0057] In an embodiment of the present invention, the target system component may include multiple components, such as a WebView component, etc.; the embodiment of the present invention does not limit this. In order to avoid custom system components and integrate custom system components with the corresponding underlying kernel, the embodiment of the present invention can determine the target function object of the target system component corresponding to the API to be extended, and the API to be extended corresponding to the target function object; then perform API expansion on the target function object to obtain a target function extension object containing the corresponding API to be extended; and then implement the function corresponding to the API to be extended in the target function extension object in the preset kernel to implement the extension of the API to be extended. The target function object may be one or more; the API to be extended may be one or more, and the embodiment of the present invention does not limit this.
[0058] Step 206: Perform API expansion on the target function object to obtain a target function expansion object including the corresponding API to be expanded.
[0059] In the embodiment of the present invention, any reasonable API can be added to the target function extension object to implement API extension of the corresponding target function object. The embodiment of the present invention does not limit what kind of API to add.
[0060] In one example of the present invention, the API expansion of the target function object to obtain a target function extension object containing the corresponding API to be extended may be, if the API to be extended is the original API contained in the target function object, then the parameters of the original API in the target function object are changed, and the original API with changed parameters is added to the corresponding target function extension object. In order to facilitate the distinction between the API in the target function object and the API in the target function extension object, the API in the target function object may be referred to as the original API. In an embodiment of the present invention, the API to be extended may be the original API in the target function object, and the parameters of the original API in the target function object may be changed; in which, parameters may be added to the original API, or the parameters of the original API may be deleted, which may be determined according to the requirements, and the embodiment of the present invention does not limit this.
[0061] For example, the target function object is WebView, and an example of a target function object is as follows:
[0062] class WebView{
[0063] public void loadUrl(String url);
[0064] };
[0065] If the API to be extended is the original API of WebView: loadUrl, the parameters of the original API in the target function object can be changed, and the original API with changed parameters can be added to the corresponding target function extension object. In an example, the parameters such as String extraParams are added to the original API in the target function object to obtain a target function extension object such as WebViewExtension. An example of a target function extension object is as follows:
[0066] class WebViewExtension{
[0067] public void loadUrl(String url,String extraParams);
[0068] };
[0069] Among them, the original API in the target function object may have defects or incomplete functions, so the original API in the target function object can be directly added to the corresponding target function extension object, and then when the preset kernel implements the original API, the defects corresponding to the API can be modified, or the functions of the API can be improved. Therefore, in an example of the present invention, one way to perform API expansion on the target function object to obtain a target function extension object containing the corresponding API to be expanded can be that if the API to be expanded is the original API contained in the target function object, the original API is added to the corresponding target function extension object.
[0070] For example, based on the example of the target function object above, the original API of WebView: loadUrl is directly added to the corresponding target function extension object, such as:
[0071] class WebViewExtension{
[0072] public void loadUrl(String url);
[0073] };
[0074] In one example of the present invention, one method of performing API expansion on the target function object to obtain a target function extension object containing the corresponding API to be extended may be, if the API to be extended is not the original API contained in the target function object, then adding the API to be extended to the corresponding target function extension object.
[0075] In one example, based on the above example of the target function object, if the API to be extended is newFunc(), the API to be extended is not the original API contained in the target function object. In this case, the API to be extended can be added to obtain the corresponding target function extension object such as WebViewExtension. An example of a target function extension object is as follows:
[0076] class WebViewExtension{
[0077] public void newFunc();
[0078] };
[0079] Step 208: Bind the target function object with the corresponding target function extension object in the preset kernel.
[0080] In an embodiment of the present invention, in order for the target system component to call the API to be extended, the target function object can be bound to the corresponding target function extension object in the preset kernel; wherein, one implementation method can be to bind the target function object to the corresponding target function extension object one by one, and set the life cycle of the target function object to be consistent with the life cycle of the corresponding target function extension object. For example, the target function object WebView is bound to the target function extension object WebViewExtension, and the life cycle of WebView and WebViewExtension are set to be consistent; for another example, the target function object WebViewClient is bound to the target function extension object WebViewClientExtension, and the life cycle of WebViewClient and WebViewClientExtension are set to be consistent; for another example, the target function object WebSettings is bound to the target function extension object WebSettingsExtension, and the life cycle of WebSettingst and WebSettingsExtension are set to be consistent; and so on. wherein, the life cycle of each target function extension object can be set as required, and the life cycles of different target function extension objects can be the same or different, and the embodiment of the present invention does not limit this.
[0081] Step 210: Add the function implementation information corresponding to the API to be extended in the target function extension object.
[0082] In an embodiment of the present invention, the preset kernel includes a first link interface object, which is used to link the target system component and the preset kernel, such as WebViewProvide, and the first link interface object can implement the function of the original API in the target function object.
[0083] Among them, in order to enable the preset kernel to realize the functions of all APIs of the target system components (including the API to be expanded and the original API); the second link interface object can be obtained by inheriting the first link interface object; and the function implementation information corresponding to the target API is added in the second link interface object.
[0084] For example, an example of a first link interface object is as follows:
[0085] WebViewProvider{
[0086] public void loadUrl(String url);
[0087] };
[0088] An example of a second link interface is as follows:
[0089] class WebViewProviderChild implements WebViewProvider{
[0090] @Override
[0091] public void loadUrl(String url){}
[0092] public void loadUrl(String url,String extraParams){}
[0093] };
[0094] In summary, in the embodiments of the present invention, the target system component can be determined, as well as the target function object of the target system component corresponding to the application editing interface API to be expanded and the API to be expanded corresponding to the target function object; then the target function object is API expanded to obtain a target function extension object including the API to be expanded, and the function corresponding to the API to be expanded in the target function extension object is implemented in the preset kernel; subsequently, the target function extension object and the preset kernel can be integrated into a third-party application, so that the third-party application can be adapted to different versions of operating systems. Compared with the prior art, the embodiments of the present invention do not require customized system components and integration of customized system components with the corresponding underlying kernel, which reduces the integration cost, and can reduce the adaptation time and operation complexity, thereby improving the efficiency of adapting the application to the operating system.
[0095] Secondly, in an embodiment of the present invention, a target function object is bound to a corresponding target function extension object in a preset kernel, and then function implementation information corresponding to the API in the target function extension object is added; wherein, the second link interface object can be obtained by inheriting the first link interface object, and function implementation information corresponding to the API to be extended is added to the second link interface object; thereby, the preset kernel can realize not only the function of the API to be extended but also the function of the original API of the target system component through the second link interface object.
[0096] Reference Figure 3 , showing a step flow chart of an embodiment of a method for displaying a third-party application program interface of the present invention.
[0097] Step 302: Generate a software development kit SDK according to the target function extension object and the preset kernel.
[0098] Step 304: Integrate the SDK into the third-party application to be developed.
[0099] In the embodiment of the present invention, after the target function object of the target system component is extended according to the above method, the corresponding target function extension object and the preset kernel with the API implementation information to be extended can be obtained; wherein, in order to facilitate other developers to develop third-party applications, an SDK (Software Development Kit) can be generated based on the target function extension object and the preset kernel, and then the SDK can be provided to the corresponding third-party application developer. Subsequently, the SDK can be integrated into the corresponding third-party application to be developed according to the operation of the third-party application developer.
[0100] Step 306: Install the third-party application integrated with the SDK in the operating system.
[0101] Step 308: The target system component sends a call request of the API to be called to the preset kernel according to the received startup instruction for the application.
[0102] Step 310: The preset kernel returns a callback message corresponding to the API to be called.
[0103] Step 312: The target system component displays the interface of the third-party application according to the callback message.
[0104] Then, after the development of the third-party application to be developed is completed, the third-party application integrated with the SDK can be put online; the user downloads and installs the third-party application integrated with the SDK online. After receiving the user's installation instruction, the terminal can install the third-party application integrated with the SDK into the operating system, and then start the third-party application. After the terminal receives the user's startup instruction for the third-party application, the target system component corresponding to the third-party application can determine the corresponding API to be called, and then send a call request for the API to be called to the preset kernel; wherein the API to be called can include the API to be extended, and can also include the original API, which is not limited in the embodiment of the present invention. After the preset kernel receives the API to be called, it can call the second link interface object, generate callback information corresponding to the API to be called and return it to the target system component. After receiving the callback information, the target system component can display the interface of the third-party application according to the callback message, thereby realizing the rendering of the third-party application interface.
[0105] In summary, in an embodiment of the present invention, a software development kit SDK can be generated based on the target function extension object and the preset kernel, and then after the SDK is integrated into a third-party application to be developed, the third-party application can be adapted to various versions of the operating system, thereby improving the reusability of the method.
[0106] Secondly, in an embodiment of the present invention, a third-party application can be installed after the SDK is integrated. After receiving the startup instruction for the third-party application, the target system component can send a call request for the API to be called to the preset kernel. Correspondingly, the preset kernel can return a callback message corresponding to the API to be called, and then the target system component displays the interface of the third-party application based on the callback message, thereby realizing the rendering of the third-party application through the preset kernel in the integrated SDK.
[0107] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0108] Reference Figure 4 , shows a structural block diagram of an information expansion device embodiment of the present invention, which may specifically include the following modules:
[0109] A component determination module 402 is used to determine a target system component;
[0110] The object determination module 404 is used to determine the target function object of the target system component corresponding to the application programming interface API to be extended, and determine the API to be extended corresponding to the target function object;
[0111] The object extension module 406 is used to perform API extension on the target function object to obtain a target function extension object including the corresponding API to be extended;
[0112] The function implementation module 408 is used to implement the function corresponding to the API to be extended in the target function extension object in the preset kernel.
[0113] Reference Figure 5 , shows a structural block diagram of an optional embodiment of an information expansion device of the present invention.
[0114] In an optional embodiment of the present invention, the function implementation module 408 includes:
[0115] The object binding submodule 4082 is used to bind the target function object with the corresponding target function extension object in the preset kernel;
[0116] The function adding submodule 4084 is used to add the function implementation information corresponding to the API to be extended in the target function extension object.
[0117] In an optional embodiment of the present invention, the object extension module 406 is specifically used to change the parameters of the original API in the target function object and add the original API with changed parameters to the corresponding target function extension object if the API to be extended is the original API contained in the target function object; or add the original API to the corresponding target function extension object; if the API to be extended is not the original API contained in the target function object, then add the API to be extended to the corresponding target function extension object.
[0118] In an optional embodiment of the present invention, the preset kernel includes a first link interface object, which is used to link the target system component and the preset kernel; the function adding submodule 4084 is used to obtain a second link interface object by inheriting the first link interface object; and add function implementation information corresponding to the API to be expanded in the target function extension object in the second link interface object.
[0119] In an optional embodiment of the present invention, the device further includes: an integration module 410, which is used to generate a software development kit SDK based on the target function extension object and the preset kernel; and integrate the SDK into a third-party application to be developed.
[0120] In an optional embodiment of the present invention, the device also includes: an operation module 412, which is used to install a third-party application after integrating the SDK; the target system component sends a call request for the API to be called to the preset kernel based on the received startup instruction for the third-party application; the preset kernel returns a callback message corresponding to the API to be called; and the target system component displays the interface of the third-party application based on the callback message.
[0121] In summary, in the embodiments of the present invention, the target system component can be determined, as well as the target function object of the target system component corresponding to the application editing interface API to be expanded and the API to be expanded corresponding to the target function object; then the target function object is API expanded to obtain a target function extension object including the API to be expanded, and the function corresponding to the API to be expanded in the target function extension object is implemented in the preset kernel; subsequently, the target function extension object and the preset kernel can be integrated into a third-party application, so that the third-party application can be adapted to different versions of operating systems. Compared with the prior art, the embodiments of the present invention do not require customized system components and integration of customized system components with the corresponding underlying kernel, which reduces the integration cost, and can reduce the adaptation time and operation complexity, thereby improving the efficiency of adapting the application to the operating system.
[0122] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0123] Figure 6 1 is a block diagram of an electronic device 600 for information expansion according to an exemplary embodiment. For example, the electronic device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0124] Reference Figure 6 , the electronic device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .
[0125] The processing component 602 generally controls the overall operation of the electronic device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.
[0126] The memory 604 is configured to store various types of data to support operations on the device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phone book data, messages, pictures, videos, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0127] The power component 606 provides power to the various components of the electronic device 600. The power component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 600.
[0128] The multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0129] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the electronic device 600 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.
[0130] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0131] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the electronic device 600. For example, the sensor assembly 614 can detect the open / closed state of the device 600, the relative positioning of components, such as the display and keypad of the electronic device 600, and the sensor assembly 614 can also detect the position change of the electronic device 600 or a component of the electronic device 600, the presence or absence of contact between the user and the electronic device 600, the orientation or acceleration / deceleration of the electronic device 600, and the temperature change of the electronic device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0132] The communication component 616 is configured to facilitate wired or wireless communication between the electronic device 600 and other devices. The electronic device 600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 614 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 614 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0133] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0134] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the instructions can be executed by a processor 620 of an electronic device 600 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0135] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute an information expansion method, the method comprising: determining a target system component; determining a target function object of the target system component corresponding to an application programming interface API to be expanded, and determining that the target function object corresponds to the API to be expanded; performing API expansion on the target function object to obtain a target function expansion object containing the API to be expanded; and implementing the function corresponding to the API to be expanded in the target function expansion object in a preset kernel.
[0136] Optionally, implementing the function corresponding to the API to be extended in the target function extension object in the preset kernel includes: binding the target function object with the corresponding target function extension object in the preset kernel; adding function implementation information corresponding to the API to be extended in the target function extension object.
[0137] Optionally, the target function object is API-expanded to obtain a target function extension object containing the corresponding API to be extended, including: if the API to be extended is the original API contained in the target function object, then changing the parameters of the original API in the target function object, and adding the original API with changed parameters to the corresponding target function extension object; or adding the original API to the corresponding target function extension object; if the API to be extended is not the original API contained in the target function object, then adding the API to be extended to the corresponding target function extension object.
[0138] Optionally, the preset kernel includes a first link interface object, which is used to link the target system component and the preset kernel; the adding of function implementation information corresponding to the API to be extended in the target function extension object includes: obtaining a second link interface object by inheriting the first link interface object; and adding the function implementation information corresponding to the API to be extended in the target function extension object in the second link interface object.
[0139] Optionally, the method further comprises: generating a software development kit SDK according to the target function extension object and the preset kernel; and integrating the SDK into a third-party application to be developed.
[0140] Optionally, the method further includes: installing a third-party application after integrating the SDK; the target system component sends a call request for the API to be called to a preset kernel based on the received startup instruction for the third-party application; the preset kernel returns a callback message corresponding to the API to be called; and the target system component displays the interface of the third-party application based on the callback message.
[0141] Figure 7 : is a structural diagram of an electronic device 700 for information expansion according to another exemplary embodiment of the present invention. The electronic device 700 may be a server, which may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 722 (for example, one or more processors) and a memory 732, and one or more storage media 730 (for example, one or more mass storage devices) storing application programs 742 or data 744. Among them, the memory 732 and the storage medium 730 may be temporary storage or permanent storage. The program stored in the storage medium 730 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 722 may be configured to communicate with the storage medium 730 to execute a series of instruction operations in the storage medium 730 on the server.
[0142] The server may also include one or more power supplies 726, one or more wired or wireless network interfaces 750, one or more input and output interfaces 758, one or more keyboards 756, and / or, one or more operating systems 741, such as Windows ServerTM, Mac OSXTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0143] An electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors. The one or more programs include instructions for performing the following operations: determining a target system component; determining a target function object of the target system component corresponding to an application programming interface API to be expanded, and determining that the target function object corresponds to the API to be expanded; performing API expansion on the target function object to obtain a target function expansion object including the API to be expanded; and implementing the function corresponding to the API to be expanded in the target function expansion object in a preset kernel.
[0144] Optionally, implementing the function corresponding to the API to be extended in the target function extension object in the preset kernel includes: binding the target function object with the corresponding target function extension object in the preset kernel; adding function implementation information corresponding to the API to be extended in the target function extension object.
[0145] Optionally, the target function object is API-expanded to obtain a target function extension object containing the corresponding API to be extended, including: if the API to be extended is the original API contained in the target function object, then changing the parameters of the original API in the target function object, and adding the original API with changed parameters to the corresponding target function extension object; or adding the original API to the corresponding target function extension object; if the API to be extended is not the original API contained in the target function object, then adding the API to be extended to the corresponding target function extension object.
[0146] Optionally, the preset kernel includes a first link interface object, which is used to link the target system component and the preset kernel; the adding of function implementation information corresponding to the API to be extended in the target function extension object includes: obtaining a second link interface object by inheriting the first link interface object; and adding the function implementation information corresponding to the API to be extended in the target function extension object in the second link interface object.
[0147] Optionally, it also includes instructions for performing the following operations: generating a software development kit SDK according to the target function extension object and the preset kernel; and integrating the SDK into a third-party application to be developed.
[0148] Optionally, it also includes instructions for performing the following operations: installing a third-party application after integrating the SDK; the target system component sends a call request for the API to be called to the preset kernel based on the received startup instruction for the third-party application; the preset kernel returns a callback message corresponding to the API to be called; the target system component displays the interface of the third-party application based on the callback message.
[0149] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0150] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0151] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0152] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0153] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0154] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0155] The above is a detailed introduction to an information expansion method, an information expansion device and an electronic device provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. An information expansion method, It is characterized in that include: Identify target system components; Determine the target function object of the target system component corresponding to the application programming interface API to be extended, and determine the target function object corresponds to the API to be extended; Performing API extension on the target function object to obtain a target function extension object including the corresponding API to be extended; Using a preset kernel as the underlying kernel corresponding to the target system component, and implementing the function corresponding to the API to be extended in the target function extension object in the preset kernel; Generate a software development kit SDK according to the target function extension object and the preset kernel; Integrate the SDK into the third-party application to be developed.
2. The method according to claim 1, It is characterized in that The implementing in the preset kernel the function corresponding to the API to be extended in the target function extension object includes: Binding the target function object with the corresponding target function extension object in the preset kernel; Add the function implementation information corresponding to the API to be extended in the target function extension object.
3. The method according to claim 1, It is characterized in that The step of performing API extension on the target function object to obtain a target function extension object including the corresponding API to be extended includes: If the API to be extended is the original API contained in the target function object, then change the parameters of the original API in the target function object, and add the original API with changed parameters to the corresponding target function extension object; or add the original API to the corresponding target function extension object; If the API to be extended is not the original API contained in the target function object, the API to be extended is added to the corresponding target function extension object.
4. The method according to claim 2, It is characterized in that The preset kernel includes a first link interface object, and the first link interface object is used to link the target system component and the preset kernel; The adding of the function implementation information corresponding to the API to be extended in the target function extension object includes: Obtain the second link interface object by inheriting the first link interface object; The function implementation information corresponding to the API to be extended in the target function extension object is added in the second link interface object.
5. The method according to claim 1, It is characterized in that The method further comprises: Install third-party applications that integrate the SDK; The target system component sends a call request of the API to be called to the preset kernel according to the received startup instruction for the third-party application; The preset kernel returns a callback message corresponding to the API to be called; The target system component displays the interface of the third-party application according to the callback message.
6. An information expansion device, It is characterized in that include: A component determination module, used for determining target system components; An object determination module, used to determine a target function object of the target system component corresponding to the application programming interface API to be extended, and to determine that the target function object corresponds to the API to be extended; An object extension module, used to perform API extension on the target function object to obtain a target function extension object including the corresponding API to be extended; A function implementation module, used to use a preset kernel as the underlying kernel corresponding to the target system component, and implement the function corresponding to the API to be extended in the target function extension object in the preset kernel; The integration module is used to generate a software development kit SDK according to the target function extension object and the preset kernel; and integrate the SDK into the third-party application to be developed.
7. The device according to claim 6, It is characterized in that The function implementation module includes: The object binding submodule is used to bind the target function object with the corresponding target function extension object in the preset kernel; The function adding submodule is used to add the function implementation information corresponding to the API to be extended in the target function extension object.
8. The device according to claim 6, It is characterized in that The object extension module is specifically used to change the parameters of the original API in the target function object and add the original API with changed parameters to the corresponding target function extension object if the API to be extended is the original API contained in the target function object; or to add the original API to the corresponding target function extension object; if the API to be extended is not the original API contained in the target function object, then add the API to be extended to the corresponding target function extension object.
9. The device according to claim 7, It is characterized in that The preset kernel includes a first link interface object, and the first link interface object is used to link the target system component and the preset kernel; The function adding submodule is used to obtain the second link interface object by inheriting the first link interface object; and add the function realization information corresponding to the API to be extended in the target function extension object in the second link interface object.
10. The device according to claim 6, It is characterized in that The device also includes: A running module is used to install a third-party application after integrating the SDK; the target system component sends a call request of the API to be called to the preset kernel according to the received startup instruction for the third-party application; the preset kernel returns a callback message corresponding to the API to be called; the target system component displays the interface of the third-party application according to the callback message.
11. A readable storage medium, It is characterized in that When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the information expansion method as described in any one of method claims 1-5.
12. An electronic device, It is characterized in that The system comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations: Identify target system components; Determine the target function object of the target system component corresponding to the application programming interface API to be extended, and determine the target function object corresponds to the API to be extended; Performing API extension on the target function object to obtain a target function extension object including the corresponding API to be extended; Using a preset kernel as the underlying kernel corresponding to the target system component, and implementing the function corresponding to the API to be extended in the target function extension object in the preset kernel; Generate a software development kit SDK according to the target function extension object and the preset kernel; Integrate the SDK into the third-party application to be developed.
13. The electronic device according to claim 12, It is characterized in that The implementing in the preset kernel the function corresponding to the API to be extended in the target function extension object includes: Binding the target function object with the corresponding target function extension object in the preset kernel; Add the function implementation information corresponding to the API to be extended in the target function extension object.
14. The electronic device according to claim 12, It is characterized in that The step of performing API extension on the target function object to obtain a target function extension object including the corresponding API to be extended includes: If the API to be extended is the original API contained in the target function object, then change the parameters of the original API in the target function object, and add the original API with changed parameters to the corresponding target function extension object; or add the original API to the corresponding target function extension object; If the API to be extended is not the original API contained in the target function object, the API to be extended is added to the corresponding target function extension object.
15. The electronic device according to claim 13, It is characterized in that The preset kernel includes a first link interface object, and the first link interface object is used to link the target system component and the preset kernel; The adding of the function implementation information corresponding to the API to be extended in the target function extension object includes: Obtain the second link interface object by inheriting the first link interface object; The function implementation information corresponding to the API to be extended in the target function extension object is added in the second link interface object.
16. The electronic device according to claim 12, It is characterized in that Also contains instructions for: Install third-party applications that integrate the SDK; The target system component sends a call request of the API to be called to the preset kernel according to the received startup instruction for the third-party application; The preset kernel returns a callback message corresponding to the API to be called; The target system component displays the interface of the third-party application according to the callback message.
