[go: up one dir, main page]

CN110109718B - Application program interface calling method and device - Google Patents

Application program interface calling method and device Download PDF

Info

Publication number
CN110109718B
CN110109718B CN201910230895.0A CN201910230895A CN110109718B CN 110109718 B CN110109718 B CN 110109718B CN 201910230895 A CN201910230895 A CN 201910230895A CN 110109718 B CN110109718 B CN 110109718B
Authority
CN
China
Prior art keywords
application
operating system
program interface
target operating
application program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910230895.0A
Other languages
Chinese (zh)
Other versions
CN110109718A (en
Inventor
周轶霄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Advanced New Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201910230895.0A priority Critical patent/CN110109718B/en
Publication of CN110109718A publication Critical patent/CN110109718A/en
Application granted granted Critical
Publication of CN110109718B publication Critical patent/CN110109718B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The specification provides an application program interface calling method and device, and creatively provides an application program interface calling scheme based on a target operating system under an Electron platform. The method adopts a bidirectional inter-process communication mode between the Electron application and the target operating system application, and uses the target operating system application as a command execution module when the Electron application calls the API of the target operating system, thereby solving the problem of how the Electron application calls the API of the target operating system. The API of the Electron platform does not need to be expanded, the stability of the Electron platform is improved, and the development cost is reduced.

Description

Application program interface calling method and device
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for calling an application program interface.
Background
With the development of computer technology, different kinds of operating systems such as: mac, windows, linux, etc., meets the business requirements of different developers. Development of various applications in the operating system may be accomplished by invoking various application program interfaces in the operating system. However, the development or execution of some applications may not support calls to all application program interfaces in the operating system, such as: the execution of the node-win32-API (Application Programming Interface, application development interface) depends on win32/win64API support, and does not support UWP (Universal Windows Platform in Windows10, i.e., windows general application platform) application. Only API calls under limited Win32/Win64 can be supported, e.g., no system sleep time set, no window set-top, etc. If the relevant Windows API is to be extended, the c++ interface provided by the Windows platform may need to be developed, which is relatively high in development cost and may easily cause the application to crash.
Disclosure of Invention
The embodiment of the specification aims to provide an application program interface calling method and device, which realize flexible calling of an API of a target operating system.
In a first aspect, embodiments of the present disclosure provide an application program interface calling method, including:
the method comprises the steps that an Electron application sends a calling request of a native application program interface to a target operating system application in an inter-process communication mode, wherein the target operating system application supports the calling of the application program interface of a target operating system;
the target operating system application analyzes the calling request of the native application program interface to obtain the calling request of the analysis application program interface;
the target operating system application calls a corresponding application program interface in the target operating system to execute a corresponding command according to the parsing application program interface call request;
and the target operating system application transmits the execution result information of the application program interface to the Electron application in an inter-process communication mode.
In a second aspect, the present specification provides an application program interface invocation system comprising: an Electron application and a target operating system application, wherein the target operating system application supports invocation of an application program interface of a target operating system;
The electronic application is used for sending a calling request of a native application program interface to a target operating system application in an inter-process communication mode;
the target operating system application is to:
analyzing the calling request of the original application program interface to obtain the calling request of the analysis application program interface;
calling a corresponding application program interface to execute a corresponding command according to the parsing application program interface calling request;
and sending the execution result information of the application program interface to the Electron application in an inter-process communication mode.
In a third aspect, the present specification provides an application program interface calling method, including:
sending a native application program interface call request to a target operating system application in an inter-process communication mode, so that the target operating system application performs the following operations: analyzing the calling request of the original application program interface, and calling a corresponding application program interface in a target operating system to execute a corresponding command according to the obtained calling request of the original application program interface, wherein the target operating system application supports the calling of the application program interface of the target operating system;
And receiving the execution result message of the application program interface sent by the target operating system application in a mode of inter-process communication.
In a fourth aspect, the present specification provides an application program interface calling device, including:
the application program interface calling module is used for sending a native application program interface calling request to a target operating system application in an inter-process communication mode so that the target operating system application can execute the following operations: analyzing the calling request of the original application program interface, and calling a corresponding application program interface in a target operating system to execute a corresponding command according to the obtained calling request of the original application program interface, wherein the target operating system application supports the calling of the application program interface of the target operating system;
and the execution result receiving module is used for receiving the execution result message of the application program interface sent by the target operating system application in a mode of inter-process communication.
In a fifth aspect, the present specification provides an application program interface calling method applied to a target operating system application, where the target operating system application supports calling of an application program interface of the target operating system, the method including:
Receiving a calling request of a native application program interface sent by an Electron application in an inter-process communication mode;
analyzing the calling request of the original application program interface to obtain the calling request of the analysis application program interface;
calling a corresponding application program interface to execute a corresponding command according to the parsing application program interface calling request;
and returning an execution result message of the application program interface to the Electron application in an inter-process communication mode.
In a sixth aspect, the present specification provides an application program interface calling apparatus applied to a target operating system application, the target operating system application supporting calling of an application program interface of the target operating system, the apparatus comprising:
the call request receiving module is used for receiving a call request of a native application program interface sent by an Electron application in a mode of interprocess communication;
the request analysis module is used for analyzing the calling request of the native application program interface to obtain the calling request of the analysis application program interface;
the command execution module is used for calling a corresponding application program interface to execute a corresponding command according to the analysis application program interface calling request;
And the execution result return module is used for returning the execution result message of the application program interface to the Electron application in an inter-process communication mode.
In a seventh aspect, the present specification provides an application program interface call processing apparatus, comprising: at least one processor and a memory for storing processor-executable instructions that when executed implement the application program interface invoking method of the above-described third or fifth aspect.
The application program interface calling method, the device, the processing equipment and the system provided by the specification creatively provide an application program interface calling scheme based on a target operating system under an Electron platform. The method adopts a bidirectional inter-process communication mode between the Electron application and the target operating system application, and uses the target operating system application as a command execution module when the Electron application calls the API of the target operating system, thereby realizing the function of calling the API of the target operating system by the Electron application and supporting the calling of each API of the target operating system. The API of the Electron platform is not required to be expanded, the API call of the target operating system can be realized, the stability of the Electron platform is improved, and the development cost is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present description or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some of the embodiments described in the present description, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of information interaction of an application program interface calling method according to one embodiment of the present disclosure;
FIG. 2 is a flow chart of an application program interface calling method executed by an electronic application in an embodiment of the present disclosure;
FIG. 3 is a flow chart of an application program interface calling method according to yet another embodiment of the present disclosure;
FIG. 4 is a diagram of formats of a raw application program interface call request and an application program interface execution result message in one embodiment of the present description;
FIG. 5 is a flow diagram of an application program interface call method performed by a target operating system application in some embodiments of the present description;
FIG. 6 is a schematic block diagram illustrating one embodiment of an application program interface calling apparatus provided herein;
FIG. 7 is a schematic diagram of an application program interface calling device according to another embodiment of the present disclosure;
FIG. 8 is a schematic diagram of an application program interface calling device according to another embodiment of the present disclosure;
fig. 9 is a block diagram of a hardware configuration of an application program interface call server in the embodiment of the present specification.
Detailed Description
In order to make the technical solutions in the present specification better understood by those skilled in the art, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
Electrons were developed by Github, an open source library of desktop applications was built with Html, CSS, javaScript, which can be packaged as an application under Mac, windows, linux system, completing the development of desktop GUI (Graphical User Interface ) applications. The method can utilize the Electron to develop or manage the GUI application program, meet the requirements of starting, displaying, configuring and the like of different operating systems, and realize better visual performance and interaction experience. For example: when carrying out business communication of a risk brain, a large screen is often required to explain and acquire business intent, and how to create a better graphical user interface improves user experience and is a business requirement of a user. Such as: setting the sleep time of the system is very critical in a large screen application scene, because the large screen application cannot interrupt normal display due to accidents such as screen extinction of the system; the window is set on top, and the large screen application must always be at the forefront of all display windows, preventing accidental windows from shielding the large screen application, etc.
An application program interface calling method is provided in the embodiments of the present specification, and an Electron platform, that is, an Electron application and a target operating system application of a target operating system described in the embodiments of the present specification, are used, for example: the Windows application is used for carrying out bidirectional inter-process communication, and the target operating system application is used as a command execution module when the Electron application calls the API of the target operating system, so that the problem of how the Electron application calls the API of the target operating system is solved. The method and the device realize that the electronic application calls all application program interfaces in the target operating system, support the electronic application to call all applications of the target operating system, do not need to expand the API of the electronic platform, improve the stability of the electronic platform and reduce the development cost.
The application program interface calling method in the specification can be applied to a client or a server, and the client can be an electronic device such as a smart phone, a tablet personal computer, an intelligent wearable device (a smart watch, virtual reality glasses, a virtual reality helmet and the like), an intelligent vehicle-mounted device and the like.
Specifically, fig. 1 is a schematic information interaction flow diagram of an application program interface calling method in an embodiment of the present disclosure, as shown in fig. 1, where the application program interface calling method provided in an embodiment of the present disclosure may include:
Step 102, the Electron application sends a call request of a native application program interface to a target operating system application in an inter-process communication mode, wherein the target operating system application supports the call of the application program interface of the target operating system.
The target operating system in the embodiment of the present specification may be a system such as Windows, mac, linux, as shown in fig. 1, and in one example of the present specification, a Windows Application, i.e., windows App (Application), is created for Windows. In a specific implementation process, a target operating system application may be created in advance, where the target operating system application may be understood as an execution medium of an application program interface API of the target operating system, and may support API calls of the target operating system. Such as: a Windows App can be created that can support both Win32/Win64 applications as well as UWP applications. The creation of the target operating system application may be performed according to actual needs by using an appropriate application development framework, and in some embodiments of the present disclosure, the target operating system application may be created by using a c#. Net Core application development framework.
The Electron application, i.e., electron App, can apply to the target operating system as needed: the Windows App sends a native application interface call request. Such as: the Electron application may send a native application program interface call request to the Windows application requesting that a window of a process be set-top. The native application interface call request may include parameters of the request such as: what actions need to be performed, objects requesting execution such as: which process, etc.
The native application program interface call request may be understood as a contract, specification or protocol between the Electron application and the target operating system application that meets certain message specifications.
The Electron application and the target operating system application can be understood as applications of different processes in the target operating system, and the Electron application and the target operating system application can perform information interaction in a bidirectional inter-process communication manner. Inter-process communication may be understood as the propagation or exchange of information between different processes.
And 104, the target operating system application analyzes the calling request of the native application program interface to obtain the calling request of the analysis application program interface.
After receiving the calling request of the original application program interface, the target operating system application can analyze the calling request of the original application program interface according to the agreement or protocol between the target operating system application and the Electron application to obtain the calling request of the analysis application program interface.
And 106, the target operating system application calls a corresponding application program interface in the target operating system to execute a corresponding command according to the parsing application program interface call request.
After the target operating system application analyzes the calling request of the original application program interface, the request content of the Electron application can be obtained, and the corresponding application program interface in the target operating system can be called to execute corresponding commands, such as: and calling a corresponding application program interface to carry out the top setting operation on the window of the appointed process.
And step 108, the target operating system application sends the execution result information of the application program interface to the Electron application in an inter-process communication mode.
After the target operating system application performs the corresponding operation, the execution result information of the application program interface may be: and the information of successful execution or failure execution is sent to the Electron application in an inter-process communication mode to complete the API call of the target operating system. The electronic application can determine whether the current request is successfully executed or not after receiving the execution result information of the application program interface sent by the target operating system application, so as to decide to perform the next operation.
In the embodiment of the specification, an application program interface calling method is provided, and an application program interface calling scheme based on a target operating system under an Electron platform is innovatively provided. The method adopts a bidirectional inter-process communication mode between the Electron application and the target operating system application, and uses the target operating system application as a command execution module when the Electron application calls the API of the target operating system, thereby solving the problem of how the Electron application calls the API of the target operating system. The API of the Electron platform is not required to be expanded, the API call of the target operating system can be realized, the stability of the Electron platform is improved, and the development cost is reduced.
On the basis of the foregoing embodiments, in some embodiments of the present disclosure, an application program interface calling method applied in an Electron application is provided, and fig. 2 is a schematic flow chart of an application program interface calling method executed by the Electron application in the embodiments of the present disclosure, and as shown in fig. 2, a method for the Electron application to make an application program interface call may include:
step 202, sending a native application program interface call request to a target operating system application in an inter-process communication manner, so that the target operating system application performs the following operations: analyzing the calling request of the original application program interface, and calling a corresponding application program interface in a target operating system to execute a corresponding command according to the obtained calling request of the original application program interface, wherein the target operating system application supports the calling of the application program interface of the target operating system.
In a specific implementation, the Electron application may support a portion of the cross-platform capability, i.e., the Electron application may support functions corresponding to an application program interface of a portion of the target operating system. When the Electron application needs to call the application program interface of the target operating system, a native application program interface call request can be sent to the target operating system application of the target operating system. The target operating system application may be understood as the medium of the API call of the target operating system, and may support the API call of the target operating system. The development method of the target operating system application may refer to the description of the above embodiments, and will not be repeated here.
In some embodiments of the present description, the target operating system may include: at least one operating system in Mac, windows, linux can realize the call and management of the APIs of the Mac, windows, linux operating system by developing Mac App, windows App and Linux App as command execution modules for calling Mac, windows, linux APIs with the Electron App. The application program interface calling method provided by the embodiment of the specification can be applied to various operating systems to realize the calling management of APIs of different operating systems.
The native application program interface call request sent by the Electron application may include parameters of the request such as: what actions need to be performed, objects requesting execution such as: which process, etc. The native application program interface call request may be understood as a contract, specification or protocol between the Electron application and the target operating system application that meets certain message specifications.
After receiving the native application program interface call request sent by the electronic application, the target operating system application can analyze the native application program interface call request according to a contract or a protocol between the target operating system application and the electronic application to obtain an analysis application program interface call request, and then the request content of the electronic application can be obtained. The corresponding application program interface in the target operating system can be called to execute corresponding commands, such as: and calling a corresponding application program interface to carry out the top setting operation on the window of the appointed process.
Step 204, receiving the execution result message of the application program interface sent by the target operating system application through the inter-process communication mode.
After the target operating system application performs the corresponding operation, the execution result information of the application program interface may be: and the information of successful execution or failure execution is sent to the Electron application in an inter-process communication mode to complete the API call of the target operating system. The electronic application may determine whether the current request is successfully executed after receiving the execution result information of the application program interface sent by the target operating system application, so as to decide to perform the next operation, for example: if the API call fails, the native application program interface call request can be sent again, and the call to the appointed API is requested again.
In the embodiment of the specification, an application program interface calling method is provided, and an application program interface calling scheme based on a target operating system under an Electron platform is innovatively provided. The method adopts a bidirectional inter-process communication mode between the Electron application and the target operating system application, and uses the target operating system application as a command execution module when the Electron application calls the API of the target operating system, thereby solving the problem of how the Electron application calls the API of the target operating system. The API of the Electron platform does not need to be expanded, the stability of the Electron platform is improved, and the development cost is reduced.
Fig. 3 is a schematic flow chart of an application program interface calling method in another embodiment of the present disclosure, as shown in fig. 3, in some embodiments of the present disclosure, the method may further include:
before sending a native application program interface call request to the target operating system application, judging whether the target operating system application is started;
if the target operating system application is not started, copying the target operating system application into an application data catalog of the target operating system, starting the target operating system application, and sending the calling request of the native application program interface to the target operating system application;
And if the target operating system application is started, sending the calling request of the native application program interface to the target operating system application.
In a specific implementation process, after the Electron application is started, service logic may be executed, that is, the function of the service logic may be executed, for example: display content, download resources, etc., when the Electron application needs to call the API of the target operating system to implement a certain function, a native application program interface call request may be sent to the target operating system application of the target operating system. Before sending the native application program interface call request, in some embodiments of the present disclosure, it may be determined whether the target operating system application is started, and if so, the native application program interface call request may be directly sent to the target operating system application. If the target operating system application is not started, the target operating system application can be copied to an application data directory of the target operating system, the target operating system application is started, and the native application program interface calling request is sent to the target operating system application. The problem that the target operating system application cannot execute the API calling command of the Electron application because the target operating system application is packed in the ASAR file of the Electron application and cannot be started is avoided.
The code of the Electron App will often be packaged into a file with an extension of ASAR, and the application executing the API of the target operating system, i.e. the target operating system application, will also be packaged in this file. In the embodiment of the present specification, the target operating system APP is copied to APP Data, i.e. an application Data directory, in the target operating system, for example: assuming that the user name is admin, the corresponding catalog is C: \Users\admin\AppData\roaming, and after the target operating system APP is copied into the catalog, the target operating system APP is started again, so that the API call of the target operating system is realized.
The determining whether the target operating system application is started or not and the copying and subsequent starting operations of the target operating system application may be performed by the target operating system, or may be performed by the Electron App, or may be specifically set according to actual needs, which are not specifically limited in the embodiments of the present disclosure.
In the embodiment of the specification, before the API call of the target operating system is performed, whether the target operating system application executed by the API call of the target operating system is started or not is judged, if not, the target operating system application is copied into the application data catalog of the target operating system, and the function of calling the API of the target operating system by the electronic App is realized.
As shown in fig. 3, in some embodiments of the present disclosure, based on the above embodiments, the method may further include:
before sending a native application program interface call request to the target operating system application, judging whether the current electronic application supports an application program interface corresponding to the native application program interface call request;
if not, sending the calling request of the native application program interface to the target operating system application, and requesting the target operating system application to call a corresponding application program interface in the target operating system to execute a corresponding command;
and if so, executing a corresponding command by using an application program interface corresponding to the call request supporting the native application program interface in the Electron application.
In a specific implementation, the electronic App may already support a part of cross-platform capability, that is, the electronic App may include a part of the electronic API, so as to be able to fulfill a certain service requirement, for example: and starting an H5 application, displaying, hiding, exiting, acquiring a focus and the like. Before the electronic App sends the native application program interface call request to the target operating system application, it may be determined whether there is an electronic API support corresponding to the native application program interface call request in the electronic App, that is, whether an application program interface corresponding to the native application program interface call request is supported. If so, the corresponding Electron API can be directly utilized to execute the corresponding operation, if not, a native application program interface calling request, namely, the target operating system API executing request in the figure 3 is sent to the target operating system application, and the target operating system application is requested to call the corresponding application program interface in the target operating system to execute the corresponding command.
In the embodiment of the specification, when the electronic App has the supported API, the electronic App can choose to directly execute the corresponding operation, and when the electronic App does not support the API of the target operating system, the API of the target operating system is called through the target operating system application, so that the flexible call of the API of the target operating system is realized, and the API of the target operating system is not required to be expanded, thereby ensuring the stability of the system.
FIG. 4 is a schematic diagram of formats of the raw application program interface call request and the application program interface execution result message in one embodiment of the present disclosure, as shown in FIG. 4, in some embodiments of the present disclosure, a message specification between an Electron App and a target operating system App may be predefined. As shown in FIG. 4, "native Command:" may represent a fixed prefix of a native application program interface call request, indicating the start of a request message; "(Request ID)" may indicate a Request number of a native application program interface call Request, and ID may be increased by 1 each time a Request is transmitted; "(Command Name)" may represent the Command Name of the native application interface call request; the "(Parameter 1)" to "(Parameter N)" of the middle part may represent a request Parameter of a native application program interface call request; the last "\n" may represent a fixed suffix to the native application interface call request, indicating that the request command is complete. Also, as shown in FIG. 4, "NameResult:" may represent a fixed prefix of an application program interface execution result message, indicating the beginning of a reply message; "(Request ID)" may indicate a Request number corresponding to the native application program interface call Request to indicate which Request reply message; "(Command Result)" may represent Result information corresponding to a native application program interface call request; "\n" may represent a fixed suffix to the application program interface execution result message, indicating the end of the reply message.
It should be noted that, the specific form of the fixed prefix and the fixed suffix in the format of the calling request of the native application program interface and the execution result message of the application program interface may be set according to the actual requirement. The fixed prefix and the fixed suffix of the formats of the native application program interface call request and the application program interface execution result message may be set to the same content or may be set to different content, and the embodiment of the present disclosure is not particularly limited.
For example: if the application window with the process ID 11296 needs to be subjected to the set-top operation, assuming that the set-top window command is bringwindowfrontantand focus, the request ID is the request number 1, then the native application program interface call request can be expressed as: native Command 1BringWindowFrontAndFocus 11296/n. Assuming that a return result of 0 indicates failure and 1 indicates success, then the application program interface execution result message may be expressed as (assuming call success): native result 1/n.
According to the embodiment of the specification, the information interaction between the electronic App and the target operating system App is facilitated by setting the message specification between the electronic App and the target operating system App, the accuracy and the efficiency of the information interaction are improved, and an accurate data basis is provided for API call of the target operating system.
Based on the foregoing embodiments, in some embodiments of the present disclosure, the format of the native application program interface call request may further include: JSON (JavaScript Object Notation) data format, XML (extensible markup language) format, compressed binary format.
In the embodiment of the specification, various message formats can be supported, and the applicability of calling the application program interface is improved.
In some embodiments of the present disclosure, an application program interface calling method applied in a target operating system application corresponding to a target operating system is further provided, and fig. 5 is a schematic flow chart of an application program interface calling method executed by the target operating system application in some embodiments of the present disclosure, where, as shown in fig. 5, a method for the target operating system application to make an application program interface call may include:
step 502, a native application program interface call request sent by an Electron application through an inter-process communication mode is received.
In a specific implementation, a target operating system application of the target operating system may be developed in advance, for example: the development of Windows App can be performed as the call of the API of the Windows operating system, and the Windows App can support Win32/Win64 application and also can support UWP application. When the Electron application needs to call the API of the target operating system to implement the specified function, the application may be applied to the target operating system by way of inter-process communication, for example: the development Windows App sends a native application program interface call request. The specific content and format of the native application program interface call request may refer to the descriptions of the foregoing embodiments, and will not be repeated herein.
In some embodiments of the present description, developing a target operating system application, such as Windows App, may take the following form:
and creating the target operating system application by using a C#, net Core application development framework.
Net Core can be understood as a Net technical framework constitutes a specific implementation under the windows. According to the embodiment of the specification, the target operating system application is developed through the C#, net Core application development framework, and the developed target operating system App can be used as the medium for calling the APIs of the target operating system, so that the function of calling each API of the target operating system by the Electron application is realized. And, the C#. Net Core application development framework is convenient and easy to expand any target operating system such as: the API call supported by Windows can greatly improve the development efficiency by utilizing the advanced characteristics of automatic memory recovery management, reflection and the like provided by C#, net Core.
And step 504, analyzing the calling request of the original application program interface to obtain the calling request of the analysis application program interface.
After receiving the call request of the native application program interface sent by the electronic App, the target operating system App can analyze the call request of the native application program interface according to the agreement or protocol between the target operating system App and the electronic App, and analyze the call request of the application program interface.
Step 506, calling a corresponding application program interface to execute a corresponding command according to the parsing application program interface call request.
After the target operating system App analyzes the call request of the native application program interface, the request content of the Electron application can be obtained, and the corresponding application program interface in the target operating system can be called to execute the corresponding command, for example: and calling a corresponding application program interface to carry out the top setting operation on the window of the appointed process.
And step 508, returning an execution result message of the application program interface to the Electron application in an inter-process communication mode.
After the target operating system App performs the corresponding operation, the execution result information of the application program interface may be: and the information of successful execution or failure execution is sent to the Electron application in an inter-process communication mode to complete the API call of the target operating system. The electronic application can determine whether the current request is successfully executed or not after receiving the execution result information of the application program interface sent by the target operating system application, so as to decide to perform the next operation.
In the embodiment of the specification, an application program interface calling method is provided, and an application program interface calling scheme based on a target operating system under an Electron platform is innovatively provided. The method adopts a bidirectional inter-process communication mode between the Electron application and the target operating system application, and uses the target operating system application as a command execution module when the Electron application calls the API of the target operating system, thereby solving the problem of how the Electron application calls the API of the target operating system. The API of the Electron platform does not need to be expanded, the stability of the Electron platform is improved, and the development cost is reduced.
In the present specification, each embodiment of the method is described in a progressive manner, and the same and similar parts of each embodiment participate in each other, and each embodiment mainly describes differences from other embodiments. The relevant points are only needed to participate in the partial explanation of the method embodiment.
Based on the above-mentioned application program interface calling method, one or more embodiments of the present disclosure further provide an application program interface calling device. The apparatus may include a system (including a distributed system), software (applications), modules, components, servers, clients, etc. that employ the methods described in the embodiments of the present specification in combination with the necessary apparatus to implement the hardware. Based on the same innovative concepts, the embodiments of the present description provide means in one or more embodiments as described in the following embodiments. Because the implementation scheme and the method for solving the problem by the device are similar, the implementation of the device in the embodiment of the present disclosure may participate in the implementation of the foregoing method, and the repetition is not repeated. As used below, the term "unit" or "module" may be a combination of software and/or hardware that implements the intended function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Specifically, fig. 6 is a schematic block diagram of an embodiment of an application program interface calling device provided in the present specification, and as shown in fig. 6, the application program interface calling device provided in the present specification may include: an Electron application 61 and a target operating system application 62, wherein the target operating system application 62 supports invocation of an application program interface of a target operating system;
the Electron application 61 is configured to send a native application program interface call request to a target operating system application by means of inter-process communication;
the target operating system application 62 is configured to:
analyzing the calling request of the original application program interface to obtain the calling request of the analysis application program interface;
calling a corresponding application program interface to execute a corresponding command according to the parsing application program interface calling request;
and sending the execution result information of the application program interface to the Electron application in an inter-process communication mode.
In a specific implementation, as shown in fig. 6, the Electron application 61 may include a support function module 611 and a native command module 612, and the target operating system application 62 may include a command execution module 621 and a command parsing module 622. The embodiment of the present specification employs an Electron application and a target operating system application such as: the manner of bi-directional inter-process communication of the Windows application solves how the Electron application invokes the target operating system such as: problems with Windows platform System APIs. The following describes, with reference to fig. 6, a technical solution of the embodiment of the present specification, using Windows as a target operating system:
Electron Function Module in the Electron App, support function 611, represents the cross-platform capability portion that the Electron platform has supported, for example: starting an H5 application, displaying, hiding, exiting, getting focus, etc., native Command Module, i.e., the native command module 612, represents Windows system API functions that are not supported by the electronics platform. The electronic App sends a Native API message request string, i.e., the Native API call request described in the above embodiment (following Native API message specification) to the Windows App end in an inter-process communication manner. The embodiment of the specification can be developed based on a Unreal platform and can be started by an application management container developed based on an Electron platform. The command parsing module 622, command Parse Module in the Windows App, is responsible for parsing the Native API message string, then calls Command Execute Module the command execution module 621 to execute the command according to the parsed message, and finally constructs the Native API message result string, that is, the application program interface execution result information described in the above embodiment, and returns it to Native Command Module in the electronic App in the form of an IPC (Inter-Process Communication ) message.
The application program interface calling device provided in the embodiment of the present disclosure adopts a bidirectional inter-process communication manner between an Electron application and a target operating system application, and uses the target operating system application as a command execution module when the Electron application calls an API of the target operating system, for example: the Windows App is used as an execution medium of the Windows API, and can simultaneously support the win32/win64API and the UWP API, so that the UWP application can be well supported. And the application development framework of C#. Net Core can be used for conveniently and easily expanding any API call supported by Windows, and the development framework has the advanced characteristics of automatic memory recovery management, reflection and the like, and has a C++ development mode with development efficiency greatly higher than that of win 32. For other target operating systems such as: the Mac and Linux can realize the same function by adopting the same method.
Fig. 7 is a schematic structural diagram of an application program interface calling device in another embodiment of the present disclosure, where the application program interface calling device may be applied to an electronic App, as shown in fig. 7, and the device may specifically include:
the application program interface calling module 71 may be configured to send a native application program interface calling request to a target operating system application by means of inter-process communication, so that the target operating system application performs the following operations: analyzing the calling request of the original application program interface, and calling a corresponding application program interface in a target operating system to execute a corresponding command according to the obtained calling request of the original application program interface, wherein the target operating system application supports the calling of the application program interface of the target operating system;
The execution result receiving module 72 may be configured to receive an execution result message of the application program interface sent by the target operating system application through an inter-process communication manner.
The application program interface calling device provided by the embodiment of the specification creatively provides an application program interface calling scheme based on a target operating system under an Electron platform. The method adopts a bidirectional inter-process communication mode between the Electron application and the target operating system application, and uses the target operating system application as a command execution module when the Electron application calls the API of the target operating system, thereby solving the problem of how the Electron application calls the API of the target operating system. The API of the Electron platform does not need to be expanded, the stability of the Electron platform is improved, and the development cost is reduced.
Based on the foregoing embodiments, in some embodiments of the present disclosure, the apparatus further includes a target operating system application starting module configured to:
before sending a native application program interface call request to the target operating system application, judging whether the target operating system application is started;
if the target operating system application is not started, copying the target operating system application into an application data catalog of the target operating system, starting the target operating system application, and sending the calling request of the native application program interface to the target operating system application by the application program interface calling module;
And if the target operating system application is started, the application program interface calling module sends the native application program interface calling request to the target operating system application.
The application program interface calling device provided in the embodiment of the present disclosure, before performing API call of a target operating system, determines whether a target operating system application executed by the API call of the target operating system is started, and if not, copies the target operating system application into an application data directory of the target operating system, so as to implement a function of calling an API of the target operating system by an electronic App.
On the basis of the foregoing embodiments, in some embodiments of the present disclosure, the apparatus further includes an application support determining module configured to:
before sending a native application program interface call request to the target operating system application, judging whether the current electronic application supports an application program interface corresponding to the native application program interface call request;
if not, the application program interface calling module sends the original application program interface calling request to the target operating system application to request the target operating system application to call the corresponding application program interface in the target operating system to execute the corresponding command;
And if so, executing a corresponding command by using an application program interface corresponding to the call request supporting the native application program interface in the Electron application.
According to the application program interface calling device provided by the embodiment of the specification, when the supporting API exists in the electronic App, the corresponding operation can be selected to be directly executed, when the electronic App does not support, the API of the target operating system is called through the target operating system application, flexible calling of the API of the target operating system is achieved, and the API of the target operating system is not required to be expanded, so that the stability of the system is ensured.
Based on the foregoing embodiments, in some embodiments of the present disclosure, the format of the native application program interface call request sent by the application program interface call module includes: fixed prefix, request number, command name, request parameters, and fixed suffix;
the format of the execution result message of the application program interface comprises: the method comprises the steps of fixing a prefix, a request number corresponding to the calling request of the native application program interface, result information corresponding to the calling request of the native application program interface and fixing a suffix.
According to the application program interface calling device provided by the embodiment of the specification, the information interaction between the electronic App and the target operating system App is facilitated by setting the message specification between the electronic App and the target operating system App, so that the accuracy and the efficiency of the information interaction are improved, and an accurate data basis is provided for API calling of the target operating system.
Based on the foregoing embodiments, in some embodiments of the present disclosure, the format of the native application program interface call request sent by the application program interface call module includes: at least one of JSON data format, XML format, compressed binary format.
The application program interface calling device provided by the embodiment of the specification can support various message formats and improves the applicability of application program interface calling.
On the basis of the foregoing embodiments, in some embodiments of the present specification, the target operating system includes: mac, windows, linux.
The application program interface calling device provided by the embodiment of the specification can be applied to various operating systems to realize the calling management of APIs of different operating systems.
FIG. 8 is a schematic structural diagram of an application program interface calling device in another embodiment of the present disclosure, where the application program interface calling device may be applied in a target operating system App, and the target operating system application supports calling of an application program interface of the target operating system, where the device may specifically include:
the call request receiving module 81 may be configured to receive a native application program interface call request sent by an Electron application through an interprocess communication manner;
The request parsing module 82 may be configured to parse the native application program interface call request to obtain a parsed application program interface call request;
the command execution module 83 may be configured to call a corresponding application program interface to execute a corresponding command according to the parsing application program interface call request;
the execution result returning module 84 may be configured to return an execution result message of the application program interface to the Electron application by means of inter-process communication.
The application program interface calling device provided by the embodiment of the specification creatively provides an application program interface calling scheme based on a target operating system under an Electron platform. The method adopts a bidirectional inter-process communication mode between the Electron application and the target operating system application, and uses the target operating system application as a command execution module when the Electron application calls the API of the target operating system, thereby solving the problem of how the Electron application calls the API of the target operating system. The API of the Electron platform does not need to be expanded, the stability of the Electron platform is improved, and the development cost is reduced.
On the basis of the above embodiments, in some embodiments of the present specification, the apparatus further includes an application creation module configured to:
And creating the target operating system application by using a C#, net Core application development framework.
According to the application program interface calling device provided by the embodiment of the specification, the target operating system application is developed through the C#. Net Core application development framework, and the developed target operating system App can be used as an API calling medium of the target operating system, so that the function of calling each API of the target operating system by the Electron application is realized. And, the C#. Net Core application development framework is convenient and easy to expand any target operating system such as: the API call supported by Windows can greatly improve the development efficiency by utilizing the advanced characteristics of automatic memory recovery management, reflection and the like provided by C#, net Core.
It should be noted that the above description of the apparatus according to the method embodiment may also include other implementations. Specific implementation manner may refer to the description of the corresponding method embodiments, which is not described herein in detail.
The embodiment of the specification also provides an application program interface call processing device, which comprises: at least one processor and a memory for storing processor executable instructions, which when executed implement the application program interface calling method executed by the Electron application or the target operating system application side in the above embodiment.
It should be noted that the description of the processing apparatus according to the method embodiment described above may also include other implementations. Specific implementation may refer to descriptions of related method embodiments, which are not described herein in detail.
The application program interface provided by the specification calls a system or a device or processing equipment, and can also be applied to various data analysis processing systems. The system or apparatus or processing device may comprise any of the application program interface invoking means of the above embodiments. The system or device or processing apparatus may be a separate server, or may include a server cluster, a system (including a distributed system), software (applications), an actual operating device, a logic gate device, a quantum computer, etc. using one or more of the methods or one or more of the embodiments of the present description, in combination with necessary terminal devices that implement hardware. The detection system for reconciling discrepancy data may comprise at least one processor and a memory storing computer executable instructions that when executed by the processor perform the steps of the method described in any one or more of the embodiments described above.
The method embodiments provided in the embodiments of the present specification may be performed in a mobile terminal, a computer terminal, a server, or similar computing device. Taking the example of running on a server, fig. 9 is a block diagram of a hardware structure of an application program interface call server in the embodiment of the present disclosure, where the server may be the application program interface call device or the application program interface call system in the above embodiment. As shown in fig. 9, the server 10 may include one or more (only one is shown in the figure) processors 100 (the processors 100 may include, but are not limited to, a microprocessor MCU, a processing device such as a programmable logic device FPGA), a memory 200 for storing data, and a transmission module 300 for communication functions. It will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 9 is merely illustrative and is not intended to limit the configuration of the electronic device described above. For example, server 10 may also include more or fewer components than shown in FIG. 9, for example, may also include other processing hardware such as a database or multi-level cache, a GPU, or have a different configuration than that shown in FIG. 9.
The memory 200 may be used to store software programs and modules of application software, such as program instructions/modules corresponding to the application program interface calling methods in the embodiments of the present disclosure, and the processor 100 executes the software programs and modules stored in the memory 200 to perform various functional applications and data processing. Memory 200 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 200 may further include memory located remotely from processor 100, which may be connected to the computer terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission module 300 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission module 300 includes a network adapter (Network Interface Controller, NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission module 300 may be a Radio Frequency (RF) module for communicating with the internet wirelessly.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The method or apparatus according to the above embodiments provided in the present specification may implement service logic by a computer program and be recorded on a storage medium, where the storage medium may be read and executed by a computer, to implement the effects of the schemes described in the embodiments of the present specification.
The storage medium may include physical means for storing information, typically by digitizing the information before storing it in an electronic, magnetic, or optical medium. The storage medium may include: means for storing information using electrical energy such as various memories, e.g., RAM, ROM, etc.; devices for storing information using magnetic energy such as hard disk, floppy disk, magnetic tape, magnetic core memory, bubble memory, and USB flash disk; devices for optically storing information, such as CDs or DVDs. Of course, there are other ways of readable storage medium, such as quantum memory, graphene memory, etc.
The method and the device for calling the application program interface provided by the embodiments of the present invention may be implemented in a computer by executing corresponding program instructions by a processor, for example, the method and the device may be implemented on a PC side by using the c++ language of a windows operating system, the linux system, or other intelligent terminals by using android and iOS system programming languages, and the processing logic implementation based on a quantum computer.
It should be noted that, the descriptions of the apparatus, the computer storage medium, and the system according to the related method embodiments described in the foregoing description may further include other implementations, and specific implementation manners may refer to descriptions of corresponding method embodiments, which are not described herein in detail.
In the present specification, each embodiment is described in a progressive manner, and the same and similar parts of each embodiment participate in each other, and each embodiment mainly describes differences from other embodiments. In particular, for the hardware+program class embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and the relevant matters only take part in the partial explanation of the method embodiment.
Embodiments of the present description are not limited to situations in which industry communication standards, standard computer data processing and data storage rules are required or described in one or more embodiments of the present description. Some industry standards or embodiments modified slightly based on the implementation described by the custom manner or examples can also realize the same, equivalent or similar or predictable implementation effect after modification of the above examples. Examples of data acquisition, storage, judgment, processing, etc., using these modifications or variations may still fall within the scope of alternative implementations of the examples of this specification.
In the 90 s of the 20 th century, improvements to one technology could clearly be distinguished as improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., field programmable gate array (Field Programmable Gate Array, FPGA)) is an integrated circuit whose logic function is determined by the programming of the device by a user. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented by using "logic compiler" software, which is similar to the software compiler used in program development and writing, and the original code before the compiling is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but not just one of the hdds, but a plurality of kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), lava, lola, myHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable logic controllers, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a car-mounted human-computer interaction device, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Although one or more embodiments of the present description provide method operational steps as described in the embodiments or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive means. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When implemented in an actual device or end product, the instructions may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even in a distributed data processing environment) as illustrated by the embodiments or by the figures. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, it is not excluded that additional identical or equivalent elements may be present in a process, method, article, or apparatus that comprises a described element. The terms first, second, etc. are used to denote a name, but not any particular order.
For convenience of description, the above devices are described as being functionally divided into various modules, respectively. Of course, when one or more of the present description is implemented, the functions of each module may be implemented in the same piece or pieces of software and/or hardware, or a module that implements the same function may be implemented by a plurality of sub-modules or a combination of sub-units, or the like. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, read only compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage, graphene storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
One skilled in the relevant art will recognize that one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, one or more embodiments of the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
One or more embodiments of the present specification may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In the present specification, each embodiment is described in a progressive manner, and the same and similar parts of each embodiment participate in each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple and relevant to the description of some of the method embodiments. In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present specification. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
The foregoing is merely an example of one or more embodiments of the present specification and is not intended to limit the one or more embodiments of the present specification. Various modifications and alterations to one or more embodiments of this description will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, or the like, which is within the spirit and principles of the present specification, should be included in the scope of the claims.

