Interface calling method, device, equipment and medium

By obtaining reflection classes based on interface information in electronic devices, non-system applications call non-SDK interfaces in the operating system, the problem that non-system applications cannot call non-SDK interfaces is solved, ensuring the normal and stable operation of their functions.

CN114579494BActive Publication Date: 2024-12-13BONREE DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210251351.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-15
Publication Date
2024-12-13
Estimated Expiration
2042-03-15

AI Technical Summary

Technical Problem

In the prior art, non-system applications in electronic devices cannot call non-SDK interfaces in operating systems, resulting in the impact of most non-system applications functions.

Method used

By determining its type based on the interface information of the interface to be called, if it is a non-SDK interface, the corresponding reflection class is obtained, and based on the reflection class reflection call interface, the non-system application calls the non-SDK interface.

Benefits of technology

Ensure that non-system applications can run normally and safely, convert their identities into system callers, complete calls to the calling interface, and solve the problem that non-SDK interfaces cannot be called directly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114579494B_ABST
    Figure CN114579494B_ABST
Patent Text Reader

Abstract

The present invention discloses an interface calling method, device, equipment and medium. The method comprises: determining the interface type of the interface to be called according to the interface information of the interface to be called; if the interface type of the interface to be called is a non-SDK interface, obtaining the reflection class corresponding to the interface to be called in the interface information of the interface to be called; the reflection class is used to reflectively call the interface to be called; based on the reflection class, reflectively call the interface to be called. The embodiment of the present invention can reflectively call the interface to be called based on the reflection class provided in the operating system of the electronic device, convert the caller of the interface to be called from a non-system application to a system, realize the identity conversion of the caller of the interface to be called, convert the non-system application call to a system call, complete the call of the interface to be called through the system call, and call the non-SDK interface in the system that cannot be directly called through the reflection call, so as to ensure the safe and stable operation of the non-system application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an interface calling method, device, equipment and medium. Background Art

[0002] The interfaces provided in the operating system of the electronic device generally include two types, one is a general software development kit (SDK) interface, and the other is a non-SDK interface. When the application installed in the electronic device is running, it needs to call certain interfaces in the system.

[0003] In the related art, in order to improve the stability of the operating system of the electronic device, non-system applications installed in the electronic device are usually prohibited from calling non-SDK interfaces in the system, thereby affecting the functions of most non-system applications. Summary of the invention

[0004] The present invention provides an interface calling method, apparatus, device and medium to solve the problem in the related art that non-system applications installed in electronic devices cannot call non-SDK interfaces in the system, affecting the functions of most non-system applications.

[0005] According to one aspect of the present invention, there is provided an interface calling method, comprising:

[0006] Determine the interface type of the interface to be called according to the interface information of the interface to be called;

[0007] If the interface type of the interface to be called is a non-SDK interface, obtaining a reflection class corresponding to the interface to be called from the interface information of the interface to be called; wherein the reflection class is used to reflectively call the interface to be called;

[0008] Based on the reflection class, the interface to be called is reflectively called.

[0009] According to another aspect of the present invention, there is provided an interface calling device, comprising:

[0010] An interface type determination module, used to determine the interface type of the interface to be called according to the interface information of the interface to be called;

[0011] A reflection class acquisition module, used for acquiring a reflection class corresponding to the interface to be called from the interface information of the interface to be called if the interface type of the interface to be called is a non-SDK interface; wherein the reflection class is used to reflectively call the interface to be called;

[0012] The interface calling module is used to reflectively call the interface to be called based on the reflection class.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the interface calling method described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the interface calling method described in any embodiment of the present invention when executed.

[0018] The technical solution of the embodiment of the present invention determines the interface type of the interface to be called according to the interface information of the interface to be called; if the interface type of the interface to be called is a non-SDK interface, obtains the reflection class corresponding to the interface to be called in the interface information of the interface to be called; wherein the reflection class is used to reflectively call the interface to be called; finally, based on the reflection class, the interface to be called is reflectively called, which solves the problem in the related art that the non-system application installed in the electronic device cannot call the non-SDK interface in the system, affecting the functions of most of the non-system applications, and obtains the reflection class provided in the operating system of the electronic device, reflectively calls the interface to be called, converts the caller of the interface to be called from the non-system application to the system, realizes the identity conversion of the caller of the interface to be called, converts the non-system application call to the system call, completes the call of the interface to be called through the system call, and can call the non-SDK interface in the system that cannot be directly called through the reflection call, ensures the normal function of the non-system application, and ensures the beneficial effect of the safe and stable operation of the non-system application.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 The present invention provides a flowchart of an interface calling method according to the first embodiment of the present invention.

