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.