Claims (19)

1. An application program interface calling method, comprising:
the method comprises the steps that an Electron application sends a calling request of a native application program interface to a target operating system application in an inter-process communication mode, wherein the target operating system application supports the calling of the application program interface of a target operating system; the Electron application and the target operating system application are applications of different processes performed in the target operating system;
the target operating system application analyzes the calling request of the native application program interface to obtain the calling request of the analysis application program interface;
the target operating system application calls a corresponding application program interface in the target operating system to execute a corresponding command according to the parsing application program interface call request;
And the target operating system application transmits the execution result information of the application program interface to the Electron application in an inter-process communication mode.
2. An application program interface invocation system, comprising: an Electron application and a target operating system application, wherein the target operating system application supports invocation of an application program interface of a target operating system; the Electron application and the target operating system application are applications of different processes performed in the target operating system;
the electronic application is used for sending a calling request of a native application program interface to a target operating system application in an inter-process communication mode;
the target operating system application is to:
analyzing the calling request of the original application program interface to obtain the calling request of the analysis application program interface;
calling a corresponding application program interface to execute a corresponding command according to the parsing application program interface calling request;
and sending the execution result information of the application program interface to the Electron application in an inter-process communication mode.
3. An application program interface calling method, the execution subject of which is an Electron application, the method comprising:
Sending a native application program interface call request to a target operating system application in an inter-process communication mode, so that the target operating system application performs the following operations: analyzing the calling request of the original application program interface, and calling a corresponding application program interface in a target operating system to execute a corresponding command according to the obtained calling request of the original application program interface, wherein the target operating system application supports the calling of the application program interface of the target operating system; the Electron application and the target operating system application are applications of different processes performed in the target operating system;
and receiving the execution result message of the application program interface sent by the target operating system application in a mode of inter-process communication.
4. A method as claimed in claim 3, the method further comprising:
before sending a native application program interface call request to the target operating system application, judging whether the target operating system application is started;
if the target operating system application is not started, copying the target operating system application into an application data catalog of the target operating system, starting the target operating system application, and sending the calling request of the native application program interface to the target operating system application;
And if the target operating system application is started, sending the calling request of the native application program interface to the target operating system application.
5. A method as claimed in claim 3, the method further comprising:
before sending a native application program interface call request to the target operating system application, judging whether the current electronic application supports an application program interface corresponding to the native application program interface call request;
if not, sending the calling request of the native application program interface to the target operating system application, and requesting the target operating system application to call a corresponding application program interface in the target operating system to execute a corresponding command;
and if so, executing a corresponding command by using an application program interface corresponding to the call request supporting the native application program interface in the Electron application.
6. The method of claim 3, wherein the format of the native application program interface call request comprises: fixed prefix, request number, command name, request parameters, and fixed suffix;
the format of the execution result message of the application program interface comprises: the method comprises the steps of fixing a prefix, a request number corresponding to the calling request of the native application program interface, result information corresponding to the calling request of the native application program interface and fixing a suffix.
7. The method of claim 3, wherein the format of the native application program interface call request comprises: at least one of JSON data format, XML format, compressed binary format.
8. The method of any of claims 3-7, the target operating system comprising: mac, windows, linux.
9. An application program interface calling device corresponding to an Electron application, the device comprising:
the application program interface calling module is used for sending a native application program interface calling request to a target operating system application in an inter-process communication mode so that the target operating system application can execute the following operations: analyzing the calling request of the original application program interface, and calling a corresponding application program interface in a target operating system to execute a corresponding command according to the obtained calling request of the original application program interface, wherein the target operating system application supports the calling of the application program interface of the target operating system; the Electron application and the target operating system application are applications of different processes performed in the target operating system;
and the execution result receiving module is used for receiving the execution result message of the application program interface sent by the target operating system application in a mode of inter-process communication.
10. The apparatus of claim 9, further comprising a target operating system application launch module to:
before sending a native application program interface call request to the target operating system application, judging whether the target operating system application is started;
if the target operating system application is not started, copying the target operating system application into an application data catalog of the target operating system, starting the target operating system application, and sending the calling request of the native application program interface to the target operating system application by the application program interface calling module;
and if the target operating system application is started, the application program interface calling module sends the native application program interface calling request to the target operating system application.
11. The apparatus of claim 9, further comprising an application support determination module to:
before sending a native application program interface call request to the target operating system application, judging whether the current electronic application supports an application program interface corresponding to the native application program interface call request;
If not, the application program interface calling module sends the original application program interface calling request to the target operating system application to request the target operating system application to call the corresponding application program interface in the target operating system to execute the corresponding command;
and if so, executing a corresponding command by using an application program interface corresponding to the call request supporting the native application program interface in the Electron application.
12. The apparatus of claim 9, wherein the format of the native application interface call request sent by the application interface call module comprises: fixed prefix, request number, command name, request parameters, and fixed suffix;
the format of the execution result message of the application program interface comprises: the method comprises the steps of fixing a prefix, a request number corresponding to the calling request of the native application program interface, result information corresponding to the calling request of the native application program interface and fixing a suffix.
13. The apparatus of claim 9, wherein the format of the native application interface call request sent by the application interface call module comprises: at least one of JSON data format, XML format, compressed binary format.
14. The apparatus of any of claims 9-13, the target operating system comprising: mac, windows, linux.
15. An application program interface calling method applied to a target operating system application, the target operating system application supporting calling of an application program interface of the target operating system, the method comprising:
receiving a calling request of a native application program interface sent by an Electron application in an inter-process communication mode; the Electron application and the target operating system application are applications of different processes performed in the target operating system;
analyzing the calling request of the original application program interface to obtain the calling request of the analysis application program interface;
calling a corresponding application program interface to execute a corresponding command according to the parsing application program interface calling request;
and returning an execution result message of the application program interface to the Electron application in an inter-process communication mode.
16. The method of claim 15, the method further comprising:
and creating the target operating system application by using a C#, net Core application development framework.
17. An application program interface calling device applied to a target operating system application that supports calling of an application program interface of the target operating system, the device comprising:
The call request receiving module is used for receiving a call request of a native application program interface sent by an Electron application in a mode of interprocess communication; the Electron application and the target operating system application are applications of different processes performed in the target operating system;
the request analysis module is used for analyzing the calling request of the native application program interface to obtain the calling request of the analysis application program interface;
the command execution module is used for calling a corresponding application program interface to execute a corresponding command according to the analysis application program interface calling request;
and the execution result return module is used for returning the execution result message of the application program interface to the Electron application in an inter-process communication mode.
18. The apparatus of claim 17, the apparatus further comprising an application creation module to:
and creating the target operating system application by using a C#, net Core application development framework.
19. An application program interface call processing device, comprising: at least one processor and a memory for storing processor-executable instructions which, when executed, implement the method of any one of claims 3-7 or the method of any one of claims 15-16.
CN201910230895.0A 2019-03-26 2019-03-26 Application program interface calling method and device Active CN110109718B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910230895.0A CN110109718B (en) 2019-03-26 2019-03-26 Application program interface calling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910230895.0A CN110109718B (en) 2019-03-26 2019-03-26 Application program interface calling method and device