[0022] Figure 2 The present invention provides a flowchart of an interface calling method according to the second embodiment of the present invention.

[0023] Figure 3 A schematic diagram of the structure of an interface calling device provided in Embodiment 3 of the present invention.

[0024] Figure 4 A schematic diagram of the structure of an electronic device for implementing the interface calling method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0026] It should be noted that the terms "target", "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprise", "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] Embodiment 1

[0028] Figure 1 This is a flowchart of an interface calling method provided in the first embodiment of the present invention. This embodiment is applicable to the case where a non-system application installed in an electronic device calls an interface provided in the operating system of the electronic device to implement the corresponding function of the non-system application. The method can be executed by an interface calling device, which can be implemented in the form of hardware and / or software, and the interface calling device can be configured in the non-system application. The non-system application is installed in the electronic device. Figure 1 As shown, the method includes:

[0029] Step 101: Determine the interface type of the interface to be called according to the interface information of the interface to be called.

[0030] Optionally, the interface to be called is an interface provided in the operating system of the electronic device that the non-system application needs to call at the current moment. When the non-system application installed in the electronic device is running, it needs to call certain interfaces provided in the operating system of the electronic device to implement the corresponding functions of the non-system application.

[0031] The interfaces provided in the operating system of an electronic device usually include two types, one is a general SDK interface and the other is a non-SDK interface. The general SDK interface is an SDK interface that can be called by both system applications and non-system applications installed in the electronic device. System applications are applications that come with the operating system of the electronic device. Non-system applications are applications installed in the electronic device that do not come with the operating system of the electronic device. A non-SDK interface is an SDK interface that can be called by system applications installed in the electronic device, but cannot be called by non-system applications installed in the electronic device. The interface type of the interface to be called is a general SDK interface or a non-SDK interface.

[0032] Optionally, the interface information according to the interface to be called is various types of information related to the interface to be called that are pre-stored in the electronic device.

[0033] Optionally, determining the interface type of the interface to be called based on the interface information of the interface to be called includes: obtaining the interface identifier of the interface to be called from the interface information of the interface to be called; querying the first target interface identifier that is the same as the interface identifier of the interface to be called in a preset non-SDK interface list; if the first target interface identifier is queried, determining that the interface type of the interface to be called is a non-SDK interface.

[0034] Optionally, the interface information of the interface to be called contains the interface identifier of the interface to be called. The interface identifier is information used to identify the interface. Different interfaces can be distinguished according to the identification information of each interface. The preset non-SDK interface list stores the interface identifiers of each non-SDK interface provided by the operating system of the electronic device. The non-system application obtains the interface identifier of the interface to be called from the interface information of the interface to be called, and then queries the first target interface identifier that is the same as the interface identifier of the interface to be called in the preset non-SDK interface list. If the first target interface identifier is queried, it is determined that the interface type of the interface to be called is a non-SDK interface. The non-system application queries the first target interface identifier that is the same as the interface identifier of the interface to be called in the preset non-SDK interface list, indicating that the interface to be called is a non-SDK interface provided by the operating system of the electronic device, thereby determining that the interface type of the interface to be called is a non-SDK interface.

[0035] Optionally, after obtaining the interface identifier of the interface to be called from the interface information of the interface to be called, it also includes: querying the second target interface identifier that is the same as the interface identifier of the interface to be called in the preset general SDK interface list; if the second target interface identifier is queried, it is determined that the interface type of the interface to be called is a general SDK interface.

[0036] Optionally, the preset universal SDK interface list stores the interface identifiers of the universal SDK interfaces provided by the operating system of the electronic device. The non-system application obtains the interface identifier of the interface to be called from the interface information of the interface to be called, and then queries the preset universal SDK interface list for the second target interface identifier that is identical to the interface identifier of the interface to be called. If the second target interface identifier is found, it is determined that the interface type of the interface to be called is a universal SDK interface. The non-system application queries the preset universal SDK interface list for the second target interface identifier that is identical to the interface identifier of the interface to be called, indicating that the interface to be called is a universal SDK interface provided by the operating system of the electronic device, thereby determining that the interface type of the interface to be called is a universal SDK interface.

