Function interface calling method and device, equipment, storage medium and product

By processing front-end application call requests in embedded operating systems through a general feature framework, and generating call parameters identical to those of the underlying language, the high development costs and inflexibility across platforms caused by changes in front-end languages ​​are solved, achieving the effect of directly calling target interfaces without learning a new language.

CN120950152APending Publication Date: 2025-11-14BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410599533.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-14
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

In embedded operating systems, when the front-end application language changes, developers need to learn the new language and perform interface call data conversion, resulting in high development costs and inflexibility across platforms.

Method used

A general feature framework is used to process target call requests, generating call parameters that are identical to those of the target underlying language. By processing target call requests through the general feature framework, a universal solution for interface calls of multiple front-end languages ​​is established, avoiding the need to learn the language engine interfaces of different front-end applications.

Benefits of technology

It enables direct calling of target interfaces without learning a new language when the front-end application language changes, reducing the learning cost and conversion complexity for developers and improving the flexibility of cross-platform applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120950152A_ABST
    Figure CN120950152A_ABST
Patent Text Reader

Abstract

The invention relates to a function interface calling method and device, equipment, a storage medium and a product, and relates to the technical field of data processing.The method comprises the steps that a target calling request of a target application for a target function is processed through a universal feature framework, and a target calling parameter of a corresponding target interface can be obtained; the target calling parameter is generated based on the target underlying language corresponding to the target function, that is, the language of the target calling parameter is the same as that of the target interface, so that the target interface can be directly called based on the target calling parameter, and the target function is realized. The general feature framework can process the call requests generated by various front-end languages, a developer does not need to learn engine interfaces of languages corresponding to different front-end applications, and under the condition that the languages of the front-end applications are changed, the developer does not need to learn new languages and convert interface call data of front-end application pages according to the new languages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and in particular to a method, apparatus, device, storage medium, and product for calling a functional interface. Background Technology

[0002] In embedded operating systems, more and more front-end technologies are being incorporated, using languages ​​such as JavaScript (JS) or TypeScript (TS) to write applications, enabling cross-platform compatibility. The underlying interface languages, however, are written in languages ​​like C (C Programming Language) or C++ (C++ Programming Language), requiring the conversion of data from front-end application page API calls to enable calls to the underlying interfaces. Summary of the Invention

[0003] To overcome the problems existing in the related technologies, this disclosure provides a method, apparatus, device, storage medium and product for calling functional interfaces, so that developers do not need to learn the engine interfaces of different front-end applications corresponding to different languages, and when the language of the front-end application changes, developers do not need to learn a new language and convert the interface call data of the front-end application page for the new language.

[0004] According to a first aspect of the present disclosure, a method for calling a functional interface is provided, including: Obtain the target application's target call request for the target function. The target call request is generated based on the target front-end language corresponding to the target application. The target front-end language is any one of a variety of front-end languages ​​that are different from the target underlying language corresponding to the target function. The target call request is processed by a general feature framework to obtain the target call parameters of the target application for the target function. The target call parameters are generated based on the target underlying language. The general feature framework is established based on the original call requests of multiple original applications using the various front-end languages ​​for different functions. The target interface is invoked according to the target invocation parameters.

[0005] Optionally, the general feature framework is obtained through the following steps: Identify multiple candidate functions corresponding to the multiple original applications; For any candidate function, based on the original call requests of the multiple original applications for the candidate function, a conversion file corresponding to the candidate function is obtained, and the conversion file is used to determine the call parameters corresponding to the candidate function. Based on the conversion files corresponding to the multiple candidate functions, the general feature framework is established.

[0006] Optionally, obtaining the conversion file corresponding to any candidate function based on the original call requests from the plurality of original applications for any candidate function includes: Obtain a target description file, which is obtained based on the original call requests of the plurality of original applications for any of the candidate functions; The target description file is processed to obtain a target glue code file, wherein the glue code in the target glue code file is written based on the target underlying language; Obtain the interface function, which is derived from the target glue code file; Based on the interface function and the target glue code file, the conversion file corresponding to any candidate function is obtained.

