An application calling system, method, device and electronic equipment
By working together with the Web page module, the middleware module, and the local service module, the problems of memory waste and low efficiency in calling applications from web pages are solved, and more efficient application calls are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-16
- Publication Date
- 2026-03-31
AI Technical Summary
During the process of calling an application from a webpage, repeatedly creating and destroying local service connections and control processes leads to memory waste and inefficiency.
The architecture consists of a web page module, a middleware module, and a local service module. The middleware module determines the existence of service connections and control processes, and creates a call window only when necessary. Multiple web pages share the local service connection and control process.
It reduces the waiting time for web pages to call applications, lowers memory usage, and improves the efficiency of web application calls.
Smart Images

Figure CN114675984B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet application technology, and in particular to an application invocation system, method, apparatus and electronic device. Background Technology
[0002] When users browse web pages, there are often situations where they need to call applications from the server. For example, when performing operations such as video previewing or playback on a webpage, it is necessary to call the relevant application used to play the video. Calling an application requires first creating a local service connection, and then destroying the previously created local service connection after the call is complete.
[0003] In existing technologies, after a local service connection is established and a webpage calls an application, the called application creates a related window. For example, when previewing or playing a video, after calling the application for playing the video, a window needs to be created to play the video. Creating this window requires the use of a control process for interaction; for instance, creating a window for playing a video requires a playback control process.
[0004] As mentioned above, the local service connection is destroyed after the application call is completed. However, when multiple web pages call the application, the corresponding control process is also repeatedly created and destroyed as the local service connection is repeatedly created and destroyed. When the user needs to switch between multiple web pages, multiple local service connections and corresponding control processes are repeatedly created and destroyed. This not only consumes a lot of memory and wastes memory resources, but also causes inefficiency in web page application calls. Summary of the Invention
[0005] The purpose of this application is to provide an application invocation system, method, apparatus, and electronic device to improve the efficiency of webpage-based application invocation. The specific technical solution is as follows:
[0006] In a first aspect, embodiments of this application provide an application invocation system, including:
[0007] Web page module, middleware module, and local service module;
[0008] The Web page module is used to send a call request to the middleware module, indicating that the first application is invoked through the first webpage;
[0009] The intermediate layer module is used to respond to the call request by sending a request to the local service module to create a call window for the first application, provided that a local service connection for the Web page module has been established, a control process for the Web page module exists, and a window corresponding to the first webpage does not exist.
[0010] The local service module is used to respond to the creation request, create a call window for the first application based on the control process, and send the call window of the first application to the middleware module.
[0011] The intermediate layer module is also used to send the call window of the first application to the Web page module;
[0012] The Web page module is also used to load the call window of the first application in the first web page.
[0013] In one embodiment of this application, the intermediate layer module is specifically used for:
[0014] In response to the call request, determine whether a local service connection for the Web page module has been established;
[0015] If a local service connection for the Web page module has been established, determine whether a control process for the Web page module exists.
[0016] If a control process exists for the Web page module, then determine whether a window corresponding to the first webpage exists;
[0017] If the window corresponding to the first webpage does not exist, a request to create the calling window of the first application is sent to the local service module.
[0018] In one embodiment of this application, the intermediate layer module is further configured to: switch the currently used window to the window corresponding to the first webpage when there is a window corresponding to the first webpage and the window corresponding to the first webpage is not the currently used window; and send the call request to the local service module when there is a window corresponding to the first webpage and the window corresponding to the first webpage is the currently used window.
[0019] The local service module is also used to execute the operation of calling the first application corresponding to the call request, and to send the call result of the first application to the Web page module using the control process;
[0020] The Web page module is also used to display the call result of the first application in the first web page using the call window.
[0021] In one embodiment of this application, the intermediate layer module is further configured to: call the local service module to create a local service connection for the Web page module when no local service connection for the Web page module is established; and send a first message indicating successful connection to the Web page module when the local service connection for the Web page module is successfully created.
[0022] The Web page module is further configured to obtain a local service instance based on the first message, wherein the local service instance is used to call the local service of the local service module.
[0023] In one embodiment of this application, the invocation request includes the webpage identifier of the first webpage;
[0024] The intermediate layer module is also used to store the correspondence between the webpage identifier of the first webpage and the calling window of the first application;
[0025] The intermediate layer module is specifically used to determine that a window corresponding to the first webpage exists when the corresponding relationship contains a calling window corresponding to the webpage identifier of the first webpage.
[0026] In one embodiment of this application, the intermediate layer module is further configured to: in the absence of a control process for the Web page module, invoke the local service module to create a control process for the Web page module.
[0027] In one embodiment of this application, the intermediate layer module is further configured to: after receiving a message indicating that the first webpage is closed, delete the correspondence between the first webpage and the calling window of the first application from the correspondence.
[0028] Secondly, embodiments of this application also provide an application invocation method, the method comprising:
[0029] Retrieve the call request indicating that the Web page module invokes the first application through the first webpage;
[0030] In response to the call request, if a local service connection for the Web page module has been established, a control process for the Web page module exists, and a window corresponding to the first webpage does not exist, the local service controls the creation of a call window for the first application based on the control process.
[0031] The call window of the first application is returned to the Web page module, so that the Web page module can load the call window of the first application using the first webpage.
[0032] In one embodiment of this application, the step of responding to the invocation request by controlling the local service to create an invocation window for the first application based on the control process, when a local service connection for the web page module has been established, a control process for the web page module has been established, and a window corresponding to the first webpage does not exist, includes:
[0033] In response to the call request, determine whether a local service connection for the Web page module has been established;
[0034] If a local service connection for the Web page module has been established, determine whether a control process for the Web page module exists.
[0035] If a control process exists for the Web page module, then determine whether a window corresponding to the first webpage exists;
[0036] If the window corresponding to the first webpage does not exist, a request to create a calling window for the first application is sent to the local service, so that the local service creates a calling window for the first application based on the control process.
[0037] In one embodiment of this application, the method further includes:
[0038] If a window corresponding to the first webpage exists, and the window corresponding to the first webpage is not the currently used window, then switch the currently used window to the window corresponding to the first webpage.
[0039] If a window corresponding to the first webpage exists and is currently in use, the call request is sent to the local service so that the local service performs the operation of calling the first application corresponding to the call request.
[0040] The local service module obtains the call result of the first application sent by the control process, and sends the call result to the web page module so that the web page module displays the call result in the first webpage using the call window.
[0041] In one embodiment of this application, the method further includes:
[0042] If no local service connection is established for the web page module, the local service is invoked to create a local service connection for the web page module;
[0043] If a local service connection to the Web page module is successfully established, a first message indicating a successful connection is sent to the Web page module, so that the Web page module can obtain a local service instance based on the first message, wherein the local service instance is used to call the local service.
[0044] In one embodiment of this application, the method further includes:
[0045] If no control process exists for the web page module, the local service is invoked to create a control process for the web page module.
[0046] In one embodiment of this application, the invocation request includes a webpage identifier of the first webpage; the method further includes:
[0047] Save the correspondence between the webpage identifier of the first webpage and the calling window of the first application;
[0048] If the corresponding window for the webpage identifier of the first webpage exists in the correspondence, it is determined that a window corresponding to the first webpage exists.
[0049] In one embodiment of this application, the method further includes:
[0050] After receiving a message indicating that the first webpage is closed, the correspondence between the first webpage and the calling window of the first application is deleted from the correspondence.
[0051] Thirdly, embodiments of this application also provide an application invocation device, the device comprising:
[0052] The request retrieval module is used to retrieve the call request indicating that the Web page module calls the first application through the first webpage;
[0053] A window creation module is used to respond to the call request and, in the case that a local service connection for the Web page module has been established, a control process for the Web page module exists, and a window corresponding to the first webpage does not exist, control the local service to create a call window for the first application based on the control process.
[0054] The window invocation module is used to return the invocation window of the first application to the Web page module, so that the Web page module can load the invocation window of the first application using the first webpage.
[0055] In one embodiment of this application, the window creation module is specifically used for:
[0056] In response to the call request, determine whether a local service connection for the Web page module has been established;
[0057] If a local service connection for the Web page module has been established, determine whether a control process for the Web page module exists.
[0058] If a control process exists for the Web page module, then determine whether a window corresponding to the first webpage exists;
[0059] If the window corresponding to the first webpage does not exist, a request to create a calling window for the first application is sent to the local service, so that the local service creates a calling window for the first application based on the control process.
[0060] In one embodiment of this application, the apparatus further includes:
[0061] The window switching module is used to switch the currently used window to the window corresponding to the first webpage when there is a window corresponding to the first webpage and the window corresponding to the first webpage is not the window currently in use.
[0062] The operation execution module is used to send the call request to the local service when there is a window corresponding to the first webpage and the window corresponding to the first webpage is the currently used window, so that the local service performs the operation of calling the first application corresponding to the call request;
[0063] The result display module is used to obtain the call result of the first application sent by the local service module using the control process, and send the call result to the web page module so that the web page module displays the call result in the first webpage using the call window.
[0064] In one embodiment of this application, the apparatus further includes:
[0065] The local service connection creation module is used to call the local service to create a local service connection for the web page module when no local service connection for the web page module has been established.
[0066] The local service instance acquisition module is used to send a first message indicating successful connection to the Web page module when a local service connection to the Web page module is successfully established, so that the Web page module can acquire a local service instance based on the first message, wherein the local service instance is used to call the local service.
[0067] In one embodiment of this application, the apparatus further includes:
[0068] The control process creation module is used to call the local service to create a control process for the Web page module when no control process for the Web page module exists.
[0069] In one embodiment of this application, the invocation request includes a webpage identifier of the first webpage; the apparatus further includes:
[0070] The correspondence storage module is used to store the correspondence between the webpage identifier of the first webpage and the calling window of the first application;
[0071] The window determination module is used to determine that a window corresponding to the first webpage exists when the corresponding relationship contains a calling window corresponding to the webpage identifier of the first webpage.
[0072] In one embodiment of this application, the apparatus further includes:
[0073] The mapping deletion module is used to delete the mapping relationship between the first webpage and the calling window of the first application from the mapping relationship after receiving a message indicating that the first webpage is closed.
[0074] Fourthly, embodiments of this application also provide an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0075] Memory, used to store computer programs;
[0076] When a processor executes a program stored in memory, it implements any of the above method steps.
[0077] Fifthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the above-described method steps.
[0078] Beneficial effects of the embodiments in this application:
[0079] The application invocation system provided in this application includes: a Web page module, an intermediate layer module, and a local service module. The Web page module sends an invocation request to the intermediate layer module, indicating that a first application is invoked through a first webpage. The intermediate layer module, in response to the invocation request, sends a request to the local service module to create an invocation window for the first application, provided that a local service connection for the Web page module has been established, a control process for the Web page module exists, and a window corresponding to the first webpage does not exist. The local service module, in response to the creation request, creates an invocation window for the first application based on the control process and sends the invocation window for the first application to the intermediate layer module. The intermediate layer module also sends the invocation window for the first application to the Web page module. The Web page module further loads the invocation window for the first application into the first webpage. By using the intermediate layer module to create an invocation window for the first application using the control process when a local service connection for the Web page module has been established, a control process for the Web page module exists, and a window corresponding to the first webpage does not exist, multiple webpages within the Web page module can share the local service connection, and windows corresponding to multiple webpages can share the control process. When a web page module calls the first application through the first webpage, it only needs to check if the local service connection and control process exist. If they do, the application can be used directly without repeatedly creating and destroying the local service connection and control process. This reduces the waiting time when the webpage calls the application, lowers memory usage and waste, and effectively improves the efficiency of webpage application calls. Of course, implementing any product or method of this application does not necessarily require achieving all of the above advantages simultaneously. Attached Figure Description
[0080] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0081] Figure 1a This application provides a schematic diagram of the structure of an application invocation system.
[0082] Figure 1b An example diagram of an application call system provided in this application embodiment;
[0083] Figure 2 A flowchart illustrating the first application invocation method provided in this application embodiment;
[0084] Figure 3 A flowchart illustrating the second application invocation method provided in this application embodiment;
[0085] Figure 4 A flowchart illustrating the third application invocation method provided in this application embodiment;
[0086] Figure 5 A flowchart illustrating the fourth application invocation method provided in this application embodiment;
[0087] Figure 6 A flowchart illustrating the fifth application invocation method provided in this application embodiment;
[0088] Figure 7 This is a schematic diagram of the structure of an application invocation device provided in an embodiment of this application;
[0089] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0090] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.
[0091] Because the efficiency of webpage-based application invocation is low in the prior art, this application provides an application invocation system, method, apparatus, and electronic device to address this problem.
[0092] The application invocation system provided in this application will be described in detail below through specific embodiments.
[0093] The system of this application embodiment is applied to a smart terminal and can be implemented through a smart terminal. In actual use, the smart terminal can be a computer, server, etc.
[0094] See Figure 1a This application provides a schematic diagram of the structure of an application invocation system, including:
[0095] Web page module, middleware module, and local service module;
[0096] The Web page module is used to send a call request to the middleware module, indicating that the first application is invoked through the first webpage;
[0097] The intermediate layer module is used to respond to the call request by sending a request to the local service module to create a call window for the first application, provided that a local service connection for the Web page module has been established, a control process for the Web page module exists, and a window corresponding to the first webpage does not exist.
[0098] The local service module is used to respond to the creation request, create a call window for the first application based on the control process, and send the call window of the first application to the middleware module.
[0099] The intermediate layer module is also used to send the call window of the first application to the Web page module;
[0100] The Web page module is also used to load the call window of the first application in the first web page.
[0101] In this application embodiment, the Web page module, the middleware module, and the local service module can be different processes in the application calling system; in one example, the application calling system can be an electronic device with Web functionality, such as a camera, a hard disk recorder, or a smartphone.
[0102] For example, taking a camera as an example of an application calling system, the video captured by the user through the camera is stored on a cloud server. While the user is watching the video stored on the cloud server using the camera, a playback webpage (first webpage) can be created within the camera using a web page module. This first webpage then uses an online video player (first application) to play the video from the cloud server. Specifically, the web page module sends a call request to the middleware module, indicating that the online video player is being invoked within the first webpage. In response to this call request, the middleware module, after determining that a local service connection to the web page module has been established, a control process for the web page module exists (e.g., a PlayControl process), and that no window corresponding to the first webpage exists (indicating that the first webpage has not been established), sends a creation request to the local service module. This creation request indicates that the online video player is being created within the first webpage. In response to the creation request, the local service module establishes a call window for the online video player based on the control process for the web page module, and establishes a playback connection between the online video player and the cloud server. The local service module returns the call window of the online video player to the middleware module, which then forwards the call window to the web page module. The web page module loads the call window of the online video player in the first webpage, allowing the online video player to be invoked within the first webpage to play the video from the cloud server.
[0103] In this embodiment, multiple web pages in the Web page module can share a local service connection, and the windows corresponding to multiple web pages can share a control process. When the Web page module calls the first application through the first web page, it only needs to determine whether the local service connection and control process exist. If they exist, they can be used directly without repeatedly creating and destroying the local service connection and control process. This reduces the waiting time when the web page calls the application, reduces memory usage and waste, and thus effectively improves the application calling efficiency of the web page.
[0104] In one embodiment of this application, the intermediate layer module is specifically used for:
[0105] In response to the call request, determine whether a local service connection for the Web page module has been established;
[0106] If a local service connection for the Web page module has been established, determine whether a control process for the Web page module exists.
[0107] If a control process exists for the Web page module, then determine whether a window corresponding to the first webpage exists;
[0108] If the window corresponding to the first webpage does not exist, a request to create the calling window of the first application is sent to the local service module.
[0109] Upon receiving the call request, the middleware module determines whether a local service connection for the Web page module has been established. If a local service connection for the Web page module has been established, it determines whether a control process for the Web page module exists. If no local service connection for the Web page module has been established, a local service connection and control process for the Web page module need to be established.
[0110] When both the local service connection and control process for the Web page module exist, it is determined whether a window corresponding to the first webpage exists. If a window exists, it means the first webpage was previously created and does not need to be recreated. If no window exists, a new window needs to be created. The middleware module sends a request to the local service module to create the application's calling window, so that the local service module can create the application's calling window based on the Web page module's control process. The Web page module then loads the application's calling window into the first webpage, thus completing the creation of the window corresponding to the first webpage.
[0111] In one embodiment of this application, the intermediate layer module is further configured to: switch the currently used window to the window corresponding to the first webpage when there is a window corresponding to the first webpage and the window corresponding to the first webpage is not the currently used window; and send the call request to the local service module when there is a window corresponding to the first webpage and the window corresponding to the first webpage is the currently used window.
[0112] The local service module is also used to execute the operation of calling the first application corresponding to the call request, and to send the call result of the first application to the Web page module using the control process;
[0113] The Web page module is also used to display the call result of the first application in the first web page using the call window.
[0114] To address the scenario where the Web page module can only display one webpage at a time, even if a window corresponding to the first webpage exists, it's necessary to determine if that window is currently in use. If not, the currently used window is adjusted to correspond to the first webpage. If the currently used window is indeed the window corresponding to the first webpage, a call request can be sent to the local service module. The local service module executes the call operation corresponding to the request, uses the control process to obtain the call result of the first application, and sends that result back to the Web page module. The Web page module then controls the call window on the first webpage to display the call result of the first application.
[0115] In one embodiment of this application, the intermediate layer module is further configured to: call the local service module to create a local service connection for the Web page module when no local service connection for the Web page module is established; and send a first message indicating successful connection to the Web page module when the local service connection for the Web page module is successfully created.
[0116] The Web page module is further configured to obtain a local service instance based on the first message, wherein the local service instance is used to call the local service of the local service module.
[0117] If a local service connection for the Web page module is not established, it is necessary to first establish a local service connection for the Web page module. After the connection is established, the middleware module sends a first message indicating that the connection is successful to the Web page module, so that the Web page module can obtain the local service instance based on the first message. After obtaining the local service instance, the Web page module can call the local service in the local service module through the local service instance. This is the purpose of establishing a local service connection.
[0118] In one embodiment of this application, the invocation request includes the webpage identifier of the first webpage;
[0119] The intermediate layer module is also used to store the correspondence between the webpage identifier of the first webpage and the calling window of the first application;
[0120] The intermediate layer module is specifically used to determine that a window corresponding to the first webpage exists when the corresponding relationship contains a calling window corresponding to the webpage identifier of the first webpage.
[0121] For example, let's take a video preview in a multi-page environment as an example. Figure 1b As shown, Figure 1b This diagram illustrates an application flow example for an application invocation system. The web page module initially invokes application A (a video player) via webpage A to preview video. The web page module sends a request to the middleware module to invoke application A. Since no local service connection has been established for the web page module at this point, it first requests the middleware module to create such a connection. The middleware module sends the request to the local service module, which creates and returns the connection. The middleware module then forwards the request to the web page module. Upon receiving the first message indicating a successful local service connection, the web page module retrieves the service instance based on the message and invokes the local service interface to create a playback control process. It also passes the window position object, window width and height, etc., of the window corresponding to webpage A to the local service through the middleware module, requesting the local service to create a window interface based on the playback control process. Since no corresponding control process has been created yet, the middleware module requests the creation of the control process from the local service module. After the local service module creates and returns the control process, it creates window A based on the control process and returns it to the web page module. The web page module then invokes application A and the corresponding window A based on the window interface. Then, the webpage identifier corresponding to the currently used window is stored as the webpage identifier of webpage A, and the correspondence between webpage A and window A is saved.
[0122] If application A, which is called by webpage A, is already running, and the currently used window is window A, and then application B, which is also a video player, needs to be called through webpage B, since windows cannot exist on two webpages simultaneously, the webpage identifier corresponding to the currently used window determines whether window A, which corresponds to application A, is in use. Therefore, window A of application A is first hidden, and then window B, which is called by application B, is opened based on the aforementioned local service connection and playback control process. Simultaneously, the webpage identifier corresponding to the currently used window is modified to the webpage identifier of webpage B, and the correspondence between webpage B and window B is stored. This allows the preview windows of application A (corresponding to webpage A) and application B (corresponding to webpage B) to coexist.
[0123] In one embodiment of this application, the intermediate layer module is further configured to: in the absence of a control process for the Web page module, invoke the local service module to create a control process for the Web page module.
[0124] In one embodiment of this application, the intermediate layer module is further configured to: after receiving a message indicating that the first webpage is closed, delete the correspondence between the first webpage and the calling window of the first application from the correspondence.
[0125] See Figure 2 This application provides a schematic diagram of the first application invocation method in its embodiments, including:
[0126] Step S21: Obtain the call request indicating that the Web page module calls the first application through the first webpage;
[0127] Step S22: In response to the call request, if a local service connection for the Web page module has been established, a control process for the Web page module exists, and a window corresponding to the first webpage does not exist, the local service controls the creation of a call window for the first application based on the control process.
[0128] Step S23: Return the call window of the first application to the Web page module so that the Web page module can load the call window of the first application using the first webpage.
[0129] The aforementioned Web page module is used to load web pages. The first web page is the currently loaded web page, and the first application is the application that the first web page needs to call. For example, when a browser or video playback application needs to load a web page, the Web page module is used to load the web page for the browser or video playback application. The first web page is the web page for video playback, and the first application is the player required to play the video.
[0130] To respond to the call request, a call window for the first application needs to be created and sent to the Web page module. The creation of the call window for the first application needs to be based on the local service of the Web page module and the control process of the Web page module. Each webpage can only have one window.
[0131] Therefore, to respond to this call request, it is necessary to control the local service to create the call window of the first application based on the control process, provided that a local service connection for the Web page module has been established, a control process for the Web page module exists, and a window corresponding to the first webpage does not exist.
[0132] Understandably, once the local service connection and control process for the Web page module are established for the first time, the local service connection and control process can be retained.
[0133] After creating the invocation window for the first application, the invocation window is returned to the Web page module so that the Web page module can load the invocation window for the first application using the first webpage and use the invocation window to complete the invocation of the first application.
[0134] As can be seen from the above, the application invocation method provided in this application, when receiving an invocation request indicating that a Web page module is invoking a first application through a first webpage, if a local service connection for the Web page module has been established, a control process for the Web page module exists, and a window corresponding to the first webpage does not exist, controls the local service to create an invocation window for the first application based on the control process and returns it to the Web page module, so that the Web page module can load the invocation window of the first application using the first webpage. That is, when a local service connection and control process for the Web page module exist, they can be directly used to create an invocation window without repeatedly creating and destroying the local service connection and control process, reducing the waiting time when the webpage invokes the application, reducing memory usage and waste, thereby effectively improving the efficiency of webpage application invocation.
[0135] In one possible implementation, such as Figure 3 The diagram illustrates a second application invocation method in this embodiment. Step S22, in response to the invocation request, involves controlling the local service to create an invocation window for the first application based on the control process, provided that a local service connection for the Web page module has been established, a control process for the Web page module has been established, and a window corresponding to the first webpage does not exist. This includes:
[0136] Step S31: In response to the call request, determine whether a local service connection for the Web page module has been established.
[0137] The Web page module is a client application used by users to load web pages. The first web page is the web page currently loaded by the Web page module, and the first application is the application that the first web page needs to call. For example, the Web page module is a browser or video playback application software. The Web page module is used to load web pages for the browser or video playback application software. The first web page is a web page for video playback, and the first application is a player required to play the video.
[0138] When a web page module needs to call the first application through the first webpage, the web page module sends a call request to the application provider, indicating that it needs to call the first application through the first webpage. At this time, a local service is required to create the connection for the first application to the first webpage. Therefore, the web page module can only call the application if a local service connection is established for it. Thus, before a web page module calls the first application, a local service connection for that web page module must first be established. Therefore, upon receiving a call request from a web page module to call the first application through the first webpage, it is necessary to first determine whether a local service connection for that web page module has been established.
[0139] Understandably, the first webpage is not necessarily the first webpage loaded by the Web page module. Before the first webpage, the Web page module may have loaded multiple webpages and called multiple applications through these webpages. For example, the first webpage might be a webpage playing a video, and the first application might be a video player. Before calling the first application through the first webpage, the Web page module might have called the second application through a second webpage. The second webpage could be a webpage downloading files, and the second application could be a file downloader.
[0140] When a web page module first calls the application via a webpage, a local service is needed to create the application's window. Therefore, the application can only be called via the webpage after a local service connection for the web page module is established. Once the web page module calls the application via the established local service connection for the first time, the local service connection can be maintained. When the web page module calls the first application via the first webpage, the local service connection can still be maintained, indicating that the local service connection has been established.
[0141] If the local service connection has not yet been established, it means that calling the first application through the first webpage is the first time that the webpage module has called the application through a webpage. In this case, it is necessary to establish a local service connection for the webpage module first.
[0142] Step S32: If a local service connection for the Web page module has been established, determine whether a control process for the Web page module exists.
[0143] As mentioned above, after receiving a call request indicating that a web page module is calling a first application through a first webpage, it is necessary to first determine whether a local service connection for that web page module has been established. If it has been established, it means that the web page module can call the first application through the first webpage. Understandably, when a web page module calls the first application, the first application needs to call the window corresponding to the first webpage. For example, if the web page module is a browser, the first webpage is a video playback webpage, and the first application is a video player, then after calling the player, the player will call the playback window of the video to be played.
[0144] The web page module's reliance on the first application's invocation window requires a control process for that web page module. This control process is created after a local service connection to the web page module is established. It interacts with the web page module, for example, receiving invocation requests from the first application's invocation window after the local service connection is established, and then creating the invocation window based on those requests.
[0145] Therefore, after establishing a local service connection for the Web page module, it is also necessary to determine whether a control process exists for that Web page module.
[0146] Similar to the steps for establishing a local service connection described above, calling the first application through the first webpage is not necessarily the first time the webpage module has called the first application. Before the first webpage, the webpage module may have called the first application through multiple webpages. For example, if the first webpage is webpage A that plays a video, and the first application is the player that needs to be called to play the video, the webpage module may have called the player (i.e., the first application) through webpage B that plays the video before the first webpage.
[0147] When a web page module first calls the first application via a webpage, the call can only be made if the control process for that web page module exists. Therefore, after the web page module first calls the application via a webpage based on its created control process, that control process can be retained. When the web page module calls the first application via the first webpage again, the control process can still exist, at which point it can be determined that the control process for that web page module still exists.
[0148] In one embodiment of this application, if no control process exists for the Web page module, the local service is invoked to create a control process for the Web page module.
[0149] If it is determined that the control process for the Web page module does not exist, it means that calling the first application through the first web page is the first time that the Web page module has called the application through a web page. In this case, a control process for the Web page module needs to be established.
[0150] In one example, the control process differs depending on the application invoked by the web page module through the first webpage. For instance, if the first webpage is a video playback webpage and the first application is a video player, the control process is the playback control process, used to create the playback window for the player to invoke the desired video; if the first webpage is a file download webpage and the first application is a file downloader, the control process is the download control process, used to create the download window for the downloader to download the file.
[0151] Therefore, when determining whether a control process exists, it is necessary to determine whether the control process corresponding to the first application exists. That is, if the first application is a media player, the control process to be determined is the playback control process; if only the download control process exists, it should still be determined that the control process does not exist.
[0152] Step S33: If a control process for the Web page module exists, determine whether a window corresponding to the first webpage exists.
[0153] If the control process for the Web page module already exists, it means that calling the first application through the first webpage is not the first time the Web page module has called the application. In this case, the first application can call the window corresponding to the first webpage required by the Web page module based on the existing control process. However, it is still necessary to check whether the window corresponding to the first webpage exists to avoid creating redundant windows. If the window corresponding to the first webpage already exists, further checks are required for that window.
[0154] Step S34: If the window corresponding to the first webpage does not exist, a request to create a calling window for the first application is sent to the local service so that the local service creates a calling window for the first application based on the control process.
[0155] If it is determined that the window corresponding to the first webpage does not exist, a request to create the calling window of the first application is sent to the local service, so that the local service creates the calling window of the first application based on the control process, and overlays the window on the first webpage, that is, the calling window is used to complete the calling of the first application.
[0156] As can be seen from the above, the application invocation method provided in this application, after obtaining the invocation request, first determines whether a local service connection for the Web page module has been established. If the local service connection has been established, it then determines whether a control process for the Web page module exists. This allows multiple web pages to share the local service connection, and the windows corresponding to multiple web pages to share the control process. When the Web page module calls the first application through the first web page, it only needs to determine whether the local service connection and control process exist. If they exist, it can be used directly without repeatedly creating and destroying the local service connection and control process. This reduces the waiting time when the web page calls the application, reduces memory usage and waste, and thus effectively improves the efficiency of web page application invocation.
[0157] When both the local service connection and the control process exist, it is then determined whether a window corresponding to the first webpage exists. If the window does not exist, a request to create the calling window of the first application is sent to the local service so that the local service can create the calling window of the first application based on the control process, thereby avoiding the duplicate creation of the same application window.
[0158] In one embodiment of this application, see [link to embodiment]. Figure 4 The present application provides a flowchart illustrating a third application invocation method in its embodiments. This method includes:
[0159] Step S41: If a window corresponding to the first webpage exists, and the window corresponding to the first webpage is not the currently used window, switch the currently used window to the window corresponding to the first webpage.
[0160] As mentioned above, when the first application can call the window corresponding to the first webpage required by the Web page module based on the existing control process, it is necessary to further check whether the window corresponding to the first webpage exists to avoid creating redundant windows. If the window corresponding to the first webpage already exists, it means that the first webpage called other applications before calling the first application, and the window corresponding to the first webpage called by those applications still exists. At this time, it is necessary to determine whether the window is the currently used window.
[0161] If a window corresponding to the first webpage exists but is not currently in use, it means the web page module has called other applications through other webpages, and those other applications are currently using other windows. In this case, the currently used window is switched to the window corresponding to the first webpage, making it the currently used window.
[0162] Step S42: If a window corresponding to the first webpage exists and the window corresponding to the first webpage is the currently used window, send the call request to the local service so that the local service performs the operation of calling the first application corresponding to the call request.
[0163] If a window corresponding to the first webpage exists and that window is currently in use, or if the currently used window has been switched to the window corresponding to the first webpage, then a call request is sent to the local service so that the local service can perform the operation of calling the first application corresponding to the call request.
[0164] Step S43: Obtain the call result of the first application sent by the local service module using the control process, and send the call result to the web page module so that the web page module displays the call result in the first webpage using the call window.
[0165] The web page module displays the call result in the call window within the first webpage. This can be done by directly calling the first application onto the existing window corresponding to the first webpage, or by overlaying or replacing the window that the first application wants to call onto.
[0166] For example, if the first application is a media player, and the first webpage calls a second application (a downloader) before calling the first application, and the download window is invoked based on the second application, then when the first webpage calls the media player, it needs to call the download window as the playback window. However, the download window is still open at this time; that is, the download window is the window corresponding to the first webpage. After ensuring that the download window (the window corresponding to the first webpage) is the currently used window, the first application (the media player) can be directly invoked on the download window, causing the download window to switch to the playback window. Alternatively, the playback window invoked by the first application can be overlaid on the download window, or the playback window can replace the download window.
[0167] As can be seen from the above, the application invocation method provided in this application, when a window corresponding to a first webpage exists and is not the currently used window, switches the currently used window to the window corresponding to the first webpage. When a window corresponding to the first webpage exists and is used as the currently used window, the Web page module displays the invocation result in the invocation window within the first webpage, thereby avoiding the repeated creation of redundant windows for the same webpage, reducing resource consumption, and improving the efficiency of window invocation.
[0168] In one embodiment of this application, see [link to embodiment]. Figure 5 The present application provides a flowchart illustrating the fourth application invocation method in its embodiments. The method further includes:
[0169] Step S51: If no local service connection for the Web page module is established, call the local service to create a local service connection for the Web page module.
[0170] As mentioned above, when a web page module calls the application for the first time through a webpage, a local service connection for the web page module has not yet been established. In this case, it is necessary to call the local service to create a local service connection for the web page module. The local service is a control that assists the web page module in calling the application through a webpage.
[0171] Step S52: If the local service connection for the Web page module is successfully established, a first message indicating successful connection is sent to the Web page module so that the Web page module can obtain the local service instance based on the first message.
[0172] The local service instance is used to invoke the local service.
[0173] Once a local service connection to the Web page module is successfully established, a first message indicating a successful connection is sent to the Web page module. This allows the Web page module to obtain a local service instance based on the first message and then call the local service based on the local service instance, thereby enabling the application to be called through the webpage.
[0174] After that, upon receiving the call request from the Web page module mentioned above, which invokes the first application through the first webpage, it is determined that the local service connection has been established.
[0175] If the local service connection to the Web page module fails to be established, a message indicating the connection failure is sent to the Web page module, so that the Web page module can be informed of the connection status in a timely manner and check for connection problems.
[0176] If the local service connection is unexpectedly closed after a successful connection, and the Web page module is unaware of this situation and sends a call request to the first application through the first webpage, then a message indicating that the connection is closed is returned to the Web page module, causing the Web page module to resend the connection request to create the local service connection.
[0177] As can be seen from the above, the application invocation method provided in this application, in the absence of a local service connection for the Web page module, first calls a local service to create a local service connection for the Web page module, and after the local service connection for the Web page module is successfully created, sends a first message indicating successful connection to the Web page module, so that the Web page module can obtain a local service instance for calling the server's local service, and can further realize application invocation through a webpage based on the local service instance, thereby improving the success rate of application invocation through a webpage.
[0178] In one embodiment of this application, the above-mentioned invocation request includes the webpage identifier of the first webpage;
[0179] See Figure 6 The present application provides a flowchart illustrating the fifth application invocation method in its embodiments. The method further includes:
[0180] Step S61: Save the correspondence between the webpage identifier of the first webpage and the calling window of the first application;
[0181] Step S62: If a calling window corresponding to the webpage identifier of the first webpage exists in the correspondence, it is determined that a window corresponding to the first webpage exists.
[0182] The correspondence between the first webpage and the first application's calling window can be used to indicate that the currently called window is called by the first webpage and the first application. When a new webpage or a new application needs to call a window, the saved correspondence can be used to determine whether a webpage or application is currently calling a window.
[0183] As mentioned above, before calling the first application through the first webpage, the Web page module can call multiple applications through multiple webpages, and multiple applications can call multiple windows. Therefore, the Web page module's request to call the first application through the first webpage includes the webpage identifier of the first webpage. Then, it can determine whether a window corresponding to the first webpage already exists by querying the stored mapping relationship. Furthermore, after the first webpage loads the calling window of the first application, when saving the mapping relationship between the first webpage and the window, the mapping relationship between the webpage identifier of the first webpage and the window is saved.
[0184] In one embodiment of this application, the webpage identifier corresponding to the currently used window is also saved as the webpage identifier of the first webpage, indicating that the first webpage is currently using the window, and that the window is the calling window of the first application called by the first webpage.
[0185] When a new third application window appears that calls a third webpage, the first application window can be hidden, the currently used window can be switched to the third application window, and the correspondence between the webpage identifier of the third webpage and the third application window can be saved. At the same time, the webpage identifier corresponding to the currently used window can be modified to the webpage identifier of the third webpage, thus identifying the currently used window as the window corresponding to the third webpage.
[0186] In one embodiment of this application, after receiving a message indicating that the first webpage is closed, the correspondence between the first webpage and the calling window of the first application is deleted from the correspondence.
[0187] When the first webpage is closed, the correspondence between the first webpage and the application's launch window is completely deleted.
[0188] As can be seen from the above, the application invocation method provided in this application uses the correspondence between the webpage identifier of the first webpage and the invocation window of the first application to indicate whether the currently used window is the invocation window of the first application. When a request to invoke an application or invocation window from a new webpage is received, the window status corresponding to the first webpage is first determined in a timely manner through the correspondence. This allows the Web page module to switch pages promptly if the new webpage is opened while the window corresponding to the first webpage is in use, thus achieving the coexistence of multiple webpages and their corresponding multiple windows. If the new webpage is opened while the window corresponding to the first webpage is closed, it can load more quickly, improving the efficiency of page switching and loading.
[0189] For example, taking video preview in a multi-page environment as an example, the Web page module first calls application A (a video player) through webpage A to preview the video. The Web page module sends a request to call application A. Since no local service connection has been created for the Web page module at this time, it first requests the creation of a local service connection. The local service creates and returns the connection. After receiving the first message indicating a successful local service connection, the Web page module obtains the service instance based on the message and calls the local service to create a playback control process. It also passes the window position object, window width and height, etc., of the window corresponding to webpage A to the local service, requesting the local service to create a window interface based on the playback control process. Since no corresponding control process has been created at this time, it requests the creation of the control process from the local service. After the local service creates and returns the control process, it creates window A based on the control process and returns it to the Web page module. The Web page module then calls application A to call the corresponding window A based on the window interface. Finally, it stores the webpage identifier corresponding to the currently used window as the webpage identifier of webpage A and saves the correspondence between webpage A and window A.
[0190] If application A, which is called by webpage A, is already running, and the currently used window is window A, and then application B, which is also a video player, needs to be called through webpage B, since windows cannot exist on two webpages simultaneously, the webpage identifier corresponding to the currently used window determines whether window A, which corresponds to application A, is in use. Therefore, window A of application A is first hidden, and then window B, which is called by application B, is opened based on the aforementioned local service connection and playback control process. Simultaneously, the webpage identifier corresponding to the currently used window is modified to the webpage identifier of webpage B, and the correspondence between webpage B and window B is stored. This allows the preview windows of application A (corresponding to webpage A) and application B (corresponding to webpage B) to coexist.
[0191] See Figure 7 This application also provides an application invocation device, the device comprising:
[0192] The request retrieval module 701 is used to retrieve a call request indicating that the Web page module calls the first application through the first webpage;
[0193] Window creation module 702 is used to respond to the call request, and when a local service connection for the Web page module has been established, a control process for the Web page module exists, and a window corresponding to the first webpage does not exist, control the local service to create a call window for the first application based on the control process.
[0194] The window invocation module 703 is used to return the invocation window of the first application to the Web page module, so that the Web page module can load the invocation window of the first application using the first webpage.
[0195] As can be seen from the above, the application invocation device provided in this application, when it receives an invocation request indicating that a Web page module is invoking a first application through a first webpage, and in the case that a local service connection for the Web page module has been established, a control process for the Web page module exists, and a window corresponding to the first webpage does not exist, controls the local service to create an invocation window for the first application based on the control process and returns it to the Web page module, so that the Web page module can load the invocation window of the first application using the first webpage. That is, when a local service connection and a control process for the Web page module exist, they can be directly used to create an invocation window without repeatedly creating and destroying the local service connection and control process, reducing the waiting time when the webpage invokes the application, reducing memory usage and waste, thereby effectively improving the efficiency of webpage application invocation.
[0196] In one embodiment of this application, the window creation module 702 is specifically used for:
[0197] In response to the call request, determine whether a local service connection for the Web page module has been established;
[0198] If a local service connection for the Web page module has been established, determine whether a control process for the Web page module exists.
[0199] If a control process exists for the Web page module, then determine whether a window corresponding to the first webpage exists;
[0200] If the window corresponding to the first webpage does not exist, a request to create a calling window for the first application is sent to the local service, so that the local service creates a calling window for the first application based on the control process.
[0201] As can be seen from the above, the application invocation device provided in this application, after obtaining an invocation request, first determines whether a local service connection for the Web page module has been established. If the local service connection has been established, it then determines whether a control process for the Web page module exists. This allows multiple web pages to share the local service connection, and the windows corresponding to multiple web pages to share the control process. When the Web page module calls the first application through the first web page, it only needs to determine whether the local service connection and control process exist. If they exist, it can be used directly without repeatedly creating and destroying the local service connection and control process. This reduces the waiting time when the web page calls the application, reduces memory usage and waste, and thus effectively improves the efficiency of web page application invocation.
[0202] In one embodiment of this application, the apparatus further includes:
[0203] The window switching module is used to switch the currently used window to the window corresponding to the first webpage when there is a window corresponding to the first webpage and the window corresponding to the first webpage is not the window currently in use.
[0204] The operation execution module is used to send the call request to the local service when there is a window corresponding to the first webpage and the window corresponding to the first webpage is the currently used window, so that the local service performs the operation of calling the first application corresponding to the call request;
[0205] The result display module is used to obtain the call result of the first application sent by the local service module using the control process, and send the call result to the web page module so that the web page module displays the call result in the first webpage using the call window.
[0206] As can be seen from the above, the application invocation device provided in this application, when a window corresponding to a first webpage exists and is not the currently used window, switches the currently used window to the window corresponding to the first webpage. When a window corresponding to the first webpage exists and is used as the currently used window, the Web page module displays the invocation result in the first webpage using the invocation window, thereby avoiding the repeated creation of redundant windows for the same webpage, reducing resource consumption, and improving the efficiency of window invocation.
[0207] In one embodiment of this application, the apparatus further includes:
[0208] The local service connection creation module is used to call the local service to create a local service connection for the web page module when no local service connection for the web page module has been established.
[0209] The local service instance acquisition module is used to send a first message indicating successful connection to the Web page module when a local service connection to the Web page module is successfully established, so that the Web page module can acquire a local service instance based on the first message, wherein the local service instance is used to call the local service.
[0210] As can be seen from the above, the application invocation device provided in this application embodiment, in the absence of establishing a local service connection for the Web page module, first calls the local service to create a local service connection for the Web page module, and after the local service connection for the Web page module is successfully created, sends a first message indicating successful connection to the Web page module, so that the Web page module can obtain the local service instance used to call the local service of the server, and can further realize the application invocation through the web page based on the local service instance, thereby improving the success rate of web page application invocation.
[0211] In one embodiment of this application, the apparatus further includes:
[0212] The control process creation module is used to call the local service to create a control process for the Web page module when no control process for the Web page module exists.
[0213] In one embodiment of this application, the invocation request includes a webpage identifier of the first webpage; the apparatus further includes:
[0214] The correspondence storage module is used to store the correspondence between the webpage identifier of the first webpage and the calling window of the first application;
[0215] The window determination module is used to determine that a window corresponding to the first webpage exists when the corresponding relationship contains a calling window corresponding to the webpage identifier of the first webpage.
[0216] In one embodiment of this application, the apparatus further includes:
[0217] The mapping deletion module is used to delete the mapping relationship between the first webpage and the calling window of the first application from the mapping relationship after receiving a message indicating that the first webpage is closed.
[0218] As can be seen from the above, the application invocation device provided in this application embodiment indicates whether the currently used window is the invocation window of the first application through the correspondence between the webpage identifier of the first webpage and the invocation window of the first application. When a request to invoke an application or invocation window from a new webpage is received, the window status corresponding to the first webpage is first determined in a timely manner through the correspondence. This allows the Web page module to switch pages promptly if the new webpage is opened while the window corresponding to the first webpage is in use, thus achieving the coexistence of multiple webpages and their corresponding multiple windows. If the new webpage is opened while the window corresponding to the first webpage is closed, it can load more quickly, improving the efficiency of page switching and loading.
[0219] This application also provides an electronic device, such as... Figure 8 As shown, it includes a processor 801, a communication interface 802, a memory 803, and a communication bus 804. The processor 801, communication interface 802, and memory 803 communicate with each other via the communication bus 804.
[0220] Memory 803 is used to store computer programs;
[0221] When the processor 801 executes the program stored in the memory 803, it implements any of the above application call method steps.
[0222] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not indicate that there is only one bus or one type of bus.
[0223] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0224] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0225] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0226] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described application invocation methods.
[0227] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the application invocation methods described above.
[0228] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0229] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0230] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, electronic devices, and storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0231] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. An application invocation system, characterized by comprising: The application relates to a web page module, an intermediate layer module and a local service module. The web page module is used for sending a calling request for calling a first application through a first web page to the intermediate layer module. The intermediate layer module is used for sending a creation request of a calling window of the first application to the local service module in the case that a local service connection for the web page module has been established, a control process for the web page module exists and a window corresponding to the first web page does not exist, wherein the local service connection and the control process are kept after the local service connection for the web page module and the control process for the web page module are established. The local service module is used for creating the calling window of the first application based on the control process in response to the creation request, and sending the calling window of the first application to the intermediate layer module. The intermediate layer module is further used for sending the calling window of the first application to the web page module. The web page module is further used for loading the calling window of the first application in the first web page. The intermediate layer module is specifically used for judging whether a local service connection for the web page module has been established in response to the calling request.
2. The system of claim 1, wherein, If the local service connection for the web page module has been established, it is judged whether a control process for the web page module exists. If the control process for the web page module exists, it is judged whether a window corresponding to the first web page exists. If the window corresponding to the first web page does not exist, a creation request of a calling window of the first application is sent to the local service module. The intermediate layer module is further used for switching a currently used window to the window corresponding to the first web page in the case that the window corresponding to the first web page exists and the window corresponding to the first web page is not the currently used window, and sending the calling request to the local service module in the case that the window corresponding to the first web page exists and the window corresponding to the first web page is the currently used window. The local service module is further used for executing an operation of calling the first application corresponding to the calling request, and sending a calling result of the first application to the web page module by using the control process.
3. The system of claim 1 or 2, wherein, The web page module is further used for displaying the calling result of the first application in the first web page by using the calling window. The intermediate layer module is further used for calling the local service module to create a local service connection for the web page module in the case that the local service connection for the web page module has not been established, and sending a first message indicating that the connection is successful to the web page module in the case that the local service connection for the web page module is successfully created. The web page module is further used for obtaining a local service instance from the first message, wherein the local service instance is used for calling a local service of the local service module.
4. The system of claim 2, wherein, 5. The system of claim 1, wherein, The calling request includes a web page identifier of the first web page; The intermediate layer module is further configured to save a correspondence between the web page identifier of the first web page and a calling window of the first application; The intermediate layer module is specifically configured to determine that the window corresponding to the first web page exists when the calling window corresponding to the web page identifier of the first web page exists in the correspondence.
6. The system of claim 1, wherein, The intermediate layer module is further configured to create a control process for the Web page module by invoking the local service module when there is no control process for the Web page module.
7. The system of claim 5, wherein, The intermediate layer module is further configured to delete the correspondence between the first web page and the calling window of the first application from the correspondence after obtaining the message indicating that the first web page is closed.
8. An application calling method characterized by comprising: The method comprises: obtaining a calling request indicating that a Web page module calls a first application through a first web page, wherein the Web page module is included in an application calling system, and the application calling system further includes a local service module; in response to the calling request, controlling the local service module to create a calling window of the first application based on a control process when a local service connection for the Web page module has been established, the control process for the Web page module exists, and a window corresponding to the first web page does not exist, wherein the local service connection and the control process are retained after the local service connection for the Web page module and the control process for the Web page module are established; returning the calling window of the first application to the Web page module, so that the Web page module loads the calling window of the first application by using the first web page.
9. The method of claim 8, wherein, The response to the calling request, controlling the local service module to create a calling window of the first application based on a control process when a local service connection for the Web page module has been established, the control process for the Web page module has been established, and a window corresponding to the first web page does not exist, comprises: in response to the calling request, determining whether a local service connection for the Web page module has been established; if the local service connection for the Web page module has been established, determining whether a control process for the Web page module exists; if the control process for the Web page module exists, determining whether a window corresponding to the first web page exists; if the window corresponding to the first web page does not exist, sending a creation request of a calling window of the first application to the local service module, so that the local service module creates the calling window of the first application based on the control process.
10. The method of claim 8, wherein, The method further comprises: in a case where the window corresponding to the first web page exists and the window corresponding to the first web page is not a currently used window, switching the currently used window to the window corresponding to the first web page; In the presence of the first web page corresponding to the window, and the first web page corresponding to the window is currently being used, the local service module is sent to the calling request, so that the local service module executes the operation of calling the first application corresponding to the calling request; The local service module is obtained, and the calling result of the first application sent by the control process is obtained, and the calling result is sent to the Web page module, so that the Web page module displays the calling result in the first web page by using the calling window.
11. The method of claim 8, wherein, The method further comprises: In the absence of a local service connection for the Web page module, the local service module is called to create a local service connection for the Web page module; In the case of successful creation of a local service connection for the Web page module, a first message indicating a successful connection is sent to the Web page module, so that the Web page module obtains a local service instance according to the first message, wherein the local service instance is used to call the local service of the local service module.
12. The method of claim 8, wherein, The method further comprises: In the absence of a control process for the Web page module, the local service module is called to create a control process for the Web page module.
13. The method of claim 8, wherein, The calling request includes the web page identifier of the first web page; the method further comprises: Save the corresponding relationship between the web page identifier of the first web page and the calling window of the first application; wherein, when the calling window corresponding to the web page identifier of the first web page exists in the corresponding relationship, it is determined that the window corresponding to the first web page exists.
14. The method of claim 13, wherein, The method further comprises: After obtaining the message indicating that the first web page is closed, the corresponding relationship between the first web page and the calling window of the first application is deleted from the corresponding relationship.
15. An application calling apparatus characterized by comprising: The device comprises: The request obtaining module is used to obtain a calling request indicating that the Web page module calls the first application through the first web page, wherein the Web page module is included in the application calling system, and the application calling system further includes a local service module; The window creation module is used to control the local service module to create a calling window of the first application based on the control process in response to the calling request, in the case that the local service connection for the Web page module has been established, and the control process for the Web page module exists, and the window corresponding to the first web page does not exist; wherein, after the local service connection for the Web page module and the control process for the Web page module are established, the local service connection and the control process will be retained; The window calling module is used to return the calling window of the first application to the Web page module, so that the Web page module loads the calling window of the first application by using the first web page.
16. An electronic device, comprising: The device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs. A processor for implementing the steps of the method of any of claims 8-14 when executing a program stored on a memory.
Citation Information
Patent Citations
Web browser and method for calling local application program through web browser
CN104239063A
Method and device for playing video file
CN105792020A