Publications (2)

Publication Number Publication Date
CN110109718A CN110109718A (en) 2019-08-09
CN110109718B true CN110109718B (en) 2023-06-02

Family

ID=67484595

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910230895.0A Active CN110109718B (en) 2019-03-26 2019-03-26 Application program interface calling method and device

Country Status (1)

Country Link
CN (1) CN110109718B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110532045A (en) * 2019-09-04 2019-12-03 深圳市迅雷网络技术有限公司 A kind of striding course call method and relevant apparatus
CN112988410B (en) * 2019-12-17 2024-09-10 深圳市雅阅科技有限公司 Method, device, terminal and storage medium for calling browser extension interface
CN113778942B (en) * 2021-01-28 2025-01-14 北京沃东天骏信息技术有限公司 File management method, device, computer system and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105205412A (en) * 2015-09-25 2015-12-30 北京北信源软件股份有限公司 Inter-process communication intercepting method and device
CN107766094A (en) * 2016-08-18 2018-03-06 阿里巴巴集团控股有限公司 Method, apparatus, the equipment mutually started between control application program
CN108170503A (en) * 2018-01-24 2018-06-15 腾讯科技(深圳)有限公司 A kind of method, terminal and the storage medium of cross-system operation Android application

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1794678B1 (en) * 2004-09-30 2015-06-03 Citrix Systems, Inc. Methods and systems for accessing, by application programs, resources provided by an operating system
CN102123196B (en) * 2010-12-29 2013-07-17 浙大网新科技股份有限公司 Method for realizing WinCE/Android mixed API (Application Programming Interface) on Android cell phone
CN102331928A (en) * 2011-06-24 2012-01-25 浙大网新科技股份有限公司 Method of source code level compatible hybrid API (application programming interface)
US9563488B2 (en) * 2014-05-29 2017-02-07 Apple Inc. Sharing extension points to allow an application to share content via a sharing extension
CN105204881A (en) * 2014-06-25 2015-12-30 中兴通讯股份有限公司 Method and device for operating J2me application program on Android system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105205412A (en) * 2015-09-25 2015-12-30 北京北信源软件股份有限公司 Inter-process communication intercepting method and device
CN107766094A (en) * 2016-08-18 2018-03-06 阿里巴巴集团控股有限公司 Method, apparatus, the equipment mutually started between control application program
CN108170503A (en) * 2018-01-24 2018-06-15 腾讯科技(深圳)有限公司 A kind of method, terminal and the storage medium of cross-system operation Android application