[0007] Optionally, processing the target description file to obtain the target glue code file includes: The target generation tool is determined based on the language type of the target call request; The target description file is processed by the target generation tool to obtain the target glue code file.

[0008] Optionally, the step of processing the target invocation request through a general feature framework to obtain the target invocation parameters of the target application for the target interface corresponding to the target function includes: Identify the key fields in the target call request; Based on the key fields, the target conversion file corresponding to the target function is determined from the general feature framework; Based on the target conversion file, the target call request is processed to obtain the target call parameters of the target application for the target interface corresponding to the target function.

[0009] Optionally, processing the target call request according to the target conversion file to obtain the target call parameters of the target application for the target interface corresponding to the target function includes: Based on the target conversion file, a conversion object is generated, the conversion object including the mapping relationship between the original interface description and the underlying interface pointer for the target function; Based on the instance object and the target call request, obtain the target original interface description for the target function; Based on the transformation object, the target original interface description is processed to obtain the target underlying interface pointer; Based on the local object and the target underlying interface pointer, the target call parameters of the target application for the target interface corresponding to the target function are obtained.

[0010] Optionally, obtaining the target application's target invocation request for the target function includes: Based on the instance object, obtain the target call request for the target function from the target page of the target application.

[0011] Optionally, the method further includes: Delete the instance object if the target page is closed; If the target application is closed, delete the conversion object and the local object.

[0012] According to a second aspect of the present disclosure, a function interface calling device is provided, comprising: The acquisition module is configured to acquire a target invocation request for a target function from a target application. The target invocation request is generated based on the target front-end language corresponding to the target application. The target front-end language is any one of a variety of front-end languages ​​that are different from the target underlying language corresponding to the target function. The first obtaining module is configured to process the target call request through a general feature framework to obtain the target call parameters of the target application for the target function. The target call parameters are generated based on the target underlying language. The general feature framework is established based on the original call requests of multiple original applications using the various front-end languages ​​for different functions. The calling module is configured to invoke the target interface based on the target invocation parameters.

[0013] According to a third aspect of the present disclosure, an electronic device is provided, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to execute the steps of calling the functional interface provided in the first aspect of this disclosure.

[0014] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, having stored thereon computer program instructions that, when executed by a processor, implement the steps of the function interface calling method provided in the first aspect of the present disclosure.

[0015] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the functional interface calling method provided in the first aspect of the present disclosure.

[0016] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects: By processing target application calls for target functions using a general feature framework, the target call parameters of the corresponding target interfaces can be obtained. These target call parameters are generated based on the target underlying language corresponding to the target function; that is, the language of the target call parameters is the same as the language of the target interface. This allows for direct invocation of the target interface based on these parameters, thereby achieving the target function. Specifically, the target call request is generated based on the target front-end language corresponding to the target application. The target front-end language can be any of several front-end languages ​​different from the target underlying language corresponding to the target function. Furthermore, the general feature framework is built upon multiple original applications using various front-end languages ​​to handle original call requests for different functions. This enables the general feature framework to process call requests generated by multiple front-end languages. Developers do not need to learn the engine interfaces of different front-end application languages, and they do not need to learn new languages ​​and convert the interface call data of the front-end application pages for new languages ​​when the language of the front-end application changes.

[0017] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0019] Figure 1 This is a schematic diagram of an application system illustrating a functional interface calling method according to an exemplary embodiment.

[0020] Figure 2 This is a flowchart illustrating a functional interface invocation method according to an exemplary embodiment.

[0021] Figure 3 This is a flowchart illustrating a method for constructing a general feature framework according to an exemplary embodiment.

[0022] Figure 4 This is a schematic diagram illustrating a description file conversion according to an exemplary embodiment.

[0023] Figure 5 This is a schematic diagram illustrating a general feature framework according to an exemplary embodiment.

[0024] Figure 6 This is a block diagram illustrating a function interface calling device according to an exemplary embodiment.

[0025] Figure 7This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation

[0026] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0027] The embodiments described in the following examples of this disclosure are not representative of all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0028] It should be noted that all actions involving the acquisition of signals, information, or data in this disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the location is situated, and with authorization from the owner of the relevant device.