[0037] Optionally, after determining the interface type of the interface to be called according to the interface information of the interface to be called, the method further includes: if the interface type of the interface to be called is a general SDK interface, calling the interface to be called. If the interface type of the interface to be called is a general SDK interface, a non-system application can directly call the interface to be called.

[0038] Step 102: If the interface type of the interface to be called is a non-SDK interface, a reflection class corresponding to the interface to be called is obtained from the interface information of the interface to be called.

[0039] The reflection class is used to reflectively call the interface to be called.

[0040] Optionally, before determining the interface type of the interface to be called based on the interface information of the interface to be called, it also includes: storing the interface information of each interface associated with the non-system application to a preset location; wherein, for an interface whose interface type is a non-SDK interface, the interface information of the interface includes a reflection class used to reflectively call the interface.

[0041] Optionally, the interfaces associated with the non-system application are the interfaces that the non-system application needs to call during operation among all the interfaces provided by the operating system of the electronic device. When the non-system application is installed on the electronic device, the interface information of the interfaces associated with the non-system application is stored in a preset location. The preset location may be a configuration file for the non-system application in the electronic device. For an interface whose interface type is a non-SDK interface, the interface information of the interface includes but is not limited to an interface identifier of the interface, and a reflection class for reflectively calling the interface. For an interface whose interface type is a general SDK interface, the interface information of the interface includes at least an interface identifier of the interface.

[0042] Optionally, the reflection class used for reflective calling of interfaces is a class provided in the operating system of the electronic device that can be used for reflective calling of interfaces. For each non-SDK interface that needs to be called by a non-system application during operation, the interface identifier of each non-SDK interface and the reflection class provided in the operating system of the electronic device that can be used for reflective calling of each non-SDK interface are encapsulated as interface information of each non-SDK interface. For each general SDK interface that needs to be called by a non-system application during operation, the interface identifier of each general SDK interface is encapsulated as interface information of each non-SDK interface. When a non-system application is installed on an electronic device, the interface information of each interface associated with the non-system application is stored in a configuration file of the non-system application in the electronic device.

[0043] Optionally, if the interface type of the interface to be called is a non-SDK interface, the non-system application obtains the reflection class corresponding to the interface to be called from the interface information of the interface to be called. The non-system application queries and obtains the interface information of the interface to be called in the configuration file of the non-system application in the electronic device, and then obtains the reflection class corresponding to the interface to be called from the interface information of the interface to be called.

[0044] Step 103: Based on the reflection class, reflectively call the interface to be called.

[0045] Optionally, based on the reflection class, the interface to be called is reflectively called, including: obtaining a reflection method in the reflection class corresponding to the interface to be called; and reflectively calling the interface to be called through the reflection method. The reflection class corresponding to the interface to be called is a class provided in the operating system of the electronic device that can be used to reflectively call the interface to be called. The non-system application reflects and calls the interface to be called based on the reflection class provided in the operating system of the electronic device, converts the caller of the interface to be called from the non-system application to the system, realizes the identity conversion of the caller of the interface to be called, converts the non-system application call to the system call, and completes the call of the interface to be called through the system call.

[0046] Therefore, by means of reflection calling, non-SDK interfaces in the system that cannot be directly called are called, thereby ensuring the normal functions of non-system applications and ensuring the safe and stable operation of non-system applications.

[0047] Optionally, after determining the interface type of the interface to be called based on the interface information of the interface to be called, it also includes: determining the interface restriction flag information corresponding to the non-system application in the system from the information associated with the non-system application in the system; wherein the interface restriction flag information is used to control whether the system enables a mechanism for restricting the non-system application from calling each non-SDK interface in the system.

[0048] Optionally, the system is an operating system of the electronic device. The system sets an interface restriction flag information for each application. The interface restriction flag information is flag information for controlling whether the system starts a mechanism to restrict applications from calling various non-SDK interfaces in the system.

[0049] Optionally, the interface restriction flag information of each system application is the same flag information. The interface restriction flag information of each non-system application is set to the same flag information. The interface restriction flag information of the system application is different from the interface restriction flag information of the non-system application. Through the interface restriction flag information of each system application, the control system turns off the mechanism that restricts each system application from calling each non-SDK interface in the system, so that each system application can call each non-SDK interface provided by the operating system of the electronic device. Through the interface restriction flag information of each non-system application, the control system turns on the mechanism that restricts each non-system application from calling each non-SDK interface in the system, so that each non-system application cannot call each non-SDK interface provided by the operating system of the electronic device.

[0050] Optionally, the information associated with non-system applications in the system is various types of information related to non-system applications set in the system. The information associated with non-system applications in the system includes interface restriction flag information corresponding to the non-system applications in the system. The non-system application determines the interface restriction flag information corresponding to the non-system application in the system from the information associated with non-system applications in the system.

[0051] Optionally, after determining the interface restriction flag information corresponding to the non-system application in the system, it also includes: calling a modification function to modify the interface restriction flag information to target flag information, so that the system turns off the mechanism that restricts the non-system application from calling the non-SDK interfaces in the system; and calling the interface to be called.

[0052] Optionally, the modification function is a function for modifying the interface restriction flag information of the application. The target flag information is the interface restriction flag information of each system application. The modification function is called to modify the interface restriction flag information to the target flag information, that is, to modify the interface restriction flag information of the non-system application to the interface restriction flag information of the system application, so that the system turns off the mechanism that restricts the non-system application from calling the non-SDK interfaces in the system, so that the non-system application can call the non-SDK interfaces in the system like the system application.

[0053] Therefore, by modifying the interface restriction flag information of non-system applications to target flag information, the system turns off the mechanism that restricts non-system applications from calling various non-SDK interfaces in the system, so that non-system applications can call non-SDK interfaces in the system like system applications, ensuring the normal functions of non-system applications and ensuring the safe and stable operation of non-system applications.

[0054] The technical solution of the embodiment of the present invention determines the interface type of the interface to be called according to the interface information of the interface to be called; if the interface type of the interface to be called is a non-SDK interface, obtains the reflection class corresponding to the interface to be called in the interface information of the interface to be called; wherein the reflection class is used to reflectively call the interface to be called; finally, based on the reflection class, the interface to be called is reflectively called, which solves the problem in the related art that the non-system application installed in the electronic device cannot call the non-SDK interface in the system, affecting the functions of most of the non-system applications, and obtains the reflection class provided in the operating system of the electronic device, reflectively calls the interface to be called, converts the caller of the interface to be called from the non-system application to the system, realizes the identity conversion of the caller of the interface to be called, converts the non-system application call to the system call, completes the call of the interface to be called through the system call, and can call the non-SDK interface in the system that cannot be directly called through the reflection call, ensures the normal function of the non-system application, and ensures the beneficial effect of the safe and stable operation of the non-system application.

[0055] Embodiment 2

[0056] Figure 2 This is a flowchart of an interface calling method provided in the second embodiment of the present invention. The embodiment of the present invention can be combined with each optional solution in one or more of the above embodiments. Figure 2 As shown, the method includes:

[0057] Step 201: Determine the interface type of the interface to be called according to the interface information of the interface to be called.

[0058] Step 202: Determine interface restriction flag information corresponding to the non-system application in the system from information associated with the non-system application in the system.

[0059] The interface restriction flag information is used to control whether the system starts a mechanism for restricting the non-system application from calling the non-SDK interfaces in the system.

[0060] Optionally, the system is an operating system of the electronic device. The system sets an interface restriction flag information for each application. The interface restriction flag information is flag information for controlling whether the system starts a mechanism to restrict applications from calling various non-SDK interfaces in the system.

[0061] Optionally, the interface restriction flag information of each system application is the same flag information. The interface restriction flag information of each non-system application is set to the same flag information. The interface restriction flag information of the system application is different from the interface restriction flag information of the non-system application. Through the interface restriction flag information of each system application, the control system turns off the mechanism that restricts each system application from calling each non-SDK interface in the system, so that each system application can call each non-SDK interface provided by the operating system of the electronic device. Through the interface restriction flag information of each non-system application, the control system turns on the mechanism that restricts each non-system application from calling each non-SDK interface in the system, so that each non-system application cannot call each non-SDK interface provided by the operating system of the electronic device.

[0062] Optionally, the information associated with non-system applications in the system is various types of information related to non-system applications set in the system. The information associated with non-system applications in the system includes interface restriction flag information corresponding to the non-system applications in the system. The non-system application determines the interface restriction flag information corresponding to the non-system application in the system from the information associated with non-system applications in the system.

[0063] Step 203: Call a modification function to modify the interface restriction flag information into target flag information, so that the system turns off a mechanism for restricting the non-system application from calling each non-SDK interface in the system.

[0064] Optionally, the modification function is a function for modifying the interface restriction flag information of the application. The target flag information is the interface restriction flag information of each system application. The modification function is called to modify the interface restriction flag information to the target flag information, that is, to modify the interface restriction flag information of the non-system application to the interface restriction flag information of the system application, so that the system turns off the mechanism that restricts the non-system application from calling the non-SDK interfaces in the system, so that the non-system application can call the non-SDK interfaces in the system like the system application.

[0065] Step 204: Call the interface to be called.

[0066] The technical solution of the embodiment of the present invention is to modify the interface restriction flag information of the non-system application into the target flag information, so that the system closes the mechanism of restricting the non-system application from calling the non-SDK interfaces in the system, so that the non-system application can call the non-SDK interface in the system like the system application, thereby ensuring the normal function of the non-system application and guaranteeing the beneficial effect of the safe and stable operation of the non-system application.

[0067] Embodiment 3

[0068] Figure 3 This is a schematic diagram of the structure of an interface calling device provided in Embodiment 3 of the present invention. The device can be configured in an electronic device. Figure 3 As shown, the device includes: an interface type determination module 301, a reflection class acquisition module 302 and an interface calling module 303.

[0069] Among them, the interface type determination module 301 is used to determine the interface type of the interface to be called according to the interface information of the interface to be called; the reflection class acquisition module 302 is used to obtain the reflection class corresponding to the interface to be called from the interface information of the interface to be called if the interface type of the interface to be called is a non-SDK interface; wherein the reflection class is used to reflectively call the interface to be called; the interface calling module 303 is used to reflectively call the interface to be called based on the reflection class.

[0070] The technical solution of the embodiment of the present invention determines the interface type of the interface to be called according to the interface information of the interface to be called; if the interface type of the interface to be called is a non-SDK interface, obtains the reflection class corresponding to the interface to be called in the interface information of the interface to be called; wherein the reflection class is used to reflectively call the interface to be called; finally, based on the reflection class, the interface to be called is reflectively called, which solves the problem in the related art that the non-system application installed in the electronic device cannot call the non-SDK interface in the system, affecting the functions of most of the non-system applications, and obtains the reflection class provided in the operating system of the electronic device, reflectively calls the interface to be called, converts the caller of the interface to be called from the non-system application to the system, realizes the identity conversion of the caller of the interface to be called, converts the non-system application call to the system call, completes the call of the interface to be called through the system call, and can call the non-SDK interface in the system that cannot be directly called through the reflection call, ensures the normal function of the non-system application, and ensures the beneficial effect of the safe and stable operation of the non-system application.

[0071] In an optional implementation of an embodiment of the present invention, optionally, the interface calling device also includes: a flag information determination module, used to determine the interface restriction flag information corresponding to the non-system application in the system from the information associated with the non-system application in the system; wherein the interface restriction flag information is used to control whether the system enables a mechanism for restricting the non-system application from calling each non-SDK interface in the system.

[0072] In an optional implementation of an embodiment of the present invention, optionally, the interface calling device also includes: a flag information modification module, which is used to call a modification function to modify the interface restriction flag information to target flag information, so that the system turns off a mechanism that restricts the non-system application from calling various non-SDK interfaces in the system; an interface direct calling module, which is used to call the interface to be called.

[0073] In an optional implementation of an embodiment of the present invention, optionally, the interface type determination module 301 is specifically used to: obtain the interface identifier of the interface to be called from the interface information of the interface to be called; query the first target interface identifier that is the same as the interface identifier of the interface to be called in the preset non-SDK interface list; if the first target interface identifier is queried, determine that the interface type of the interface to be called is a non-SDK interface.

[0074] In an optional implementation of an embodiment of the present invention, optionally, the interface type determination module 301 is also used to: query a second target interface identifier that is the same as the interface identifier of the interface to be called in a preset general SDK interface list; if the second target interface identifier is queried, it is determined that the interface type of the interface to be called is a general SDK interface.

[0075] In an optional implementation manner of the embodiment of the present invention, optionally, the interface calling device further includes: a general SDK interface calling module, configured to call the interface to be called if the interface type of the interface to be called is a general SDK interface.

[0076] In an optional implementation of an embodiment of the present invention, optionally, the interface calling device also includes: an interface information storage module, used to store interface information of each interface associated with a non-system application to a preset location; wherein, for an interface whose interface type is a non-SDK interface, the interface information of the interface includes a reflection class for reflectively calling the interface.

[0077] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0078] The above-mentioned data acquisition device can execute the interface calling method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the interface calling method.

[0079] Embodiment 4

[0080] Figure 4The structural schematic diagram of the electronic device 10 that can be used to implement the interface calling method of the embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0081] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program built from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0082] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0083] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as an interface calling method.

[0084] In some embodiments, the interface calling method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is built into the RAM 13 and executed by the processor 11, one or more steps of the interface calling method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the interface calling method in any other appropriate manner (e.g., by means of firmware).

[0085] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0086] The computer program for implementing the interface calling method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or the block diagram are implemented. The computer program can be executed completely on the machine, partially on the machine, as an independent software package, partially on the machine and partially on a remote machine, or completely on a remote machine or server.

[0087] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0088] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0089] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0090] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0091] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0092] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. An interface calling method, characterized in that: For non-system applications, including: Determine the interface type of the interface to be called according to the interface information of the interface to be called; If the interface type of the interface to be called is a non-SDK interface, obtaining a reflection class corresponding to the interface to be called from the interface information of the interface to be called; wherein the reflection class is used to reflectively call the interface to be called; Based on the reflection class, reflectively call the interface to be called; Wherein, after determining the interface type of the interface to be called according to the interface information of the interface to be called, the method further includes: Determining, from the information associated with the non-system application in the system, interface restriction flag information corresponding to the non-system application in the system; The interface restriction flag information is used to control whether the system starts a mechanism to restrict the non-system application from calling each non-SDK interface in the system; After determining the interface restriction mark information corresponding to the non-system application in the system, the method further includes: Calling a modification function to modify the interface restriction flag information into target flag information, so that the system turns off a mechanism that restricts the non-system application from calling each non-SDK interface in the system; Call the interface to be called.

2. The method according to claim 1, characterized in that The step of determining the interface type of the interface to be called according to the interface information of the interface to be called includes: Acquire the interface identifier of the interface to be called from the interface information of the interface to be called; In the preset non-SDK interface list, search for a first target interface identifier that is the same as the interface identifier of the interface to be called; If the first target interface identifier is found, it is determined that the interface type of the interface to be called is a non-SDK interface.

3. The method according to claim 2, characterized in that After acquiring the interface identifier of the interface to be called from the interface information of the interface to be called, the method further includes: In the preset universal SDK interface list, searching for a second target interface identifier that is the same as the interface identifier of the interface to be called; If the second target interface identifier is found, it is determined that the interface type of the interface to be called is a general SDK interface.

4. The method according to claim 3, characterized in that After determining the interface type of the interface to be called according to the interface information of the interface to be called, the method further includes: If the interface type of the interface to be called is a general SDK interface, the interface to be called is called.

5. The method according to claim 1, characterized in that Before determining the interface type of the interface to be called according to the interface information of the interface to be called, the method further includes: storing interface information of each interface associated with the non-system application program to a preset location; Among them, for an interface whose interface type is a non-SDK interface, the interface information of the interface includes a reflection class used for reflective calling of the interface.

6. An interface calling device, characterized in that: Configured for non-system applications, including: An interface type determination module, used to determine the interface type of the interface to be called according to the interface information of the interface to be called; A reflection class acquisition module, used for acquiring a reflection class corresponding to the interface to be called from the interface information of the interface to be called if the interface type of the interface to be called is a non-SDK interface; wherein the reflection class is used to reflectively call the interface to be called; An interface calling module, used for reflectively calling the interface to be called based on the reflection class; A flag information determination module, used to determine, from information associated with non-system applications in the system, interface restriction flag information corresponding to the non-system applications in the system; The interface restriction flag information is used to control whether the system starts a mechanism to restrict the non-system application from calling each non-SDK interface in the system; A flag information modification module, used for calling a modification function to modify the interface restriction flag information into target flag information, so that the system turns off a mechanism for restricting the non-system application from calling each non-SDK interface in the system; The interface direct calling module is used to call the interface to be called.

7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the interface calling method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the interface calling method according to any one of claims 1 to 5 when executed.