CN110109718A - A kind of application programming interfaces call method and device - Google Patents

A kind of application programming interfaces call method and device Download PDF

Info

Publication number
CN110109718A
CN110109718A CN201910230895.0A CN201910230895A CN110109718A CN 110109718 A CN110109718 A CN 110109718A CN 201910230895 A CN201910230895 A CN 201910230895A CN 110109718 A CN110109718 A CN 110109718A
Authority
CN
China
Prior art keywords
application
destination
programming interfaces
application programming
native applications
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.)
Granted
Application number
CN201910230895.0A
Other languages
Chinese (zh)
Other versions
CN110109718B (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
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding 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

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

Abstract

This specification provides a kind of application programming interfaces call method and device, innovatively proposes a kind of application programming interfaces invocation scheme of the destination OS under the platform based on Electron.It applies with destination OS using Electron using by the way of two-way interprocess communication, command execution module when by destination OS using API as Electron application invocation target operating system, solve the problems, such as Electron apply how invocation target operating system system API.It does not need to be extended the API of Electron platform, improves the stability of Electron platform, and reduce development cost.

Description

A kind of application programming interfaces call method and device
Technical field
This specification belongs to field of computer technology more particularly to a kind of application programming interfaces call method and device.
Background technique
With the development of computer technology, different types of operating system such as: the appearance of Mac, Windows, Linux, Meet the business demand of different developers.It can be realized by each application programming interfaces in call operation system Operating system carries out the exploitation of various applications.But the exploitation of some applications or execution possibly can not be supported in operating system All application programming interfaces be called, such as: node-win32-API (Application Programming Interface, application development interface) execution dependent on win32/win64API support, do not support UWP (Windows10 In Universal Windows Platform referred to as, i.e. Windows common application platform) application.It is merely able to support limited Win32/Win64 under API Calls, such as do not support setting system dormancy time, not support window top set etc..If will be into The extension of row correlation Windows API, it may be necessary to which the C++ interface for carrying out windows platform offer is developed, development cost It is relatively high, it is also possible to easily cause application crashes.
Summary of the invention
This specification embodiment is designed to provide a kind of application programming interfaces call method and device, realizes target The flexible calling of the API of operating system.
First aspect this specification embodiment provides a kind of application programming interfaces call method, comprising:
Electron is applied by way of interprocess communication, is sent native applications program to destination OS application and is connect Mouth call request, wherein the calling of the application programming interfaces of destination OS is supported in the destination OS application;
The destination OS, which is applied, parses native applications program interface call request, obtains parsing and answers It is requested with program interface call;
The destination OS is applied according to the parsing application programming interfaces call request, invocation target operating system In corresponding application programming interfaces execute corresponding order;
The destination OS is applied by application programming interfaces execution result information by way of interprocess communication, hair Give the Electron application.
Second aspect, present description provides a kind of application programming interfaces calling systems, comprising: Electron application and mesh Mark operating system application, wherein the calling of the application programming interfaces of destination OS is supported in the destination OS application;
The Electron is applied for sending primary answer to destination OS application by way of interprocess communication It is requested with program interface call;
The destination OS, which is applied, to be used for:
Native applications program interface call request is parsed, parsing application programming interfaces call request is obtained;
According to the parsing application programming interfaces call request, corresponding application programming interfaces is called to execute corresponding life It enables;
By application programming interfaces execution result information by way of interprocess communication, it is sent to the Electron and answers With.
The third aspect, present description provides a kind of application programming interfaces call methods, comprising:
By way of interprocess communication, the request of native applications program interface call is sent to destination OS application, So that being operated below the destination OS application execution: parsing the native applications program interface call request, and root According to the parsing application programming interfaces call request of acquisition, corresponding application programming interfaces execute corresponding in invocation target operating system Order, wherein the calling of the application programming interfaces of the destination OS is supported in destination OS application;
It receives the destination OS to apply by way of interprocess communication, the application programming interfaces of transmission execute knot Fruit message.
Fourth aspect, present description provides a kind of application programming interfaces calling devices, comprising:
Application programming interfaces calling module, for being sent to destination OS application by way of interprocess communication The request of native applications program interface call, so that operating below the destination OS application execution: parsing is described primary Application programming interfaces call request, and according to the parsing application programming interfaces call request of acquisition, in invocation target operating system Corresponding application programming interfaces execute corresponding order, wherein the object run system is supported in the destination OS application The calling of the application programming interfaces of system;
Implementing result receiving module is applied by way of interprocess communication, hair for receiving the destination OS The application programming interfaces executing result message sent.
5th aspect, present description provides a kind of application programming interfaces call methods, answer applied to destination OS With the calling of the application programming interfaces of the destination OS is supported in the destination OS application, which comprises
It receives Electron and applies the native applications program interface call request sent by way of interprocess communication;
Native applications program interface call request is parsed, parsing application programming interfaces call request is obtained;
According to the parsing application programming interfaces call request, corresponding application programming interfaces is called to execute corresponding life It enables;
Application programming interfaces executing result message is returned into the Electron application by way of interprocess communication.
6th aspect, present description provides a kind of application programming interfaces calling devices, answer applied to destination OS With the destination OS application supports that the calling of the application programming interfaces of the destination OS, described device include:
Call request receiving module applies what is sent by way of interprocess communication primary to answer for receiving Electron It is requested with program interface call;
Request analysis module obtains parsing application for parsing to native applications program interface call request Program interface call request;
Command execution module, for calling corresponding application program according to the parsing application programming interfaces call request Interface executes corresponding order;
Implementing result return module, for returning application programming interfaces executing result message by way of interprocess communication It is applied back to the Electron.
7th aspect, present description provides a kind of application programming interfaces to call processing equipment, comprising: at least one processing Device and memory for storage processor executable instruction, the processor realize above-mentioned third party when executing described instruction The application programming interfaces call method of face or the 5th aspect.
Application programming interfaces call method, the device, processing equipment, system of this specification offer, innovatively propose A kind of application programming interfaces invocation scheme of destination OS under the platform based on Electron.It is applied using Electron Destination OS is applied and is called as Electron application by the mode that two-way interprocess communication is applied with destination OS The command execution module when API of destination OS realizes Electron application invocation target operating system system API's Function can support the calling of each API of destination OS.It does not need to be extended the API of Electron platform The API Calls for realizing destination OS, improve the stability of Electron platform, and reduce development cost.
Detailed description of the invention
In order to illustrate more clearly of this specification embodiment or technical solution in the prior art, below will to embodiment or Attached drawing needed to be used in the description of the prior art is briefly described, it should be apparent that, the accompanying drawings in the following description is only The some embodiments recorded in this specification, for those of ordinary skill in the art, in not making the creative labor property Under the premise of, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is the information exchange flow diagram of application programming interfaces call method in this specification one embodiment;
Fig. 2 is the process signal of the application programming interfaces call method of Electron application execution in this specification embodiment Figure;
Fig. 3 is the flow diagram of application programming interfaces call method in another embodiment of this specification;
Fig. 4 is that primary application programming interfaces call request and application programming interfaces execute knot in this specification one embodiment The form schematic diagram of fruit message;
Fig. 5 is the application programming interfaces call method of destination OS application execution in some embodiments of this specification Flow diagram;
Fig. 6 is the modular structure schematic diagram of application programming interfaces calling device one embodiment that this specification provides;
Fig. 7 is the structural schematic diagram of application programming interfaces calling device in another embodiment of this specification;
Fig. 8 is the structural schematic diagram of application programming interfaces calling device in another embodiment of this specification;
Fig. 9 is a kind of hardware block diagram of application programming interfaces invoking server in this specification embodiment.
Specific embodiment
In order to make those skilled in the art more fully understand the technical solution in this specification, below in conjunction with this explanation Attached drawing in book embodiment is clearly and completely described the technical solution in this specification embodiment, it is clear that described Embodiment be only this specification a part of the embodiment, instead of all the embodiments.The embodiment of base in this manual, Every other embodiment obtained by those of ordinary skill in the art without making creative efforts, all should belong to The range of this specification protection.
Electron is developed by Github, and one constructs multipad with Html, CSS, JavaScript Open source library, the application that can be packaged as under Mac, Windows, linux system, complete desktop GUI (Graphical User Interface, graphic user interface) application program exploitation.Can use Electron carry out GUI application program exploitation or Management, meets the demands such as the starting, displaying and system configuration of different operating system, realizes better visual performance and interaction Experience.Such as: when carrying out the Bussiness Communications of risk brain, it is often necessary to commercial intention is explained and obtained to one piece of large-size screen monitors, A relatively good graphic user interface how is created, user experience is promoted, is the business demand of user.Such as: setting system is stopped Sleep the time, it is very crucial in large-size screen monitors application scenarios because large-size screen monitors application cannot allow system go out screen etc. fortuitous events interrupt normally Display;Window top set, large-size screen monitors application must be in the foremost of all display windows always, prevent unexpected window from blocking greatly Screen application etc..
A kind of application programming interfaces call method is provided in this specification embodiment, utilizes this i.e. theory of Electron platform The Electron recorded in bright book embodiment is applied and the destination OS of destination OS is using such as: Windows application, The mode for carrying out two-way interprocess communication applies destination OS as Electron application invocation target operating system Command execution module when API, solve the problems, such as Electron application how invocation target operating system API.It realizes Each application programming interfaces in Electron application invocation target operating system support the operation of Electron application invocation target All applications of system do not need to be extended the API of Electron platform, improve the stability of Electron platform, and And reduce development cost.
Application programming interfaces call method can be applied in client or server in this specification, and client can be Smart phone, tablet computer, intelligent wearable device (smartwatch, virtual reality glasses, virtual implementing helmet etc.), intelligent vehicle Carry the electronic equipments such as equipment.
Specifically, the information exchange process that Fig. 1 is application programming interfaces call method in this specification one embodiment is shown It is intended to, as shown in Figure 1, the application programming interfaces call method provided in this specification one embodiment may include:
Step 102, Electron are applied by way of interprocess communication, send primary answer to destination OS application It is requested with program interface call, wherein the application programming interfaces of destination OS are supported in the destination OS application It calls.
Destination OS in this specification embodiment can be the systems such as Windows, Mac, Linux, such as Fig. 1 institute Show, in one example of this specification, creates a Windows for Windows and apply i.e. Windows App (Application).In the specific implementation process, destination OS application can be pre-created, destination OS is answered With the execution medium for the application programming interfaces API that can be understood as destination OS, the API of destination OS can be supported It calls.Such as: a Windows App can be created, can support that Win32/Win64 is applied and UWP is applied.Object run system The creation of system application can be created using suitable application development framework according to actual needs, some implementations of this specification It can be understood that using the exploitation creation destination OS application of C#.Net Core application development framework .Net Core in example To be that .NET technological frame forms concrete implementation under Windows.macOS.Linux system.
Electron application is that Electron App can be according to actual needs to destination OS using such as: Windows App sends the request of native applications program interface call.Such as: Electron application can be sent to Windows application The window of some process is carried out top set operation by the request of native applications program interface call, request.Native applications routine interface tune With may include in request the parameter of request such as: need to be implemented what movement, object that request executes such as: which process letter Breath.
The request of native applications program interface call can be understood as between Electron application and destination OS application Agreement, regulation or agreement, meet certain message specification.
Electron is applied and destination OS application can be understood as the progress in destination OS not With the application of process, Electron is applied and destination OS application can carry out letter by the way of two-way interprocess communication The interaction of breath.Interprocess communication can be understood as that information is propagated or exchanged between different processes.
Step 104, the destination OS, which are applied, parses native applications program interface call request, obtains Application programming interfaces call request must be parsed.
After destination OS application receives the request of native applications program interface call, it can be answered according to Electron Agreement or agreement between parse the request of native applications program interface call, obtain parsing application programming interfaces tune With request.
Step 106, the destination OS are applied according to the parsing application programming interfaces call request, invocation target Corresponding application programming interfaces execute corresponding order in operating system.
Destination OS, which is applied, requests after parsing native applications program interface call, it can obtains The request content of Electron application can execute corresponding life with application programming interfaces corresponding in invocation target operating system It enables, such as: calling corresponding application programming interfaces that the window of specified process is carried out top set operation.
Step 108, the destination OS, which are applied, passes through interprocess communication for application programming interfaces execution result information Mode, be sent to Electron application.
It, can be by application programming interfaces execution result information such as after the complete corresponding operation of destination OS application execution: The information for running succeeded or executing failure is sent to Electron application, completes object run by way of interprocess communication The API Calls of system.Electron application receives the application programming interfaces implementing result letter that destination OS application is sent Breath can determine whether current request runs succeeded, and carry out next step operation with decision.
A kind of application programming interfaces call method is provided in this specification embodiment, is innovatively proposed one kind and is based on The application programming interfaces invocation scheme of destination OS under Electron platform.It applies using Electron and is grasped with target Make the mode that system applies two-way interprocess communication, destination OS is applied and is operated as Electron application invocation target The command execution module when API of system, solving Electron application, how invocation target operating system system API is asked Topic.It does not need to be extended the API of Electron platform, the API Calls of destination OS can be realized, improve The stability of Electron platform, and reduce development cost.
On the basis of the above embodiments, it in some embodiments of this specification, provides a kind of apply and is answered in Electron Application programming interfaces call method in, Fig. 2 are that the application program of Electron application execution in this specification embodiment connects The flow diagram of mouth call method, as shown in Fig. 2, the method that Electron application carries out application programming interfaces calling can wrap It includes:
Step 202, by way of interprocess communication, to destination OS application send native applications routine interface tune With request, so that being operated below the destination OS application execution: parsing the native applications program interface call and ask It asks, and according to the parsing application programming interfaces call request of acquisition, corresponding application programming interfaces in invocation target operating system Execute corresponding order, wherein the application programming interfaces of the destination OS are supported in the destination OS application It calls.
In the specific implementation process, Electron application can be with support section cross-platform ability, i.e. Electron application It can be with the corresponding function of the application programming interfaces of support section destination OS.When Electron application needs invocation target to grasp When making systematic difference routine interface, native applications program can be sent to the application of the destination OS of destination OS and connect Mouth call request.Destination OS application can be understood as the medium of the API Calls of destination OS, can support target The API Calls of operating system.The development approach of destination OS application can refer to the record of above-described embodiment, herein no longer It repeats.
In some embodiments of this specification, destination OS may include: at least one in Mac, Windows, Linux A operating system, it can called by exploitation Mac App, Windows App, Linux App as with Electron App The command execution module of the API of Mac, Windows, Linux realize the tune to the API of Mac, Windows, (SuSE) Linux OS With and management.The application programming interfaces call method that this specification embodiment provides, can apply in several operation systems, real The calling management of the API of existing different operating system.
Electron application send native applications program interface call request in may include request parameter such as: needs It executes any movement, request the object executed such as: which process information.The request of native applications program interface call is understood that For agreement, regulation or the agreement between Electron application and destination OS application, meet certain message specification.
It, can after destination OS application receives the native applications program interface call request that Electron application is sent To parse, obtain to the request of native applications program interface call according to the agreement or agreement between Electron application Parse application programming interfaces call request, it can obtain the request content of Electron application.It can be operated with invocation target and be Corresponding application programming interfaces execute corresponding order in system, such as: calling corresponding application programming interfaces by the window of specified process Mouth carries out top set operation.
Step 204 receives the destination OS using by way of interprocess communication, and the application program of transmission connects Mouth executing result message.
It, can be by application programming interfaces execution result information such as after the complete corresponding operation of destination OS application execution: The information for running succeeded or executing failure is sent to Electron application, completes object run by way of interprocess communication The API Calls of system.Electron application receives the application programming interfaces implementing result letter that destination OS application is sent Breath can determine whether current request runs succeeded, and carry out next step operation with decision, such as:, can be with if API Calls fail The request of native applications program interface call is sent again, requests to be called specified API again.
A kind of application programming interfaces call method is provided in this specification embodiment, is innovatively proposed one kind and is based on The application programming interfaces invocation scheme of destination OS under Electron platform.It applies using Electron and is grasped with target Make the mode that system applies two-way interprocess communication, destination OS is applied and is operated as Electron application invocation target The command execution module when API of system, solving Electron application, how invocation target operating system system API is asked Topic.It does not need to be extended the API of Electron platform, improves the stability of Electron platform, and reduce out Send out cost.
Fig. 3 is the flow diagram of application programming interfaces call method in another embodiment of this specification, such as Fig. 3 institute Show, on the basis of the above embodiments, in some embodiments of this specification, the method can also include:
Before sending the request of native applications program interface call to destination OS application, the target is judged Whether operating system application starts;
If the destination OS is not using starting, by the destination OS application copy to the target In the application data directory of operating system, and start the destination OS application, and to the destination OS application Send the native applications program interface call request;
If the destination OS application has been started up, described primary answer is sent to destination OS application It is requested with program interface call.
In the specific implementation process, after Electron application starting, service logic can be executed, that is, executes the function of itself It can be such as: display content, downloading resource, when Electron application needs the API of invocation target operating system to realize certain function When energy, the request of native applications program interface call can be sent to the application of the destination OS of destination OS.It is sending Before the request of native applications program interface call, in some embodiments of this specification, destination OS application can be first judged Whether start, if starting, the request of native applications program interface call directly can be sent to destination OS application. If destination OS application copy to destination OS can be applied number using not starting by destination OS According in catalogue, and start destination OS application, then sends the native applications routine interface to destination OS application Call request.It avoids being packetized in because of destination OS application in the ASAR file of Electron application, can not start, cause Destination OS application can not execute the calling api command of Electron application.
The code of Electron App is often packaged into the file of an entitled ASAR of extension, performance objective operation The application of the API of system is that destination OS application can be also packaged in this document.This specification embodiment grasps target Make the App Data that system APP is copied in destination OS to apply in data directory, such as: assuming that the entitled admin of user, So corresponding catalogue be exactly C: Users admin AppData Roaming, copy destination OS APP to this After in catalogue, restart the API Calls that destination OS APP is realized to destination OS.
Wherein, destination OS application whether the duplication of the judgement that starts and destination OS application and subsequent Start-up operation can have destination OS to execute, and can also be executed by Electron App, specifically can be according to practical need It is configured, this specification embodiment is not especially limited.
This specification embodiment, before the API Calls for carrying out destination OS, first judgement carries out destination OS Whether the destination OS application that API Calls execute starts, if inactive, by destination OS application copy to target In the application data directory of operating system, the function of the API of Electron App invocation target operating system is realized.
As shown in figure 3, on the basis of the above embodiments, in some embodiments of this specification, the method can also be wrapped It includes:
Before sending the request of native applications program interface call to destination OS application, judge current Whether Electron application supports the native applications program interface call to request corresponding application programming interfaces;
If not supporting, the native applications program interface call request is sent to destination OS application, is asked Ask the destination OS application that corresponding application programming interfaces in the destination OS is called to execute corresponding order;
It is corresponding using supporting that the native applications program interface call is requested in Electron application if supporting Application programming interfaces execute corresponding order.
In the specific implementation process, Electron App may support section cross-platform ability, that is, Electron It may include the Electron API of part in App, certain business demand can be completed, such as: one H5 application of starting is shown Show, hide, exiting, obtaining the functions such as focus.Native applications program is sent to destination OS application in Electron App Before interface call request, it can be determined that with the presence or absence of corresponding with the request of native applications program interface call in Electron App Electron API support native applications program interface call whether is supported to request corresponding application programming interfaces.If depositing Then it can directly utilize corresponding Electron API execution corresponding operation if it does not exist then can be to object run system It is to send destination OS to destination OS application in Fig. 3 that system application, which sends the request of native applications program interface call, API executes request, and corresponding application programming interfaces execute corresponding in request target operating system application invocation target operating system Order.
In this specification embodiment, when Electron App has the API supported, it can choose and directly execute accordingly Operation, by the API of destination OS application invocation target operating system, realizes mesh when Electron App is not supported The flexible calling of operating system API is marked, and the extension for carrying out API to destination OS can not had to, it is ensured that system Stability.
Fig. 4 is that primary application programming interfaces call request and application programming interfaces execute knot in this specification one embodiment The form schematic diagram of fruit message, as shown in figure 4, Electron App can be pre-defined in some embodiments of this specification Message specification between destination OS App.As shown in figure 4, " NativeCommand: " can indicate native applications journey The Fixed CP of sequence interface call request, indicates the beginning of request message;" (Request ID) " can indicate native applications journey The request of sequence interface call request is numbered, can be when sending request each time, and ID adds 1;" (Command Name) " can be with table Show the command name of native applications program interface call request;" (Parameter 1) "~" (Parameter of middle section N the required parameter of native applications program interface call request) " can be indicated;Last " n " can indicate native applications program The fixation suffix of interface call request indicates that request command terminates.Likewise, as shown in figure 4, " NameResult: " can be with table The Fixed CP for showing application programming interfaces executing result message indicates the beginning replied message;" (Request ID) " can be with table Show the request number for corresponding to the request of native applications program interface call, to indicate the return information of which request; " (Command Result) " can indicate the result information for corresponding to the request of native applications program interface call;" n " can be with table The fixation suffix for showing application programming interfaces executing result message, indicates the end replied message.
It should be noted that the format of native applications program interface call request and application programming interfaces executing result message In Fixed CP and fixed suffix concrete form, can be according to actual needs into setting.Native applications program interface call The Fixed CP of the format of request and application programming interfaces executing result message and fixed suffix can be set to identical content, It may be set to be different contents, this specification embodiment is not especially limited.
Such as: the application widget that process ID is 11296 is if desired subjected to top set operation, it is assumed that top set window command For BringWindowFrontAndFocus, requesting ID to request number is 1, then i.e. native applications program interface call is requested It can indicate are as follows: NativeCommand:1BringWindowFrontAndFocus11296 n.Assuming that returning the result 0 expression mistake It loses, 1 indicates successfully, then application programming interfaces executing result message can be expressed as (assuming that calling successfully): NativeResult:1 1\n。
This specification embodiment passes through the message specification between setting Electron App and destination OS App, side Just Electron App and destination OS App carries out information exchange, improves the accuracy and efficiency of information exchange, is mesh The API Calls of mark operating system provide accurate data basis.
On the basis of the above embodiments, in some embodiments of this specification, the native applications program interface call is asked The format asked can also include: JSON (JavaScript Object Notation) data format, XML (extensible markup language Speech) format, at least one of the binary format of compression.
A variety of message formats can be supported in this specification embodiment, improve the applicability of application programming interfaces calling.
In some embodiments of this specification, additionally provides and a kind of apply destination OS corresponding in destination OS Application programming interfaces call method in, Fig. 5 are destination OS application executions in some embodiments of this specification The flow diagram of application programming interfaces call method, as shown in figure 5, destination OS application carries out application programming interfaces tune Method may include:
Step 502 receives Electron using the native applications routine interface tune sent by way of interprocess communication With request.
In the specific implementation process, can in advance development goal operating system destination OS application such as: exploitation Windows App, the calling that can be used as the API of Windows operating system execute, and Windows App can support Win32/ Win64 application, moreover it is possible to UWP be supported to apply.When Electron application needs the API of invocation target operating system to realize specified function When energy, can be applied such as by way of interprocess communication to destination OS: developing Windows App sends native applications Program interface call request.The particular content and format of native applications program interface call request can be with reference to above-described embodiments It records, details are not described herein again.
In some embodiments of this specification, development goal operating system applies Windows App such as can be using such as lower section Formula:
Using C#.Net Core application development framework, the destination OS application is created.
.Net Core can be understood as .NET technological frame and form the tool under Windows.macOS.Linux system The realization of body.This specification embodiment can be incited somebody to action by the development goal operating system application of C#.Net Core application development framework Medium of the destination OS App developed as the API Calls of target behaviour's system, realizes Electron application invocation target The function of each API of operating system.Also, C#.Net Core application development framework easily readily extends any target behaviour Make system such as: the API Calls that Windows is supported, the automatic Memory recycle management provided using C#.Net Core, reflection etc. Advanced feature, development efficiency can be greatly improved.
Step 504 parses native applications program interface call request, obtains parsing application programming interfaces tune With request.
It, can after destination OS App receives the native applications program interface call request of Electron App transmission With basis and the agreement or agreement between Electron App, the request of native applications program interface call is parsed, is parsed Application programming interfaces call request.
Step 506, according to the parsing application programming interfaces call request, call corresponding application programming interfaces to execute phase The order answered.
After destination OS App parses the request of native applications program interface call, it can obtain The request content of Electron application can execute corresponding life with application programming interfaces corresponding in invocation target operating system It enables, such as: calling corresponding application programming interfaces that the window of specified process is carried out top set operation.
Step 508, application programming interfaces executing result message is returned to by way of interprocess communication it is described Electron application.
It, can be by application programming interfaces execution result information such as: holding after destination OS App has executed corresponding operation The information for going successfully or executing failure is sent to Electron application, completes object run system by way of interprocess communication The API Calls of system.Electron application receives the application programming interfaces execution result information that destination OS application is sent It can determine whether current request runs succeeded, next step operation is carried out with decision.
A kind of application programming interfaces call method is provided in this specification embodiment, is innovatively proposed one kind and is based on The application programming interfaces invocation scheme of destination OS under Electron platform.It applies using Electron and is grasped with target Make the mode that system applies two-way interprocess communication, destination OS is applied and is operated as Electron application invocation target The command execution module when API of system, solving Electron application, how invocation target operating system system API is asked Topic.It does not need to be extended the API of Electron platform, improves the stability of Electron platform, and reduce out Send out cost.
Various embodiments are described in a progressive manner for the above method in this specification, identical between each embodiment Similar part is participated in mutually, and each embodiment focuses on the differences from other embodiments.Correlation Locate the part explanation of mothed of participating embodiment.
Based on application programming interfaces call method described above, this specification one or more embodiment also provides one kind Application programming interfaces calling device.The device may include the system (packet for having used this specification embodiment the method Include distributed system), software (application), module, component, server, client etc. and combine the necessary device for implementing hardware. Device such as the following examples institute based on same innovation thinking, in one or more embodiments of this specification embodiment offer It states.Since the implementation that device solves the problems, such as is similar to method, the implementation of the specific device of this specification embodiment can To participate in the implementation of preceding method, overlaps will not be repeated.Used below, term " unit " or " module " can be real The combination of the software and/or hardware of existing predetermined function.Although device described in following embodiment is preferably realized with software, But the realization of the combination of hardware or software and hardware is also that may and be contemplated.
Specifically, Fig. 6 is that the modular structure of application programming interfaces calling device one embodiment that this specification provides is shown It is intended to, as shown in fig. 6, the application programming interfaces calling device provided in this specification may include: Electron using 61 Hes Destination OS applies 62, wherein the application programming interfaces that the destination OS supports destination OS using 62 Calling;
The Electron is using 61 for sending to destination OS application primary by way of interprocess communication Application programming interfaces call request;
The destination OS is used for using 62:
Native applications program interface call request is parsed, parsing application programming interfaces call request is obtained;
According to the parsing application programming interfaces call request, corresponding application programming interfaces is called to execute corresponding life It enables;
By application programming interfaces execution result information by way of interprocess communication, it is sent to the Electron and answers With.
In the specific implementation process, as shown in fig. 6, it may include supporting 611 He of functional module that Electron, which applies 61, Local command module 612, destination OS may include command execution module 621 and command analysis module 622 using 62.This Specification embodiment uses Electron and applies with destination OS application such as: Windows applies two-way interprocess communication Mode come solve the problems, such as Electron application how invocation target operating system such as: windows platform system API.Below The technical solution of this specification embodiment is illustrated using Windows as destination OS in conjunction with Fig. 6:
Electron Function Module in Electron App be support functional module 611 to represent be The cross-platform ability part that Electron platform has been supported, such as: one H5 of starting is applied, shows, hides, exits, is obtained The functions such as focus, what Native Command Module, that is, local command module 612 represented is that Electron platform is not supported Windows system API function.Electron App passes through one Native API message request character string, that is, above-mentioned reality of construction The native applications program interface call request (following Native API message specification) for applying example record is sent out with interprocess communication mode It is sent to the end Windows App.This specification embodiment can be based on the Windows App that Unreal platform is developed, can be with Started by the application management container based on Electron platform development.Command Parse in Windows App Module, that is, command analysis module 622 is responsible for parsing Native API message character string, then calls Command Execute Module, that is, command execution module 621 executes order according to the message after parsing, finally constructs Native API message result word Symbol string is the application programming interfaces execution result information of above-described embodiment record with IPC (Inter-Process Communication, interprocess communication) mode of message returns to the Native Command in Electron App Module。
The application programming interfaces calling device that this specification embodiment provides uses Electron application and object run System applies the mode of two-way interprocess communication, and destination OS is applied as Electron application invocation target operation system The command execution module when API of system, such as: having used execution medium of the Windows App as Windows API, Neng Goutong When support win32/win64API and UWP API, therefore can be good at support UWP application.And it is able to use C#.Net Core application development framework easily readily extends the API Calls that any Windows is supported, there is automatic Memory recycle pipe Advanced features, the development efficiency such as reason, reflection exceed the C++ development mode of win32 significantly.For other destination OSs Such as: same function may be implemented using same method in Mac, Linux.
Fig. 7 is the structural schematic diagram of application programming interfaces calling device in another embodiment of this specification, this applies journey Sequence interface calling device can be applied in Electron App, as shown in fig. 7, the device can specifically include:
Application programming interfaces calling module 71, can be used for by way of interprocess communication, answer to destination OS With the request of native applications program interface call is sent, so that being operated below the destination OS application execution: parsing institute The request of native applications program interface call is stated, and according to the parsing application programming interfaces call request of acquisition, invocation target operation Corresponding application programming interfaces execute corresponding order in system, wherein the target is supported in the destination OS application The calling of the application programming interfaces of operating system;
Implementing result receiving module 72 can be used for receiving the destination OS using the side by interprocess communication Formula, the application programming interfaces executing result message of transmission.
The application programming interfaces calling device that this specification embodiment provides, innovatively proposes one kind and is based on The application programming interfaces invocation scheme of destination OS under Electron platform.It applies using Electron and is grasped with target Make the mode that system applies two-way interprocess communication, destination OS is applied and is operated as Electron application invocation target The command execution module when API of system, solving Electron application, how invocation target operating system system API is asked Topic.It does not need to be extended the API of Electron platform, improves the stability of Electron platform, and reduce out Send out cost.
On the basis of the above embodiments, in some embodiments of this specification, described device further includes destination OS Application launch module is used for:
Before sending the request of native applications program interface call to destination OS application, the target is judged Whether operating system application starts;
If the destination OS is not using starting, by the destination OS application copy to the target In the application data directory of operating system, and start the destination OS application, calls mould by the application programming interfaces Block sends the native applications program interface call request to destination OS application;
If the destination OS application has been started up, from the application programming interfaces calling module to the target Operating system application sends the native applications program interface call request.
The application programming interfaces calling device that this specification embodiment provides, in the API Calls for carrying out destination OS Before, first judge whether the destination OS application for carrying out the execution of destination OS API Calls starts, if inactive, By in the application data directory of destination OS application copy to destination OS, Electron App invocation target is realized The function of the API of operating system.
On the basis of the above embodiments, in some embodiments of this specification, described device further includes using support judgement Module is used for:
Before sending the request of native applications program interface call to destination OS application, judge current Whether Electron application supports the native applications program interface call to request corresponding application programming interfaces;
If not supporting, the original is sent from the application programming interfaces calling module to destination OS application Raw application programming interfaces call request requests the destination OS application to call corresponding in the destination OS answer Corresponding order is executed with routine interface;
It is corresponding using supporting that the native applications program interface call is requested in Electron application if supporting Application programming interfaces execute corresponding order.
There is the API supported in Electron App in the application programming interfaces calling device that this specification embodiment provides When, it can choose and directly execute corresponding operation, when Electron App is not supported, called by destination OS application The API of destination OS, realize destination OS API flexible calling, and can not have to destination OS into The extension of row API, it is ensured that the stability of system.
On the basis of the above embodiments, in some embodiments of this specification, the application programming interfaces calling module hair The format for the native applications program interface call request sent includes: Fixed CP, request number, command name, request ginseng Several and fixed suffix;
The format of the application programming interfaces executing result message includes: Fixed CP, the corresponding native applications program Result information, the fixed suffix that request number, the corresponding native applications program interface call of interface call request are requested.
The application programming interfaces calling device that this specification embodiment provides is grasped by setting Electron App and target Make the message specification between system App, facilitates Electron App and destination OS App to carry out information exchange, improve The accuracy and efficiency of information exchange provides accurate data basis for the API Calls of destination OS.
On the basis of the above embodiments, in some embodiments of this specification, the application programming interfaces calling module hair Send the native applications program interface call request format include: JSON data format, XML format, compression binary system At least one of format.
The application programming interfaces calling device that this specification embodiment provides, can support a variety of message formats, improve The applicability that application programming interfaces call.
On the basis of the above embodiments, in some embodiments of this specification, the destination OS include: Mac, At least one operating system in Windows, Linux.
The application programming interfaces calling device that this specification embodiment provides, can apply in several operation systems, real The calling management of the API of existing different operating system.
Fig. 8 is the structural schematic diagram of application programming interfaces calling device in another embodiment of this specification, this applies journey Sequence interface calling device can be applied in destination OS App, and the target behaviour is supported in the destination OS application Make the calling of systematic difference routine interface, the device as shown in Figure 8 can specifically include:
Call request receiving module 81, can be used for receiving Electron and applies and sent by way of interprocess communication The request of native applications program interface call;
Request analysis module 82 can be used for requesting to parse to the native applications program interface call, be solved Analyse application programming interfaces call request;
Command execution module 83 can be used for calling corresponding answer according to the parsing application programming interfaces call request Corresponding order is executed with routine interface;
Implementing result return module 84 can be used for application programming interfaces executing result message passing through interprocess communication Mode returns to the Electron application.
The application programming interfaces calling device that this specification embodiment provides, innovatively proposes one kind and is based on The application programming interfaces invocation scheme of destination OS under Electron platform.It applies using Electron and is grasped with target Make the mode that system applies two-way interprocess communication, destination OS is applied and is operated as Electron application invocation target The command execution module when API of system, solving Electron application, how invocation target operating system system API is asked Topic.It does not need to be extended the API of Electron platform, improves the stability of Electron platform, and reduce out Send out cost.
On the basis of the above embodiments, in some embodiments of this specification, described device further includes applying creation module, For:
Using C#.Net Core application development framework, the destination OS application is created.
The application programming interfaces calling device that this specification embodiment provides, passes through C#.Net Core application development framework Development goal operating system application, can be using the destination OS App developed as the matchmaker of the API Calls of target behaviour's system It is situated between, realizes the function of each API of Electron application invocation target operating system.Also, C#.Net Core application development framework Easily readily extend any destination OS such as: the API Calls that Windows is supported are provided using C#.Net Core Advanced features, the development efficiency such as automatic Memory recycle management, reflection can be greatly improved.
It should be noted that device described above can also include other embodiment party according to the description of embodiment of the method Formula.Concrete implementation mode is referred to the description of above-mentioned corresponding embodiment of the method, does not repeat one by one herein.
This specification embodiment also provides a kind of application programming interfaces calling processing equipment, comprising: at least one processor And the memory for storage processor executable instruction, the processor are realized in above-described embodiment when executing described instruction The application programming interfaces call method that Electron application or destination OS application side execute.
It should be noted that processing equipment described above can also include other implement according to the description of embodiment of the method Mode.Concrete implementation mode is referred to the description of related method embodiment, does not repeat one by one herein.
The application programming interfaces calling system or device or processing equipment that this specification provides, can also apply in a variety of numbers According in analysis process system.The system or device or processing equipment may include any one application program in above-described embodiment Interface calling device.The system or device or processing equipment can be individual server, also may include having used this The server cluster of one or more the methods of specification or one or more embodiment devices, system (including distribution System), software (application), practical operation device, logic gates device, quantum computer etc. and combine necessary implementation hardware Terminal installation.The detection system of the verification variance data may include that at least one processor and storage computer can be held The memory of row instruction, the processor realize side described in above-mentioned any one or multiple embodiments when executing described instruction The step of method.
Embodiment of the method provided by this specification embodiment can mobile terminal, terminal, server or It is executed in similar arithmetic unit.For running on the server, Fig. 9 is that a kind of application program connects in this specification embodiment The hardware block diagram of mouthful invoking server, the server can be application programming interfaces calling device in above-described embodiment or Application programming interfaces calling system.As shown in figure 9, server 10 may include one or more (only showing one in figure) processing Device 100 (processing unit that processor 100 can include but is not limited to Micro-processor MCV or programmable logic device FPGA etc.), Memory 200 for storing data and the transmission module 300 for communication function.This neighborhood those of ordinary skill can be with Understand, structure shown in Fig. 9 is only to illustrate, and does not cause to limit to the structure of above-mentioned electronic device.For example, server 10 is also It may include more or less component than shown in Fig. 9, such as can also include other processing hardware, such as database or more Grade caching, GPU, or with the configuration different from shown in Fig. 9.
Memory 200 can be used for storing the software program and module of application software, such as answering in this specification embodiment With the corresponding program instruction/module of program interface call method, processor 100 is stored in soft in memory 200 by operation Part program and module, thereby executing various function application and data processing.Memory 200 may include high speed random storage Device may also include nonvolatile memory, such as one or more magnetic storage device, flash memory or other are non-volatile solid State memory.In some instances, memory 200 can further comprise the memory remotely located relative to processor 100, this A little remote memories can pass through network connection to terminal.The example of above-mentioned network includes but is not limited to internet, enterprise Industry intranet, local area network, mobile radio communication and combinations thereof.
Transmission module 300 is used to that data to be received or sent via a network.Above-mentioned network specific example may include The wireless network that the communication providers of terminal provide.In an example, transmission module 300 includes a Network adaptation Device (Network Interface Controller, NIC), can be connected by base station with other network equipments so as to it is mutual Networking is communicated.In an example, transmission module 300 can be radio frequency (Radio Frequency, RF) module, use In wirelessly being communicated with internet.
It is above-mentioned that this specification specific embodiment is described.Other embodiments are in the scope of the appended claims It is interior.In some cases, the movement recorded in detail in the claims or step can be come according to the sequence being different from embodiment It executes and desired result still may be implemented.In addition, process depicted in the drawing not necessarily require show it is specific suitable Sequence or consecutive order are just able to achieve desired result.In some embodiments, multitasking and parallel processing be also can With or may be advantageous.
Method or apparatus described in above-described embodiment that this specification provides can realize that business is patrolled by computer program It collects and records on a storage medium, the storage medium can be read and be executed with computer, realize this specification embodiment institute The effect of description scheme.
The storage medium may include the physical unit for storing information, usually by after information digitalization again with benefit The media of the modes such as electricity consumption, magnetic or optics are stored.It may include: that letter is stored in the way of electric energy that the storage medium, which has, The device of breath such as, various memory, such as RAM, ROM;The device of information is stored in the way of magnetic energy such as, hard disk, floppy disk, magnetic Band, core memory, magnetic bubble memory, USB flash disk;Using optical mode storage information device such as, CD or DVD.Certainly, there are also it Readable storage medium storing program for executing of his mode, such as quantum memory, graphene memory etc..
This specification embodiment provide above-mentioned application programming interfaces call method or device can in a computer by Reason device executes corresponding program instruction to realize, such as using the c++ language of windows operating system in the realization of the end PC, linux system System is realized or other are for example realized using android, iOS system programming language in intelligent terminal, and based on quantum Processing logic realization of calculation machine etc..
It should be noted that specification device described above, computer storage medium, system are implemented according to correlation technique The description of example can also include other embodiments, and concrete implementation mode is referred to the description of corresponding method embodiment, It does not repeat one by one herein.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment Divide and participate in mutually, each embodiment focuses on the differences from other embodiments.Especially for hardware+ For program class embodiment, since it is substantially similar to the method embodiment, so being described relatively simple, related place acceding party The part of method embodiment illustrates.
This specification embodiment is not limited to meet industry communication standard, standard computer data processing sum number According to situation described in storage rule or this specification one or more embodiment.The right way of conduct is made in certain professional standards or use by oneself In formula or the practice processes of embodiment description embodiment modified slightly also may be implemented above-described embodiment it is identical, it is equivalent or The implementation result being anticipated that after close or deformation.Using these modifications or deformed data acquisition, storage, judgement, processing side The embodiment of the acquisitions such as formula still may belong within the scope of the optional embodiment of this specification embodiment.
In the 1990s, the improvement of a technology can be distinguished clearly be on hardware improvement (for example, Improvement to circuit structures such as diode, transistor, switches) or software on improvement (improvement for method flow).So And with the development of technology, the improvement of current many method flows can be considered as directly improving for hardware circuit. Designer nearly all obtains corresponding hardware circuit by the way that improved method flow to be programmed into hardware circuit.Cause This, it cannot be said that the improvement of a method flow cannot be realized with hardware entities module.For example, programmable logic device (Programmable Logic Device, PLD) (such as field programmable gate array (Field Programmable Gate Array, FPGA)) it is exactly such a integrated circuit, logic function determines device programming by user.By designer Voluntarily programming comes a digital display circuit " integrated " on a piece of PLD, designs and makes without asking chip maker Dedicated IC chip.Moreover, nowadays, substitution manually makes IC chip, this programming is also used instead mostly " is patrolled Volume compiler (logic compiler) " software realizes that software compiler used is similar when it writes with program development, And the source code before compiling also write by handy specific programming language, this is referred to as hardware description language (Hardware Description Language, HDL), and HDL is also not only a kind of, but there are many kind, 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 is most generally used at present Integrated Circuit Hardware Description Language) and Verilog.Those skilled in the art also answer This understands, it is only necessary to method flow slightly programming in logic and is programmed into integrated circuit with above-mentioned several hardware description languages, The hardware circuit for realizing the logical method process can be readily available.
Controller can be implemented in any suitable manner, for example, controller can take such as microprocessor or processing The computer for the computer readable program code (such as software or firmware) that device and storage can be executed by (micro-) processor can Read medium, logic gate, switch, specific integrated circuit (Application Specific Integrated Circuit, ASIC), the form of programmable logic controller (PLC) and insertion microcontroller, the example of controller includes but is not limited to following microcontroller Device: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320 are deposited Memory controller is also implemented as a part of the control logic of memory.It is also known in the art that in addition to Pure computer readable program code mode is realized other than controller, can be made completely by the way that method and step is carried out programming in logic Controller is obtained to come in fact in the form of logic gate, switch, specific integrated circuit, programmable logic controller (PLC) and insertion microcontroller etc. Existing identical function.Therefore this controller is considered a kind of hardware component, and to including for realizing various in it The device of function can also be considered as the structure in hardware component.Or even, it can will be regarded for realizing the device of various functions For either the software module of implementation method can be the structure in hardware component again.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity, Or it is realized by the product with certain function.It is a kind of typically to realize that equipment is computer.Specifically, computer for example may be used Think personal computer, laptop computer, vehicle-mounted human-computer interaction device, cellular phone, camera phone, smart phone, individual Digital assistants, media player, navigation equipment, electronic mail equipment, game console, tablet computer, wearable device or The combination of any equipment in these equipment of person.
Although this specification one or more embodiment provides the method operating procedure as described in embodiment or flow chart, It but may include more or less operating procedure based on conventional or without creativeness means.The step of being enumerated in embodiment Sequence is only one of numerous step execution sequence mode, does not represent and unique executes sequence.Device in practice or When end product executes, can be executed according to embodiment or the execution of method shown in the drawings sequence or parallel (such as it is parallel The environment of processor or multiple threads, even distributed data processing environment).The terms "include", "comprise" or its Any other variant is intended to non-exclusive inclusion so that include the process, methods of a series of elements, product or Equipment not only includes those elements, but also including other elements that are not explicitly listed, or further include for this process, Method, product or the intrinsic element of equipment.In the absence of more restrictions, being not precluded is including the element There is also other identical or equivalent elements in process, method, product or equipment.The first, the second equal words are used to indicate name Claim, and does not indicate any particular order.
For convenience of description, it is divided into various modules when description apparatus above with function to describe respectively.Certainly, implementing this The function of each module can be realized in the same or multiple software and or hardware when specification one or more, it can also be with The module for realizing same function is realized by the combination of multiple submodule or subelement etc..Installation practice described above is only It is only illustrative, for example, in addition the division of the unit, only a kind of logical function partition can have in actual implementation Division mode, such as multiple units or components can be combined or can be integrated into another system or some features can be with Ignore, or does not execute.Another point, shown or discussed mutual coupling, direct-coupling or communication connection can be logical Some interfaces are crossed, the indirect coupling or communication connection of device or unit can be electrical property, mechanical or other forms.
The present invention be referring to according to the method for the embodiment of the present invention, the process of device (system) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM), Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage, graphene stores or other Magnetic storage device or any other non-transmission medium, can be used for storage can be accessed by a computing device information.According to herein In define, computer-readable medium does not include temporary computer readable media (transitory media), such as the data of modulation Signal and carrier wave.
It will be understood by those skilled in the art that this specification one or more embodiment can provide as method, system or calculating Machine program product.Therefore, this specification one or more embodiment can be used complete hardware embodiment, complete software embodiment or The form of embodiment combining software and hardware aspects.Moreover, this specification one or more embodiment can be used at one or It is multiple wherein include computer usable program code computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) on the form of computer program product implemented.
This specification one or more embodiment can computer executable instructions it is general on It hereinafter describes, such as program module.Generally, program module includes executing particular task or realization particular abstract data type Routine, programs, objects, component, data structure etc..This this specification one can also be practiced in a distributed computing environment Or multiple embodiments, in these distributed computing environments, by being held by the connected remote processing devices of communication network Row task.In a distributed computing environment, program module can be located at the local and remote computer including storage equipment In storage medium.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment Divide and participate in mutually, each embodiment focuses on the differences from other embodiments.Especially for system reality For applying example, since it is substantially similar to the method embodiment, so being described relatively simple, related place mothed of participating embodiment Part explanation.In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", The description of " specific example " or " some examples " etc. means specific features described in conjunction with this embodiment or example, structure, material Or feature is contained at least one embodiment or example of this specification.In the present specification, to the signal of above-mentioned term Property statement be necessarily directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described It may be combined in any suitable manner in any one or more of the embodiments or examples.In addition, without conflicting with each other, this The technical staff in field can be by the spy of different embodiments or examples described in this specification and different embodiments or examples Sign is combined.
The foregoing is merely the embodiments of this specification one or more embodiment, are not limited to this specification One or more embodiments.To those skilled in the art, this specification one or more embodiment can have it is various more Change and changes.All spirit in this specification and any modification, equivalent replacement, improvement and so within principle should all include Within scope of the claims.

Claims (19)

1. a kind of application programming interfaces call method, comprising:
Electron is applied by way of interprocess communication, sends native applications routine interface tune to destination OS application With request, wherein the calling of the application programming interfaces of destination OS is supported in the destination OS application;
The destination OS, which is applied, parses native applications program interface call request, obtains parsing and applies journey Sequence interface call request;
The destination OS is applied according to the parsing application programming interfaces call request, right in invocation target operating system The application programming interfaces answered execute corresponding order;
The destination OS is applied application programming interfaces execution result information by way of interprocess communication, is sent to The Electron application.
2. a kind of application programming interfaces calling system, comprising: Electron is applied and destination OS application, wherein described The calling of the application programming interfaces of destination OS is supported in destination OS application;
The Electron is applied for sending native applications journey to destination OS application by way of interprocess communication Sequence interface call request;
The destination OS, which is applied, to be used for:
Native applications program interface call request is parsed, parsing application programming interfaces call request is obtained;
According to the parsing application programming interfaces call request, corresponding application programming interfaces is called to execute corresponding order;
By application programming interfaces execution result information by way of interprocess communication, it is sent to the Electron application.
3. a kind of application programming interfaces call method, comprising:
By way of interprocess communication, the request of native applications program interface call is sent to destination OS application, so that Operate below the destination OS application execution: parse the native applications program interface call request, and according to obtaining Parsing application programming interfaces call request, corresponding application programming interfaces execute corresponding life in invocation target operating system It enables, wherein the calling of the application programming interfaces of the destination OS is supported in the destination OS application;
It receives the destination OS to apply by way of interprocess communication, the application programming interfaces implementing result of transmission disappears Breath.
4. method as claimed in claim 3, the method also includes:
Before sending the request of native applications program interface call to destination OS application, the object run is judged Whether system application starts;
If the destination OS is not using starting, by the destination OS application copy to the object run In systematic difference data directory, and start the destination OS application, and is sent to destination OS application The native applications program interface call request;
If the destination OS application has been started up, the native applications journey is sent to destination OS application Sequence interface call request.
5. method as claimed in claim 3, the method also includes:
Before sending the request of native applications program interface call to destination OS application, judge current Whether Electron application supports the native applications program interface call to request corresponding application programming interfaces;
If not supporting, the native applications program interface call request is sent to destination OS application, requests institute Stating destination OS application calls corresponding application programming interfaces in the destination OS to execute corresponding order;
If supporting, using supporting the native applications program interface call to request corresponding application in Electron application Routine interface executes corresponding order.
6. method as claimed in claim 3, the format of the native applications program interface call request include: Fixed CP, Request number, command name, required parameter and fixed suffix;
The format of the application programming interfaces executing result message includes: Fixed CP, the corresponding native applications routine interface Result information, the fixed suffix that request number, the corresponding native applications program interface call of call request are requested.
7. the format of method as claimed in claim 3, the native applications program interface call request includes: JSON data lattice At least one of formula, XML format, binary format of compression.
8. the destination OS includes: in Mac, Windows, Linux such as claim 3-7 described in any item methods At least one operating system.
9. a kind of application programming interfaces calling device, comprising:
Application programming interfaces calling module, for being sent to destination OS application primary by way of interprocess communication Application programming interfaces call request, so that being operated below the destination OS application execution: parsing the native applications Program interface call request, and according to the parsing application programming interfaces call request of acquisition, it is corresponding in invocation target operating system Application programming interfaces execute corresponding order, wherein the destination OS is supported in the destination OS application The calling of application programming interfaces;
Implementing result receiving module is applied by way of interprocess communication for receiving the destination OS, transmission Application programming interfaces executing result message.
10. device as claimed in claim 9, described device further includes destination OS application launch module, is used for:
Before sending the request of native applications program interface call to destination OS application, the object run is judged Whether system application starts;
If the destination OS is not using starting, by the destination OS application copy to the object run In systematic difference data directory, and start the destination OS application, from the application programming interfaces calling module to The destination OS application sends the native applications program interface call request;
If the destination OS application has been started up, from the application programming interfaces calling module to the object run System application sends the native applications program interface call request.
11. device as claimed in claim 9, described device further includes being used for using support judgment module:
Before sending the request of native applications program interface call to destination OS application, judge current Whether Electron application supports the native applications program interface call to request corresponding application programming interfaces;
If not supporting, described primary answer is sent from the application programming interfaces calling module to destination OS application It is requested with program interface call, requests the destination OS application to be called corresponding using journey in the destination OS Sequence interface executes corresponding order;
If supporting, using supporting the native applications program interface call to request corresponding application in Electron application Routine interface executes corresponding order.
12. device as claimed in claim 9, the native applications program that the application programming interfaces calling module is sent is connect The format of mouth call request includes: Fixed CP, request number, command name, required parameter and fixed suffix;
The format of the application programming interfaces executing result message includes: Fixed CP, the corresponding native applications routine interface Result information, the fixed suffix that request number, the corresponding native applications program interface call of call request are requested.
13. device as claimed in claim 9, the native applications program that the application programming interfaces calling module is sent is connect The format of mouth call request includes: at least one of JSON data format, XML format, the binary format of compression.
14. the destination OS includes: Mac, Windows, Linux such as claim 9-13 described in any item devices In at least one operating system.
15. a kind of application programming interfaces call method is applied to destination OS application, the destination OS application branch Hold the calling of the application programming interfaces of the destination OS, which comprises
It receives Electron and applies the native applications program interface call request sent by way of interprocess communication;
Native applications program interface call request is parsed, parsing application programming interfaces call request is obtained;
According to the parsing application programming interfaces call request, corresponding application programming interfaces is called to execute corresponding order;
Application programming interfaces executing result message is returned into the Electron application by way of interprocess communication.
16. method as claimed in claim 15, the method also includes:
Using C#.Net Core application development framework, the destination OS application is created.
17. a kind of application programming interfaces calling device is applied to destination OS application, the destination OS application branch The calling of the application programming interfaces of the destination OS is held, described device includes:
Call request receiving module applies the native applications journey sent by way of interprocess communication for receiving Electron Sequence interface call request;
Request analysis module obtains parsing application program for parsing to native applications program interface call request Interface call request;
Command execution module, for calling corresponding application programming interfaces according to the parsing application programming interfaces call request Execute corresponding order;
Implementing result return module, for returning to application programming interfaces executing result message by way of interprocess communication The Electron application.
18. device as claimed in claim 17, described device further includes being used for using creation module:
Using C#.Net Core application development framework, the destination OS application is created.
19. a kind of application programming interfaces call processing equipment, comprising: at least one processor and can be held for storage processor The memory of row instruction, the processor realize the described in any item methods of claim 3-7 or right when executing described instruction It is required that the described in any item methods of 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 true CN110109718A (en) 2019-08-09
CN110109718B 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)

Cited By (1)

* 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

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006039206A1 (en) * 2004-09-30 2006-04-13 Citrix Systems, Inc. A method and system for accessing resources
CN102123196A (en) * 2010-12-29 2011-07-13 浙大网新科技股份有限公司 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)
US20150347749A1 (en) * 2014-05-29 2015-12-03 Apple Inc. Consistent extension points to allow an extension to extend functionality of an application to another application
CN105205412A (en) * 2015-09-25 2015-12-30 北京北信源软件股份有限公司 Inter-process communication intercepting method and device
CN105204881A (en) * 2014-06-25 2015-12-30 中兴通讯股份有限公司 Method and device for operating J2me application program on Android system
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

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006039206A1 (en) * 2004-09-30 2006-04-13 Citrix Systems, Inc. A method and system for accessing resources
CN102123196A (en) * 2010-12-29 2011-07-13 浙大网新科技股份有限公司 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)
US20150347749A1 (en) * 2014-05-29 2015-12-03 Apple Inc. Consistent extension points to allow an extension to extend functionality of an application to another application
CN105204881A (en) * 2014-06-25 2015-12-30 中兴通讯股份有限公司 Method and device for operating J2me application program on Android system
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

Cited By (1)

* 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

Also Published As

Publication number Publication date
CN110109718B (en) 2023-06-02

Similar Documents

Publication Publication Date Title
CN103327117B (en) Cross-system running method and device for application programs
CN113110941A (en) Managing delivery of code and dependency data using application containers
CN108830720A (en) Intelligent contract operation method, device, system and computer readable storage medium
CN109388766A (en) The method and apparatus of page load
CN108595234A (en) Five application page switching method, device and equipment
KR20140014273A (en) Method and system for dynamically creating and servicing master-slave pairs within and across switch fabrics of a portable computing device
US8938712B2 (en) Cross-platform virtual machine and method
CN110244957A (en) A kind of resource data updating method, apparatus and system
CN112965794B (en) Algorithm calling method, electronic equipment and storage medium
CN108282518A (en) A kind of customer terminal webpage generation method and device
CN110502415A (en) One kind burying a setting method, device and equipment
CN112363913B (en) Parallel test task scheduling optimizing method, device and computing equipment
CN108141378A (en) Suspend mode VDU in VNFD
US9201897B1 (en) Global data storage combining multiple back-end storage devices
CN108363732A (en) A kind of form processing method of multi-user collaborative, device and equipment
CN113204425B (en) Method, device, electronic equipment and storage medium for process management internal thread
CN110109718A (en) A kind of application programming interfaces call method and device
US11681585B2 (en) Data migration for a shared database
CN116562054B (en) Construction method and device of multi-entity collaborative real-time simulation system
CN109240696A (en) A kind of Oftware updating method and device
WO2021097683A1 (en) Android system starting method and apparatus, device, and storage medium
US8146109B2 (en) Version resiliency for a host application and custom code
WO2023064495A1 (en) Adaptive configuration of finite state machines in applications based on user related conditions
CN108804088A (en) Protocol processes method and apparatus
CN110262841A (en) The method and apparatus that a kind of pair of bytecode is enhanced

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