[0029] In embedded operating systems, more and more front-end technologies are being incorporated, using languages ​​like JavaScript or TypeScript to write applications that can be used across different platforms. The underlying interface languages, however, are written in languages ​​like C or C++, requiring the conversion of data from the front-end application's API calls to enable the underlying interface to function.

[0030] In related technologies, various modules can be managed using a JS framework. Developers use the JS engine interface to convert the interface data of the JS page into C / C++ data before calling the underlying interface. However, the learning curve for module developers is steep, requiring them to learn the JS engine, and it lacks cross-platform flexibility. For example, if the front-end language changes to TypeScript in the future, the module implementation will need to be reimplemented, requiring the developer to learn the new language and convert the interface call data of the front-end application page for the new language.

[0031] To address the aforementioned technical problems, this disclosure provides a method, apparatus, device, storage medium, and product for calling a functional interface. By processing target application calls for target functions using a general feature framework, target call parameters for the corresponding target interface can be obtained. These target call parameters are generated based on the target underlying language corresponding to the target function; that is, the language of the target call parameters is the same as the language of the target interface, allowing direct invocation of the target interface based on these parameters to achieve the target function. The target call request is generated based on the target front-end language corresponding to the target application, and the target front-end language can be any of several front-end languages ​​different from the target underlying language corresponding to the target function. The general feature framework is established based on original call requests for different functions from multiple original applications using various front-end languages, enabling the general feature framework to handle call requests generated by multiple front-end languages. Developers do not need to learn the engine interfaces of different front-end application languages, and when the language of the front-end application changes, developers do not need to learn a new language and convert the interface call data of the front-end application page for the new language.

[0032] Figure 1 This is a schematic diagram of an application system illustrating a functional interface calling method according to an exemplary embodiment, such as... Figure 1 As shown, the application system may include a front-end application, a language framework, a general feature framework, an engine, and an underlying OS (Operating System). The language framework may include a JS framework or a TS framework; the general feature framework may include various interface language conversions corresponding to different functions, used to implement interface language conversion in function call methods; the engine may include a JS engine or a TS engine; and the underlying OS may include asynchronous I / O libraries and drivers.

[0033] Figure 2 This is a flowchart illustrating a functional interface invocation method according to an exemplary embodiment, such as... Figure 2 As shown, this method can be used in a terminal or server and may include the following steps.

[0034] In step S201, a target call request for a target function is obtained from the target application. The target call request is generated based on the target front-end language corresponding to the target application. The target front-end language is any one of a variety of front-end languages ​​that are different from the target underlying language corresponding to the target function.

[0035] In this embodiment, the target application can be any application installed on the terminal, such as a video application or a music application. The target function can be any of the multiple functions that the target application can perform, such as turning on Bluetooth, adjusting volume, and adjusting screen brightness. The target call request can be generated based on the user's operation on the target page of the target application. The target front-end language is the language used to write the target application, such as JS or TS. The target underlying language corresponding to the target function is the general language of the underlying interface, such as C or C++. The target front-end language can be any of several front-end languages ​​that are different from the target underlying language corresponding to the target function.

[0036] In step S202, the target call request is processed through a general feature framework to obtain the target call parameters of the target interface corresponding to the target function of the target application. The target call parameters are generated based on the target underlying language. The general feature framework is established based on the original call requests of multiple original applications using multiple front-end languages ​​for different functions.

[0037] In this embodiment, a general feature framework can be established based on original call requests from multiple original applications for different functions. Each original application uses a single front-end language, while the front-end languages ​​used by multiple original applications may not be identical, allowing for the use of multiple front-end languages ​​across the applications. This enables the general feature framework to handle call requests from multiple front-end languages. By processing the target call request through the general feature framework, the target call parameters of the corresponding target interface can be obtained. Furthermore, these target call parameters are generated based on the target underlying language corresponding to the target function; that is, the language of the target call parameters is the same as the language of the target interface.

[0038] In step S203, the target interface is invoked according to the target invocation parameters.

[0039] In this embodiment, since the language of the target call parameter is the same as the language of the target interface, the target interface can be called directly based on the target call parameter to achieve the target function. The underlying target interface can be called through libffi.