Also Published As

Publication number Publication date
CN110109718A (en) 2019-08-09

Similar Documents

Publication Publication Date Title
CN111639289B (en) Webpage loading method and device
CN112740182B (en) Cloud-based composable data layer
CN110109718B (en) Application program interface calling method and device
CN107092475B (en) Calling method and device of interactive control
CN108595234A (en) Five application page switching method, device and equipment
EP3396517A1 (en) Electronic device and method for switching and aligning applications thereof
CN108549562A (en) A kind of method and device of image load
CN112631679B (en) Preloading method and device for micro-applications
CN106911500B (en) Physical machine configuration method and device and physical machine
CN107479868B (en) Interface loading method, device and equipment
CN108647032B (en) Application loading method and apparatus, computer apparatus and computer-readable storage medium
CN111796821A (en) Page updating method and device
CN109947643B (en) A/B test-based experimental scheme configuration method, device and equipment
CN106990979A (en) A kind of configuration information update method, system, client and server
CN110020370B (en) Method and device for realizing animation in client application and framework of animation script
CN115390852A (en) Method and device for generating uniform abstract syntax tree and program analysis
US10671366B2 (en) App program running method and apparatus
CN112559934B (en) A page pop-up window display method and device
US12222994B2 (en) Quick application startup method and related apparatus
CN110941443B (en) Method and device for modifying file name in SDK (software development kit) and electronic equipment
CN106775916B (en) Method and device for reducing application installation packages and electronic equipment
CN107733866A (en) RPC requests, RPC request processing methods, device and equipment
CN109857503B (en) Page interaction effect self-adaption method and device and electronic equipment
CN109343970B (en) Application program-based operation method and device, electronic equipment and computer medium
EP3872630A2 (en) Request processing method and apparatus, electronic device, and computer storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20200929

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman ky1-9008

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman ky1-9008

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200929

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman ky1-9008

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: Greater Cayman, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant