CN106919413A - A kind of method and apparatus that application APP is called by webpage - Google Patents
A kind of method and apparatus that application APP is called by webpage Download PDFInfo
- Publication number
- CN106919413A CN106919413A CN201510999582.3A CN201510999582A CN106919413A CN 106919413 A CN106919413 A CN 106919413A CN 201510999582 A CN201510999582 A CN 201510999582A CN 106919413 A CN106919413 A CN 106919413A
- Authority
- CN
- China
- Prior art keywords
- app
- terminal
- webpage
- program execution
- program
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 68
- 230000004044 response Effects 0.000 claims abstract description 35
- 238000012545 processing Methods 0.000 claims description 16
- 238000012546 transfer Methods 0.000 claims description 7
- 238000004891 communication Methods 0.000 abstract description 5
- 230000006870 function Effects 0.000 description 14
- 238000010586 diagram Methods 0.000 description 12
- 230000008569 process Effects 0.000 description 10
- 238000004590 computer program Methods 0.000 description 7
- 230000006399 behavior Effects 0.000 description 5
- 230000009471 action Effects 0.000 description 3
- 238000001514 detection method Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44568—Immediately runnable code
- G06F9/44584—Portable applications, i.e. making applications self-contained, e.g. U3 standard
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44568—Immediately runnable code
- G06F9/44578—Preparing or optimising for loading
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
A kind of method and apparatus that APP is called by webpage are the embodiment of the invention provides, method therein includes:Webpage in terminal sends the Program execution requests generated according to preset format to the APP in the terminal;The program that webpage in the terminal receives the APP returns performs response.By scheme provided in an embodiment of the present invention, user can directly call corresponding APP in web page browsing by webpage, realize that third-party application is coupled and communication with the direct of webpage, such that it is able to provide the user various services by webpage, greatly improve Consumer's Experience.
Description
Technical Field
The invention relates to the technical field of communication, in particular to a method and a device for calling APP through a webpage.
Background
With the rapid development of internet technology, internet access through various terminals, such as a Personal Computer (PC), a tablet computer (PAD), and a smart phone, has become an indispensable part in people's life.
The terminal user can realize various internet activities such as games, social contact, online shopping, web browsing, information acquisition, file downloading and the like through the terminal. It is the various internet surfing behaviors that bring great convenience to the daily life of users.
At present, a terminal user performs various internet surfing behaviors by accessing a webpage most of the time, the operation behaviors of the user when using the terminal are various, and the following problems often occur:
first, when a user browses a web page, the user wants to perform some operation, such as detecting or killing a terminal device, but the operation cannot be directly performed through the web page.
Secondly, various internet behaviors, various acquired information, various types of accessed web pages, and various unsafe factors, for example, when a user downloads software through a web page, the security of the software cannot be determined, and in this case, the user cannot directly perform some operations through the web page to avoid the unsafe factors.
The problems are caused by the security limitation of the web page, so that some high-authority and high-security services in the system cannot be executed on the web page at the present stage, and a lot of inconvenience is brought to the internet surfing behavior realized by the user through the web page. When the two situations occur, the user often has to interrupt the browsing of the web page and open the application program APP in the terminal that can execute the corresponding service to execute the corresponding operation. Obviously, this method is cumbersome to operate and does not bring about a good user experience.
Disclosure of Invention
In order to solve the problem that some high-permission and high-security services in a system cannot be directly executed on a webpage due to the security limitation of the webpage in the prior art, the embodiment of the invention is expected to provide a method and a device for calling an APP through the webpage.
The embodiment of the invention provides a method for calling an APP (application) through a webpage, which comprises the following steps:
a webpage on a terminal sends a program execution request generated according to a preset format to an APP on the terminal;
and the webpage on the terminal receives the program execution response returned by the APP.
Preferably, the sending, by the terminal, the program execution request generated according to the preset format to the APP on the terminal through the web page includes:
the webpage on the terminal sends a program execution request generated according to a preset format to the APP through a preset port;
the method for receiving the program execution response returned by the APP on the terminal by the webpage on the terminal comprises the following steps:
and the webpage on the terminal receives a program execution response returned by the APP on the terminal through the preset port.
Preferably, the preset format is:
uniform resource locator URL + command parameter;
and the URL comprises the port number of the preset port.
Preferably, the program execution request is a hypertext transfer protocol, HTTP, request.
Preferably, the program execution response is a program processing result after the APP executes the program execution request, or an indication message indicating that the request fails.
The embodiment of the invention provides a method for calling an application program APP through a webpage, which comprises the following steps:
the method comprises the steps that an APP on a terminal receives a program execution request which is sent by a webpage on the terminal and generated according to a preset format;
the APP judges whether to execute the program execution request;
when the APP determines to execute the program execution request, corresponding processing is executed, and a program processing result is generated;
and the APP sends the program processing result to the webpage on the terminal.
Preferably, the receiving, by the APP on the terminal, the program execution request sent by the web page on the terminal includes:
the APP on the terminal receives a program execution request which is sent by a webpage on the terminal and generated according to a preset format through a preset port;
the APP sends the program processing result to the webpage on the terminal, and the program processing result comprises the following steps:
and the APP sends the program processing result to the webpage on the terminal through the preset port.
Preferably, the preset format is:
uniform resource locator URL + command parameter;
and the URL comprises the port number of the preset port.
Preferably, the method further comprises:
when the APP determines not to execute the program execution request, generating an indication message indicating request failure;
and sending the indication message to a webpage on the terminal.
The embodiment of the invention provides a device for calling APP through a webpage, wherein a webpage end positioned on a terminal comprises: the device comprises a first generating module, a first sending module and a first receiving module; wherein,
the first generation module is used for generating a program execution instruction according to a preset format;
the first sending module is configured to send the generated program execution request to the APP on the terminal;
the first receiving module is configured to receive a program execution response returned by the APP.
Preferably, the first sending module is configured to send the generated program execution instruction to the APP on the terminal by:
the first sending module sends a program execution request generated according to a preset format to an APP on the terminal through a preset port;
the first receiving module is configured to receive a program execution response returned by the APP in the following manner:
and receiving a program execution response returned by the APP on the terminal through the preset port.
Preferably, the preset format is:
uniform resource locator URL + command parameter;
and the URL comprises the port number of the preset port.
Preferably, the program execution request is a hypertext transfer protocol, HTTP, request.
Preferably, the program execution response is a program processing result after the APP executes the program execution request, or an indication message indicating that the request fails.
The embodiment of the invention provides a device for calling an application program APP through a webpage, which is positioned at an application program APP end on a terminal and comprises: the device comprises a second receiving module, a judging module, an executing module, a second sending module and a second generating module; wherein,
the second receiving module is used for receiving a program execution request which is sent by a webpage on the terminal and is generated according to a preset format;
the judging module is used for judging whether to execute the program execution request;
the execution module is used for executing corresponding processing when the judgment module determines to execute the program execution request;
the second generation module is used for generating a program processing result;
and the second sending module is used for sending the program processing result to the webpage on the terminal.
Preferably, the second receiving module is configured to receive a program execution request sent by a web page on the terminal by:
receiving a program execution request which is sent by a webpage on the terminal and is generated according to a preset format through a preset port;
the second sending module is used for sending the program processing result to the webpage on the terminal in the following mode:
and sending the program processing result to a webpage on the terminal through the preset port.
Preferably, the preset format is:
uniform resource locator URL + command parameter;
and the URL comprises the port number of the preset port.
Preferably, the second generating module is further configured to generate an indication message indicating that the request fails when the determining module determines not to execute the program execution request;
and the second sending module is used for sending the indication message to a webpage on the terminal.
The embodiment of the invention at least has the following advantages:
according to the method and the device for calling the APP through the webpage, provided by the embodiment of the invention, the terminal sends the program execution request generated according to the preset format to the APP through the webpage, and the terminal receives the program execution response returned by the APP through the webpage, so that the user can directly call the corresponding APP through the webpage in webpage browsing, and the direct connection and communication between the third-party application (namely, the APP) and the webpage are realized, therefore, various services can be provided for the user through the webpage, the complex operation process that the user needs to manually open the corresponding APP in the prior art is avoided, and the user experience is greatly improved.
Drawings
FIG. 1 is a flowchart illustrating a first step of a method for calling an APP through a web page according to a first embodiment of the present invention;
FIG. 2 is a flowchart illustrating a second step of a method for calling an APP through a web page according to a second embodiment of the present invention;
FIG. 3 is a block diagram illustrating a basic structure of an apparatus for calling an APP through a web page according to an embodiment of the present invention;
fig. 4 shows a block diagram of a basic structure of an apparatus for calling an APP through a web page according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Method embodiment one
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a method for calling an APP through a web page of the present invention is shown, which may specifically include:
step 101, a webpage on a terminal sends a program execution request generated according to a preset format to an APP on the terminal;
in this step, the webpage on the terminal sends a program execution request generated according to a preset format to the APP on the terminal through a preset port;
here, it is necessary to determine a network port for the web page and the APP to communicate with each other in advance, and set the port as a preset port. In this way, the webpage can send a program execution request to the APP through the preset port, and the APP can acquire the program execution instruction by monitoring the preset port.
It should be noted that, the web page referred to herein refers to a browser web page on the terminal, and the APP refers to one or more APPs installed on the same terminal or one or more APPs integrated into the browser web page. For example, when a user wishes to perform performance detection on a terminal system, a request can be sent to system performance detection software on the terminal through a webpage, so that the system performance detection software installed on the terminal can be called to perform detection on the terminal performance; in an application scene that a user downloads software through a webpage, the webpage can call software integrated in the webpage, for example, software downloading software and hardware detection software are used for completing downloading of the software, so that before the software is downloaded, whether the software to be downloaded is matched with a terminal or not can be judged through the hardware detection software, and if the software to be downloaded is matched with the terminal, the corresponding software is downloaded through the software downloading software.
Specifically, the preset format is: uniform resource locator URL + command parameter; wherein, the URL comprises the port number of the preset port; the preset format is a preset format which can be recognized and correctly executed by both the webpage and the APP. That is, the terminal sends the program execution instruction generated according to the above-described format to the APP through the web page.
An exemplary program execution instruction is as follows:
https://127.0.0.1:8359/qhapi?client=gameunion&command=alive&callback=jsonp1;
the method comprises the following steps that https://127.0.0.1:8359/qhapi is URL, and the URL comprises a preset port number which a terminal needs to access: 8359; the client & command & alive & callback 1 is a command parameter, which includes three parameters in this example: the method comprises the following steps of client, command and callback, wherein the client represents an identifier of an APP for executing a command, specifically, the identifier of the example APP is gameune, the identifier of the command represents a command to be executed, specifically, the instruction to be executed by the example is alive, the identifier of the callback function of a Java Script (JS) after the command is executed by the callback function is callback function, specifically, the example JS callback function is jsonnp 1, and the parameters are connected by using a connector: are connected. In this example, the symbol "? "is a connector between the URL and the command parameters.
It can be understood by those skilled in the art that, although the above examples only show the case that the command parameters include three parameters, in practical implementation, the command parameters may be set according to needs, and the number and content of the parameters in the command parameters may be set according to needs, which is not limited by the present invention.
In actual implementation, the calling of the APP by the web page may be triggered in various ways, for example, when a user clicks a specific control in the web page, the web page sends a command execution request to the corresponding APP through a preset port, thereby realizing the calling of the corresponding APP; or, the user executes a certain specific operation, and the operation directly triggers the calling of the webpage to the specific APP, so that the corresponding relationship between the user operation and the APP can be preset.
In a preferred embodiment of the present invention, before the terminal sends the program execution request generated according to the preset format to the APP through the web page, the web page may provide a plurality of APP identifiers capable of executing the corresponding program execution request for the user to select, where the APP identifiers may specifically be representative icons of APPs and/or APP names; after the user selects the APP, the webpage sends a program execution request to the corresponding APP, so that the use habits and needs of the user can be better matched, and the user experience is improved.
In step 101, the program execution instruction may be a hypertext transfer protocol HTTP request.
And 102, the webpage on the terminal receives a program execution response returned by the APP.
In this step, the webpage on the terminal receives a program execution response returned by the APP through the preset port. In specific implementation, the terminal continuously monitors the preset port on the webpage, so as to receive a program execution response returned by the APP.
The program execution response including: and the APP executes a program processing result after the program execution request or an indication message indicating that the request fails.
In practical implementation, when the APP agrees to execute the program execution request and is successfully executed, returning a program processing result to the webpage through a preset port; correspondingly, after the webpage receives the program processing result, the information indicating that the program is successfully executed and/or the information which needs to be checked by the user after the program is executed can be displayed to the user through the webpage;
when the APP does not agree to execute the program execution request due to various reasons or the APP agrees to execute the program execution request but an execution failure occurs in the execution process, an indication message indicating a request failure is returned to the webpage through a preset port, at this time, the webpage may show the indication message indicating a request failure to the user, and at the same time, may also show the reason of the request failure to the user, so that the user may determine whether to reinitiate the program execution request or terminate sending the program execution request according to the reason.
Specifically, the APP returns a program execution response to the webpage through the JS function.
In the above scheme, the terminal sends the program execution request generated according to the preset format to the APP through the webpage, the terminal receives the program execution response returned by the APP through the webpage, so that the user can directly call the corresponding APP through the webpage in webpage browsing, the direct connection between the third-party application (namely, the APP) and the webpage is realized, and therefore multiple services can be provided for the user through the webpage, the complex operation process that the user needs to manually open the corresponding APP in the prior art is avoided, and the user experience is greatly improved.
Method embodiment two
Referring to fig. 2, a flowchart illustrating steps of an embodiment of a method for calling an APP through a web page of the present invention is shown, which may specifically include:
step 201, an APP on a terminal receives a program execution request which is sent by a webpage on the terminal and generated according to a preset format;
specifically, the APP on the terminal receives a program execution request, which is sent by a webpage on the terminal and generated according to a preset format, through a preset port; therefore, a communication port between the web page and the APP needs to be negotiated in advance, that is, the preset port, and communication between the web page and the APP is realized through the preset port. Namely, the webpage sends a program execution request to the APP through the preset port; and the APP acquires a program execution request sent by the webpage by monitoring the preset port.
It should be noted that, the web page referred to herein refers to a browser web page on the terminal, and the APP refers to one or more APPs installed on the same terminal or one or more APPs integrated into the browser web page.
Specifically, the preset format is as follows: uniform resource locator URL + command parameter; and the URL comprises the port number of the preset port. The preset format is a preset format which can be recognized and correctly executed by both the webpage and the APP.
An exemplary program execution instruction is as follows:
https://127.0.0.1:8359/qhapi?client=gameunion&command=alive&callback=jsonp1;
the method comprises the following steps that https://127.0.0.1:8359/qhapi is URL, and the URL comprises a preset port number which a terminal needs to access: 8359; the client & command & alive & callback 1 is a command parameter, which includes three parameters in this example: the method comprises the following steps of client, command and callback, wherein the client represents an identifier of an APP for executing a command, specifically, the identifier of the example APP is gameune, the identifier of the command represents a command to be executed, specifically, the instruction to be executed by the example is alive, the identifier of the callback function of a Java Script (JS) after the command is executed by the callback function is callback function, specifically, the example JS callback function is jsonnp 1, and the parameters are connected by using a connector: are connected. In this example, the symbol "? "is a connector between the URL and the command parameters.
It can be understood by those skilled in the art that, although the above examples only show the case that the command parameters include three parameters, in practical implementation, the command parameters may be set according to needs, and the number and content of the parameters in the command parameters may be set according to needs, which is not limited by the present invention.
Step 202, the APP determines whether to execute the program execution request;
in this step, after correctly receiving the program execution request, the APP determines whether to execute the program execution request; specifically, in an actual implementation, the APP determines whether to execute the program execution request by determining the correctness and validity of the program execution request; correctness here means whether the format and parameters of the program execution request are correct or not, and the like; the validity refers to determining whether the user of the webpage sending the program execution request is a valid user using the APP, that is, the identity of the user needs to be verified.
Step 203, when the APP determines to execute the program execution request, executing corresponding processing to generate a program processing result;
specifically, when it is determined in step 202 that the program execution request is executed, the APP executes the processing requested to be executed by the program execution request, and generates a program processing result.
And step 204, the APP sends the program processing result to the webpage on the terminal.
Specifically, the APP sends the program processing result to a webpage on the terminal through the preset port.
In another optional embodiment of the invention, the method further comprises:
when the APP determines not to execute the program execution request, generating an indication message indicating request failure; and sending the indication message to a webpage on the terminal. The determining not to execute the program execution request here includes: the program execution request does not meet correctness and/or legitimacy requirements.
In the above scheme, an APP on a terminal receives a program execution request generated according to a preset format and sent by a webpage on the terminal, and then the APP determines whether to execute the program execution request, executes corresponding processing to generate a program processing result when the APP determines to execute the program execution request, and then the APP sends the program processing result to the webpage on the terminal. The scheme provides a simple and feasible method for calling the APP by the webpage, so that the function which cannot be realized by the webpage is realized by a user conveniently in the webpage browsing process, the diversity of user requirements is met, the complicated step that the user directly and manually executes corresponding processing in the APP is avoided, and the user experience is greatly improved.
Apparatus embodiment one
Referring to fig. 3, a block diagram of a structure of an embodiment of an apparatus for calling APP via a web page according to the present invention is shown, where the apparatus is located at a web page side of a terminal, and includes: a first generation module 31, a first transmission module 32 and a first reception module 33; wherein,
the first generating module 31 is configured to generate a program execution instruction according to a preset format;
the first sending module 32 is configured to send the generated program execution request to the APP on the terminal;
the first receiving module 33 is configured to receive a program execution response returned by the APP.
Specifically, the first sending module 32 is configured to send the generated program execution instruction to the APP on the terminal by:
the first sending module 32 sends a program execution request generated according to a preset format to the APP on the terminal through a preset port;
the first receiving module 33 is configured to receive a program execution response returned by the APP in the following manner:
and receiving a program execution response returned by the APP on the terminal through the preset port.
Specifically, the preset format is as follows:
uniform resource locator URL + command parameter;
and the URL comprises the port number of the preset port.
Specifically, the program execution request is a hypertext transfer protocol HTTP request.
Specifically, the program execution response is a program processing result after the APP executes the program execution request, or an indication message indicating that the request fails.
In a specific implementation process, the first generating module 31, the first sending module 32 and the first receiving module 33 may be implemented by a Central Processing Unit (CPU), a microprocessor Unit (MPU), a Digital Signal Processor (DSP), or a Programmable logic array (FPGA) in the terminal.
Device embodiment II
Referring to fig. 4, a block diagram of an embodiment of an apparatus for calling APP via a web page according to the present invention is shown, where the apparatus is located at an APP end of an application program on a terminal, and includes: a second receiving module 41, a judging module 42, an executing module 43, a second generating module 44 and a second sending module 45; wherein,
the second receiving module 41 is configured to receive a program execution request generated according to a preset format and sent by a web page on the terminal;
the judging module 42 is configured to judge whether to execute the program execution request;
the execution module 43, configured to execute corresponding processing when the determination module determines to execute the program execution request;
the second generating module 44 is configured to generate a program processing result;
the second sending module 45 is configured to send the program processing result to the web page on the terminal.
Specifically, the second receiving module 41 is configured to receive a program execution request sent by a web page on the terminal by:
receiving a program execution request which is sent by a webpage on the terminal and is generated according to a preset format through a preset port;
the second sending module 45 is configured to send the program processing result to the web page on the terminal by:
and sending the program processing result to a webpage on the terminal through the preset port.
Specifically, the preset format is as follows:
uniform resource locator URL + command parameter;
and the URL comprises the port number of the preset port.
Specifically, the second generating module 44 is further configured to generate an indication message indicating that the request fails when the determining module determines not to execute the program execution request;
the second sending module 45 is configured to send the indication message to a web page on the terminal. In a specific implementation process, the second receiving module 41, the determining module 42, the executing module 43, the second generating module 44, and the second sending module 45 may be implemented by a CPU, an MPU, a digital DSP, or an FPGA in the terminal.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The method and the device for calling the APP through the webpage provided by the invention are introduced in detail, a specific example is applied in the method to explain the principle and the implementation mode of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
The invention discloses A1 and a method for calling an application program APP through a webpage, wherein the method comprises the following steps:
a webpage on a terminal sends a program execution request generated according to a preset format to an APP on the terminal;
and the webpage on the terminal receives the program execution response returned by the APP.
A2, the method as in a1, where the terminal sends a program execution request generated according to a preset format to an APP on the terminal through a web page, the method includes:
the webpage on the terminal sends a program execution request generated according to a preset format to the APP through a preset port;
the method for receiving the program execution response returned by the APP on the terminal by the webpage on the terminal comprises the following steps:
and the webpage on the terminal receives a program execution response returned by the APP on the terminal through the preset port.
A3, the method according to A2, wherein the preset format is as follows:
uniform resource locator URL + command parameter;
and the URL comprises the port number of the preset port.
A4, the method of any one of A1-A3, wherein the program execution request is a hypertext transfer protocol (HTTP) request.
A5, the method as in a4, wherein the program execution response is a program processing result after the program execution request is executed by the APP, or an indication message indicating a request failure.
The invention discloses B6 and a method for calling an application program APP through a webpage, wherein the method comprises the following steps:
the method comprises the steps that an APP on a terminal receives a program execution request which is sent by a webpage on the terminal and generated according to a preset format;
the APP judges whether to execute the program execution request;
when the APP determines to execute the program execution request, corresponding processing is executed, and a program processing result is generated;
and the APP sends the program processing result to the webpage on the terminal.
B7, the method according to B6, where the receiving, by the APP on the terminal, the program execution request sent by the web page on the terminal includes:
the APP on the terminal receives a program execution request which is sent by a webpage on the terminal and generated according to a preset format through a preset port;
the APP sends the program processing result to the webpage on the terminal, and the program processing result comprises the following steps:
and the APP sends the program processing result to the webpage on the terminal through the preset port.
B8, the method according to B7, wherein the preset format is:
uniform resource locator URL + command parameter;
and the URL comprises the port number of the preset port.
B9, the method of any one of B6 to B8, further comprising:
when the APP determines not to execute the program execution request, generating an indication message indicating request failure;
and sending the indication message to a webpage on the terminal.
The invention discloses C10, a device for calling an application program APP through a webpage, which is positioned at a webpage end on a terminal, and the device comprises: the device comprises a first generating module, a first sending module and a first receiving module; wherein,
the first generation module is used for generating a program execution instruction according to a preset format;
the first sending module is configured to send the generated program execution request to the APP on the terminal;
the first receiving module is configured to receive a program execution response returned by the APP.
C11, means as in C10, said first sending module for sending said generated program execution instructions to the APP on the terminal by:
the first sending module sends a program execution request generated according to a preset format to an APP on the terminal through a preset port;
the first receiving module is configured to receive a program execution response returned by the APP in the following manner:
and receiving a program execution response returned by the APP on the terminal through the preset port.
C12, the apparatus as in C11, the preset format is:
uniform resource locator URL + command parameter;
and the URL comprises the port number of the preset port.
C13, the device according to any one of C10 to C12, wherein the program execution request is a hypertext transfer protocol, HTTP, request.
C14, the apparatus according to C13, wherein the program execution response is a program processing result after the APP executes the program execution request, or an indication message indicating that the request failed.
The invention discloses D15, a device for calling an application program APP through a webpage, and an application program APP end positioned on a terminal, wherein the device comprises: the device comprises a second receiving module, a judging module, an executing module, a second sending module and a second generating module; wherein,
the second receiving module is used for receiving a program execution request which is sent by a webpage on the terminal and is generated according to a preset format;
the judging module is used for judging whether to execute the program execution request;
the execution module is used for executing corresponding processing when the judgment module determines to execute the program execution request;
the second generation module is used for generating a program processing result;
and the second sending module is used for sending the program processing result to the webpage on the terminal.
D16, the apparatus according to D15, the second receiving module is configured to receive the program execution request sent by the web page on the terminal by:
receiving a program execution request which is sent by a webpage on the terminal and is generated according to a preset format through a preset port;
the second sending module is used for sending the program processing result to the webpage on the terminal in the following mode:
and sending the program processing result to a webpage on the terminal through the preset port.
D17, the apparatus of D16, wherein the predetermined format is:
uniform resource locator URL + command parameter;
and the URL comprises the port number of the preset port.
D18, the apparatus according to any of D15 to D17, the second generating module further configured to generate an indication message indicating a request failure when the determining module determines not to execute the program execution request;
and the second sending module is used for sending the indication message to a webpage on the terminal.
Claims (10)
1. A method for calling an application program (APP) through a webpage is characterized by comprising the following steps:
a webpage on a terminal sends a program execution request generated according to a preset format to an APP on the terminal;
and the webpage on the terminal receives the program execution response returned by the APP.
2. The method of claim 1, wherein the terminal sends a program execution request generated according to a preset format to the APP on the terminal through a web page, and the method includes:
the webpage on the terminal sends a program execution request generated according to a preset format to the APP through a preset port;
the method for receiving the program execution response returned by the APP on the terminal by the webpage on the terminal comprises the following steps:
and the webpage on the terminal receives a program execution response returned by the APP on the terminal through the preset port.
3. The method of claim 2, wherein the predetermined format is:
uniform resource locator URL + command parameter;
and the URL comprises the port number of the preset port.
4. The method according to any one of claims 1 to 3, wherein the program execution request is a hypertext transfer protocol (HTTP) request.
5. The method of claim 4, wherein the program execution response is a program processing result after the APP executes the program execution request or an indication message indicating a request failure.
6. A method for calling an application program (APP) through a webpage is characterized by comprising the following steps:
the method comprises the steps that an APP on a terminal receives a program execution request which is sent by a webpage on the terminal and generated according to a preset format;
the APP judges whether to execute the program execution request;
when the APP determines to execute the program execution request, corresponding processing is executed, and a program processing result is generated;
and the APP sends the program processing result to the webpage on the terminal.
7. The utility model provides a device through webpage call application APP, is located the webpage end on the terminal which characterized in that, the device includes: the device comprises a first generating module, a first sending module and a first receiving module; wherein,
the first generation module is used for generating a program execution instruction according to a preset format;
the first sending module is configured to send the generated program execution request to the APP on the terminal;
the first receiving module is configured to receive a program execution response returned by the APP.
8. The apparatus of claim 7, wherein the first sending module is configured to send the generated program execution instruction to the APP on the terminal by:
the first sending module sends a program execution request generated according to a preset format to an APP on the terminal through a preset port;
the first receiving module is configured to receive a program execution response returned by the APP in the following manner:
and receiving a program execution response returned by the APP on the terminal through the preset port.
9. The utility model provides a device through webpage call application APP, is located the application APP end on the terminal, its characterized in that, the device includes: the device comprises a second receiving module, a judging module, an executing module, a second sending module and a second generating module; wherein,
the second receiving module is used for receiving a program execution request which is sent by a webpage on the terminal and is generated according to a preset format;
the judging module is used for judging whether to execute the program execution request;
the execution module is used for executing corresponding processing when the judgment module determines to execute the program execution request;
the second generation module is used for generating a program processing result;
and the second sending module is used for sending the program processing result to the webpage on the terminal.
10. The apparatus of claim 9, wherein the second receiving module is configured to receive a program execution request sent by a web page on a terminal by:
receiving a program execution request which is sent by a webpage on the terminal and is generated according to a preset format through a preset port;
the second sending module is used for sending the program processing result to the webpage on the terminal in the following mode:
and sending the program processing result to a webpage on the terminal through the preset port.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510999582.3A CN106919413A (en) | 2015-12-25 | 2015-12-25 | A kind of method and apparatus that application APP is called by webpage |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510999582.3A CN106919413A (en) | 2015-12-25 | 2015-12-25 | A kind of method and apparatus that application APP is called by webpage |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106919413A true CN106919413A (en) | 2017-07-04 |
Family
ID=59455022
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510999582.3A Pending CN106919413A (en) | 2015-12-25 | 2015-12-25 | A kind of method and apparatus that application APP is called by webpage |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106919413A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107729482A (en) * | 2017-10-17 | 2018-02-23 | 北京京东尚科信息技术有限公司 | The method and apparatus of collector journal |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102393857A (en) * | 2011-11-01 | 2012-03-28 | 中兴通讯股份有限公司 | Method and system for local call based on web page |
CN102880514A (en) * | 2012-10-26 | 2013-01-16 | 北京小米科技有限责任公司 | Method and device for calling application program |
CN103095783A (en) * | 2011-11-08 | 2013-05-08 | 阿里巴巴集团控股有限公司 | Method and device for web application debugging |
CN103106102A (en) * | 2013-01-14 | 2013-05-15 | 百度在线网络技术(北京)有限公司 | Running method of Web application program and mobile terminal |
CN103279706A (en) * | 2013-06-07 | 2013-09-04 | 北京奇虎科技有限公司 | Method and device for intercepting installation of Android application program in mobile terminal |
CN103853540A (en) * | 2012-12-04 | 2014-06-11 | 腾讯科技(深圳)有限公司 | Method and system for accessing third-party application on operating system desktop |
CN103970760A (en) * | 2013-01-28 | 2014-08-06 | 腾讯科技(深圳)有限公司 | Webpage request handling method and device |
CN104301443A (en) * | 2014-10-09 | 2015-01-21 | 百度在线网络技术(北京)有限公司 | Method and system for calling end capacity ports on web page |
CN104364762A (en) * | 2012-04-10 | 2015-02-18 | 斯波帝范公司 | Systems and methods for controlling a local application through a web page |
CN104375831A (en) * | 2014-11-06 | 2015-02-25 | 北京奇虎科技有限公司 | Method, device and system realizing communication between webpage and applications on terminal equipment |
CN104954404A (en) * | 2014-03-27 | 2015-09-30 | 毛新华 | Web browser mobile phone information synchronization principle and applications |
CN104978176A (en) * | 2014-04-10 | 2015-10-14 | 腾讯科技(北京)有限公司 | Application program interface calling method and device |
-
2015
- 2015-12-25 CN CN201510999582.3A patent/CN106919413A/en active Pending
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102393857A (en) * | 2011-11-01 | 2012-03-28 | 中兴通讯股份有限公司 | Method and system for local call based on web page |
CN103095783A (en) * | 2011-11-08 | 2013-05-08 | 阿里巴巴集团控股有限公司 | Method and device for web application debugging |
CN104364762A (en) * | 2012-04-10 | 2015-02-18 | 斯波帝范公司 | Systems and methods for controlling a local application through a web page |
CN102880514A (en) * | 2012-10-26 | 2013-01-16 | 北京小米科技有限责任公司 | Method and device for calling application program |
CN103853540A (en) * | 2012-12-04 | 2014-06-11 | 腾讯科技(深圳)有限公司 | Method and system for accessing third-party application on operating system desktop |
CN103106102A (en) * | 2013-01-14 | 2013-05-15 | 百度在线网络技术(北京)有限公司 | Running method of Web application program and mobile terminal |
CN103970760A (en) * | 2013-01-28 | 2014-08-06 | 腾讯科技(深圳)有限公司 | Webpage request handling method and device |
CN103279706A (en) * | 2013-06-07 | 2013-09-04 | 北京奇虎科技有限公司 | Method and device for intercepting installation of Android application program in mobile terminal |
CN104954404A (en) * | 2014-03-27 | 2015-09-30 | 毛新华 | Web browser mobile phone information synchronization principle and applications |
CN104978176A (en) * | 2014-04-10 | 2015-10-14 | 腾讯科技(北京)有限公司 | Application program interface calling method and device |
CN104301443A (en) * | 2014-10-09 | 2015-01-21 | 百度在线网络技术(北京)有限公司 | Method and system for calling end capacity ports on web page |
CN104375831A (en) * | 2014-11-06 | 2015-02-25 | 北京奇虎科技有限公司 | Method, device and system realizing communication between webpage and applications on terminal equipment |
WO2016070690A1 (en) * | 2014-11-06 | 2016-05-12 | 北京奇虎科技有限公司 | Method, device and system for realizing communication between application and webpage on terminal device |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107729482A (en) * | 2017-10-17 | 2018-02-23 | 北京京东尚科信息技术有限公司 | The method and apparatus of collector journal |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110708346B (en) | Information processing system and method | |
CN107515764B (en) | Application page opening method, terminal and computer readable storage medium | |
CN109388762B (en) | Application sharing method and device | |
CN110020367B (en) | Page rendering method and device | |
JP6306731B2 (en) | Method, apparatus, and system for pushing an application program, and device | |
WO2016101635A1 (en) | Method, apparatus and device for synchronizing login status, and computer storage medium | |
WO2014180331A1 (en) | Method, device and system for realizing webpage screenshot | |
CN103618606A (en) | App login method verified through short message | |
CN103888408B (en) | Upload the data to method and the device of social platform | |
CN107979573B (en) | Risk information detection method, system and server | |
WO2014008864A1 (en) | Method, apparatus, and system for sharing software among terminals | |
CN104378428B (en) | A kind of method and apparatus for file download | |
CN104811485A (en) | Resource sharing method | |
CN107547468B (en) | Network protocol switching device, method and terminal | |
CN104375831B (en) | Realize the methods, devices and systems of the webpage and inter-application communication on terminal device | |
TWI677223B (en) | Page display method and device | |
CN106357781A (en) | Method and system for establishing resource service calling interface | |
CN112491974B (en) | Remote browsing method, device, storage medium, terminal equipment and server | |
CN111935107B (en) | Identity authentication method, device, system, electronic equipment and storage medium | |
WO2015081716A1 (en) | Method, system, and related device for providing application service | |
CN110855655B (en) | Information verification method, device, equipment and storage medium | |
CN106815006B (en) | Page calling method and device and page management server | |
CN106919413A (en) | A kind of method and apparatus that application APP is called by webpage | |
WO2015003570A1 (en) | Data downloading method,device and system thereof | |
CN111756916A (en) | Application processing method and device, electronic equipment and computer storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170704 |
|
RJ01 | Rejection of invention patent application after publication |