[0040] In this embodiment, a general feature framework processes the target application's target call request for the target function to obtain the target call parameters of the corresponding target interface. These target call parameters are generated based on the target underlying language corresponding to the target function; that is, the language of the target call parameters is the same as the language of the target interface, allowing direct invocation of the target interface based on these parameters to achieve the target function. The target call request is generated based on the target front-end language corresponding to the target application, and the target front-end language can be any of several front-end languages ​​different from the target underlying language corresponding to the target function. The general feature framework is established based on original call requests for different functions from multiple original applications using various front-end languages, enabling it to handle call requests generated by multiple front-end languages. Developers do not need to learn the engine interfaces of different front-end application languages, and even if the language of the front-end application changes, developers do not need to learn a new language and convert the interface call data of the front-end application page for the new language.

[0041] Figure 3 This is a flowchart illustrating a method for constructing a general feature framework according to an exemplary embodiment, such as... Figure 3 As shown, in one possible implementation, the general feature framework is obtained through the following steps: In step S301, multiple candidate functions corresponding to multiple original applications are determined.

[0042] In this embodiment, multiple candidate functions can be determined based on multiple original applications. The original applications can be any application, and each original application can be analyzed to determine its corresponding function and the underlying interface. As many original applications as possible can be used to cover all the underlying interfaces of the terminal. The functions corresponding to all original applications can be used to determine multiple candidate functions.

[0043] In step S302, for any candidate function, a conversion file corresponding to any candidate function is obtained based on the original call requests of multiple original applications for any candidate function. This conversion file is used to determine the call parameters corresponding to any candidate function.

[0044] In this embodiment, multiple different applications may have the same functionality, and the same functionality corresponds to the same underlying interface. A conversion file can be created for each candidate function. Specifically, for any candidate function, the original call requests from multiple original applications for that candidate function can be analyzed to obtain a general processing method based on that candidate function, thereby obtaining the conversion file corresponding to that candidate function. This allows the call parameters of the underlying interface corresponding to the candidate function to be obtained based on the conversion file during use.

[0045] In step S303, a general feature framework is established based on the conversion files corresponding to multiple candidate functions.

[0046] In this embodiment, multiple candidate function conversion files can be integrated together based on a unified framework to obtain a general feature framework, so that the general feature framework can handle call requests generated by multiple front-end languages.

[0047] Figure 4 This is a schematic diagram illustrating a description of file conversion according to an exemplary embodiment, such as... Figure 4 As shown, in one possible implementation, the method for obtaining the conversion file corresponding to any candidate function based on the original call requests from multiple original applications for any candidate function can be as follows: Obtain the target description file, which is derived from the original call requests of multiple original applications for any candidate function; process the target description file to obtain the target glue code file, in which the glue code is written based on the target underlying language; obtain the interface functions, which are derived from the target glue code file; and obtain the conversion file corresponding to any candidate function based on the interface functions and the target glue code file.

[0048] In this embodiment, a target description file corresponding to the original call request can be obtained, which can be based on developer input. Developers can input a general description file, i.e., the target description file, based on the parameters in the original call request. This target description file can be a Jidl description file. The obtained target description file is then processed, and different glue generation tools can be used based on different front-end languages ​​to generate target glue code. This glue generation tool can be a Jidl tool. Figure 4 The unified AST (Abstract Syntax Tree) in the code is in JSON (JavaScript Object Notation) format. Backend tools can generate corresponding JS description files, facilitating future compatibility with TS description files. Developers only need to add one JIDL description file; the tool automatically generates the corresponding JS / TS interface descriptions, and then the corresponding glue code file to implement the functional interface descriptions. The glue code in this target glue code file is written in the target underlying language, i.e., all data is C / C++. This allows developers to write corresponding interface functions based on this target glue code without needing to learn a frontend language, thus obtaining the interface functions. These interface functions can be in an impl.c file. Figure 4 This involves implementing user-written glue code to obtain the corresponding conversion file for the candidate function based on the interface function and the target glue code file.

[0049] In one possible implementation, the method for processing the target description file to obtain the target glue code file can be as follows: Based on the language type of the target call request, determine the target generation tool; process the target description file using the target generation tool to obtain the target glue code file.

[0050] In this implementation, different language types can be processed using different generation tools. The language type of the target call request can be determined, thereby identifying the corresponding target generation tool. For example, for the JS language, the generation tool corresponding to JS is used; for the TS language, the generation tool corresponding to TS is used. Based on the target generation tool, the target description file can be automatically processed to obtain the corresponding target glue code file. For example, for the function "test", the target generation tool can be used to process the target description file to obtain the corresponding glue code header file "test.h" and a C file "test.c" containing the target description information from the target description file, so that these two target glue code files can be copied to the feature framework-related directory for compilation.

[0051] Figure 5 This is a schematic diagram illustrating a general feature framework according to an exemplary embodiment, such as... Figure 5 As shown, in one possible implementation, the method for processing the target call request through a general feature framework to obtain the target call parameters of the target application for the target function can be as follows: Identify the key fields in the target call request; based on the key fields, determine the target transformation file corresponding to the target function from the general feature framework; based on the target transformation file, process the target call request to obtain the target call parameters of the target application for the target interface corresponding to the target function.

[0052] In this implementation, key fields can be detected in the target call request to obtain these key fields. Based on the parameters in these key fields, the function to be called is determined. This allows for the identification of a target conversion file corresponding to the target function from a general feature framework. In the general feature framework, one function corresponds to one conversion file. By processing the target call request using the target conversion file, the target call parameters for the target interface corresponding to the target function in the target application can be obtained.

[0053] In one possible implementation, the method for processing the target call request based on the target transformation file to obtain the target call parameters of the target application for the target function can be as follows: Based on the target transformation file, a transformation object is generated, which includes the mapping relationship between the original interface description for the target function and the underlying interface pointer; based on the instance object and the target call request, the target original interface description for the target function is obtained; based on the transformation object, the target original interface description is processed to obtain the target underlying interface pointer; based on the local object and the target underlying interface pointer, the target call parameters of the target application for the target interface corresponding to the target function are obtained.

[0054] In this implementation, a transformation object can be generated based on the target transformation file to process target invocation requests. This transformation object includes a mapping between the original interface description for the target function and the underlying interface pointers. The transformation object can be a Feature Prototype, created upon first reference, i.e., upon the first invocation of the target function. One function corresponds to one transformation object.

[0055] Multiple instance objects may exist simultaneously, and a new instance object can be created each time the target function is invoked. The specific parameters for each call to the target function may differ. For example, for the brightness function, the adjusted brightness value may vary each time. The target call request can be described and processed based on the instance object corresponding to the current target call request to obtain the target original interface description for the target function. Based on the mapping relationship between the original interface description and the underlying interface pointer in the conversion object, the target underlying interface pointer corresponding to the target original interface description is determined. Then, based on the local object, the target underlying interface pointer is parsed to obtain the target call parameters for the target interface corresponding to the target function in the target application. These target call parameters are the underlying interface function that calls the target interface. The local object can be created based on the conversion object.

[0056] In one possible implementation, the instance object can be used by the target page of the target application to obtain the target invocation request. The method for obtaining the target invocation request for the target function of the target application can be: based on the instance object, obtain the target invocation request for the target function from the target page of the target application.

[0057] The instance object can be used by the target page of the target application. When the user interacts with the target page, a target call request for the corresponding target function can be generated, and the target call request can be obtained based on the instance object.

[0058] In one possible implementation, the lifecycle of the created objects can also be managed, deleting instance objects when the target page is closed, and deleting transformation objects and local objects when the target application is closed.

[0059] In this implementation, the lifecycle of created objects can be managed automatically without requiring user deletion. When the target page is closed, the instance objects used for the target page can be deleted, and when the target application is closed, the transformation objects and local objects are deleted to release processing resources.

[0060] Figure 6 This is a block diagram illustrating a function interface calling device according to an exemplary embodiment. (Refer to...) Figure 6 The function interface calling device 600 includes an acquisition module 601, a first acquisition module 602, and a calling module 603.

[0061] The acquisition module 601 is configured to acquire a target application’s target call request for a target function. The target call request is generated based on the target front-end language corresponding to the target application. The target front-end language is any one of a variety of front-end languages ​​that are different from the target underlying language corresponding to the target function. The first obtaining module 602 is configured to process the target call request through a general feature framework to obtain the target call parameters of the target application for the target function. The target call parameters are generated based on the target underlying language, and the general feature framework is established based on the original call requests of multiple original applications using the various front-end languages ​​for different functions. The calling module 603 is configured to call the target interface according to the target calling parameters.

[0062] Optionally, the function interface calling device 600 further includes: The determination module is configured to determine multiple candidate functions corresponding to the multiple original applications; The second obtaining module is configured to, for any candidate function, obtain a conversion file corresponding to the candidate function based on the original call requests of the plurality of original applications for the candidate function, wherein the conversion file is used to determine the call parameters corresponding to the candidate function. The module is configured to establish the general feature framework based on the conversion files corresponding to the multiple candidate functions.

[0063] Optionally, the second obtaining module includes: The first acquisition submodule is configured to acquire a target description file, which is obtained based on the original call requests of the plurality of original applications for any of the candidate functions; The first obtaining submodule is configured to process the target description file to obtain a target glue code file, wherein the glue code in the target glue code file is written based on the target underlying language; The second acquisition submodule is configured to acquire an interface function, which is obtained based on the target glue code file; The second obtaining submodule is configured to obtain the conversion file corresponding to any candidate function based on the interface function and the target glue code file.

[0064] Optionally, the first obtaining submodule includes: The determining unit is configured to determine the target generation tool based on the language type of the target invocation request; The first obtaining unit is configured to process the target description file according to the target generation tool to obtain the target glue code file.

[0065] Optionally, the first obtaining module 602 includes: The first determining submodule is configured to determine key fields in the target call request; The second determining submodule is configured to determine the target conversion file corresponding to the target function from the general feature framework based on the key fields; The third submodule is configured to process the target call request based on the target conversion file to obtain the target call parameters of the target application for the target interface corresponding to the target function.

[0066] Optionally, the third obtaining submodule includes: The generation unit is configured to generate a conversion object based on the target conversion file, the conversion object including a mapping relationship between the original interface description and the underlying interface pointer for the target function; The second obtaining unit is configured to obtain the target original interface description for the target function based on the instance object and the target call request; The third obtaining unit is configured to process the target original interface description based on the conversion object to obtain the target underlying interface pointer; The fourth obtaining unit is configured to obtain the target call parameters of the target application for the target function based on the local object and the target underlying interface pointer.

[0067] Optionally, the acquisition module 601 includes: The third acquisition submodule is configured to acquire the target call request for the target function from the target page of the target application based on the instance object.

[0068] Optionally, the function interface calling device 600 further includes: The first deletion module is configured to delete the instance object when the target page is closed; The second deletion module is configured to delete the conversion object and the local object when the target application is closed.

[0069] Regarding the functional interface calling device 600 in the above embodiments, the specific methods by which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0070] This disclosure also provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the steps of the function interface calling method provided in this disclosure.

[0071] Figure 7 This is a block diagram illustrating an electronic device according to an exemplary embodiment. For example, the electronic device 700 may be a mobile phone, a computer, a tablet device, a personal digital assistant, etc.

[0072] Reference Figure 7 The electronic device 700 may include one or more of the following components: processing component 702, memory 704, power supply component 706, multimedia component 708, audio component 710, input / output interface 712, sensor component 714, and communication component 716.

[0073] Processing component 702 typically controls the overall operation of electronic device 700, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the aforementioned function interface call methods. Furthermore, processing component 702 may include one or more modules to facilitate interaction between processing component 702 and other components. For example, processing component 702 may include a multimedia module to facilitate interaction between multimedia component 708 and processing component 702.

[0074] Memory 704 is configured to store various types of data to support the operation of electronic device 700. Examples of this data include instructions for any application or method operating on electronic device 700, contact data, phonebook data, messages, pictures, videos, etc. Memory 704 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 storage, flash memory, magnetic disk, or optical disk.

[0075] Power supply component 706 provides power to various components of electronic device 700. Power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 700.

[0076] Multimedia component 708 includes a screen that provides an output interface between the electronic device 700 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 touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 708 includes a front-facing camera and / or a rear-facing camera. When the electronic device 700 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0077] Audio component 710 is configured to output and / or input audio signals. For example, audio component 710 includes a microphone (MIC) configured to receive external audio signals when electronic device 700 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 704 or transmitted via communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.

[0078] Input / output interface 712 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0079] Sensor assembly 714 includes one or more sensors for providing state assessments of various aspects of electronic device 700. For example, sensor assembly 714 can detect the on / off state of electronic device 700, the relative positioning of components such as the display and keypad of electronic device 700, changes in position of electronic device 700 or a component of electronic device 700, the presence or absence of user contact with electronic device 700, orientation or acceleration / deceleration of electronic device 700, and temperature changes of electronic device 700. Sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 714 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.

[0080] Communication component 716 is configured to facilitate wired or wireless communication between electronic device 700 and other devices. Electronic device 700 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 716 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 716 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0081] In an exemplary embodiment, the electronic device 700 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 execute the above-described function interface call method.

[0082] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, which can be executed by a processor 720 of an electronic device 700 to complete the aforementioned function interface call method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0083] In another exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program executable by a programmable device, the computer program having a code portion for performing the above-described functional interface call method when executed by the programmable device.

[0084] Those skilled in the art will also understand that the various illustrative logical blocks and steps listed in the embodiments of this application can be implemented by electronic hardware, computer software, or a combination of both. Whether such functionality is implemented through hardware or software depends on the specific application and the overall system design requirements. Those skilled in the art can implement the described functionality using various methods for each specific application, but such implementation should not be construed as exceeding the scope of protection of the embodiments of this application.

[0085] In the above detailed description, terms such as "center," "upper," "lower," "left," and "right" indicate direction or positional relationship. Since components of the described device can be positioned in multiple different orientations, these directional terms are for illustrative purposes and not restrictive. It should be understood that other aspects can be utilized and structural or logical changes can be made without departing from the concept of this disclosure. Therefore, the following detailed description should not be considered limiting.

[0086] It should be understood that, unless otherwise specifically indicated, features of various embodiments of this disclosure described herein can be combined with each other.

[0087] Although terms such as “first,” “second,” and “third” may be used herein to describe various components, parts, regions, layers, or sections, these components, parts, regions, layers, or sections are not limited to these terms. Rather, these terms are used only to distinguish one component, part, region, layer, or section from another. Therefore, without departing from the teachings of the examples described herein, the first component, part, region, layer, or section mentioned in the examples may also be referred to as the second component, part, region, layer, or section. Furthermore, the terms “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 indicated technical features. Thus, a feature defined as “first” or “second” may explicitly or implicitly include at least one of that feature. In the description herein, “a plurality” means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0088] Furthermore, the term “exemplary” is used herein to mean serving as an example, instance, or illustration. Any aspect or design described herein as “exemplary” is not necessarily to be construed as advantageous compared to other aspects or designs. Rather, the use of the term “exemplary” is intended to present the concept in a concrete manner. As used herein, the term “or” is intended to mean an inclusive “or” rather than an exclusive “or.” That is, unless otherwise specified or clear from the context, “X applies A or B” is intended to mean any of the natural inclusive arrangements. That is, “X applies A or B” satisfies any of the foregoing instances if X applies A; X applies B; or both X applies A and B. Additionally, unless otherwise specified or clear from the context to refer to the singular form, the articles “a” and “an” as used in this application and the appended claims are generally understood to mean “one or more.”

[0089] Similarly, although this disclosure has been shown and described with respect to one or more implementations, equivalent variations and modifications will occur to those skilled in the art upon reading and understanding this specification and the accompanying drawings. This disclosure includes all such modifications and variations and is limited only by the scope of the claims. In particular, with respect to the various functions performed by the components described above (e.g., elements, resources, etc.), unless otherwise indicated, the terminology used to describe such components is intended to correspond to any component (functionally equivalent) that performs the specific function of the described component, even if structurally not equivalent to the disclosed structure. Furthermore, although specific features of this disclosure may have been disclosed with respect to only one of several implementations, such features may be combined with one or more other features of other implementations, as may be desired and advantageous to any given or particular application. Moreover, with regard to the terms “comprising,” “owning,” “having,” “having,” or variations thereof as used in the detailed description or claims, such terms are intended to be inclusive in a manner similar to the term “including.”

[0090] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the appended claims.

[0091] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method for calling a functional interface, characterized in that, include: Obtain the target application's target call request for the target function. The target call request is generated based on the target front-end language corresponding to the target application. The target front-end language is any one of multiple front-end languages ​​that are different from the target underlying language corresponding to the target function. The target call request is processed by a general feature framework to obtain the target call parameters of the target application for the target function. The target call parameters are generated based on the target underlying language. The general feature framework is established based on the original call requests of multiple original applications using the various front-end languages ​​for different functions. The target interface is invoked according to the target invocation parameters.

2. The function interface calling method according to claim 1, characterized in that, The general feature framework is obtained through the following steps: Identify multiple candidate functions corresponding to the multiple original applications; For any candidate function, based on the original call requests of the multiple original applications for the candidate function, a conversion file corresponding to the candidate function is obtained, and the conversion file is used to determine the call parameters corresponding to the candidate function. Based on the conversion files corresponding to the multiple candidate functions, the general feature framework is established.

3. The function interface calling method according to claim 2, characterized in that, The step of obtaining the conversion file corresponding to any candidate function based on the original call requests of the plurality of original applications for any candidate function includes: Obtain a target description file, which is obtained based on the original call requests of the plurality of original applications for any of the candidate functions; The target description file is processed to obtain a target glue code file, wherein the glue code in the target glue code file is written based on the target underlying language; Obtain the interface function, which is derived from the target glue code file; Based on the interface function and the target glue code file, the conversion file corresponding to any candidate function is obtained.

4. The function interface calling method according to claim 3, characterized in that, The process of processing the target description file to obtain the target glue code file includes: The target generation tool is determined based on the language type of the target call request; The target description file is processed by the target generation tool to obtain the target glue code file.

5. The function interface calling method according to any one of claims 1 to 4, characterized in that, The process of processing the target invocation request through a general feature framework to obtain the target invocation parameters of the target application for the target interface corresponding to the target function includes: Identify the key fields in the target call request; Based on the key fields, the target conversion file corresponding to the target function is determined from the general feature framework; Based on the target conversion file, the target call request is processed to obtain the target call parameters of the target application for the target interface corresponding to the target function.

6. The function interface calling method according to claim 5, characterized in that, The step of processing the target call request according to the target conversion file to obtain the target call parameters of the target application for the target interface corresponding to the target function includes: Based on the target conversion file, a conversion object is generated, the conversion object including the mapping relationship between the original interface description and the underlying interface pointer for the target function; Based on the instance object and the target call request, obtain the target original interface description for the target function; Based on the transformation object, the target original interface description is processed to obtain the target underlying interface pointer; Based on the local object and the target underlying interface pointer, the target call parameters of the target application for the target interface corresponding to the target function are obtained.

7. The function interface calling method according to claim 6, characterized in that, The acquisition of the target application's target call request for the target function includes: Based on the instance object, obtain the target call request for the target function from the target page of the target application.

8. The function interface calling method according to claim 7, characterized in that, The method further includes: Delete the instance object if the target page is closed; If the target application is closed, delete the conversion object and the local object.

9. A function interface calling device, characterized in that, include: The acquisition module is configured to acquire a target invocation request for a target function from a target application. The target invocation request is generated based on the target front-end language corresponding to the target application. The target front-end language is any one of a variety of front-end languages ​​that are different from the target underlying language corresponding to the target function. The first obtaining module is configured to process the target call request through a general feature framework to obtain the target call parameters of the target application for the target function. The target call parameters are generated based on the target underlying language. The general feature framework is established based on the original call requests of multiple original applications using the various front-end languages ​​for different functions. The calling module is configured to invoke the target interface based on the target invocation parameters.

10. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to execute the steps of the function interface calling method according to any one of claims 1 to 8.

11. A computer-readable storage medium storing computer program instructions thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the steps of the function interface calling method according to any one of claims 1 to 8.

12. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the steps of the functional interface calling method according to any one of claims 1 to 8.