CN112217711B - Method and system for calling local function by WeChat client - Google Patents
Method and system for calling local function by WeChat client Download PDFInfo
- Publication number
- CN112217711B CN112217711B CN202010960123.5A CN202010960123A CN112217711B CN 112217711 B CN112217711 B CN 112217711B CN 202010960123 A CN202010960123 A CN 202010960123A CN 112217711 B CN112217711 B CN 112217711B
- Authority
- CN
- China
- Prior art keywords
- function
- wechat client
- client
- intermediary server
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/04—Real-time or near real-time messaging, e.g. instant messaging [IM]
- H04L51/046—Interoperability with other network applications or services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/133—Protocols for remote procedure calls [RPC]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Telephonic Communication Services (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention relates to a method for calling local functions by a WeChat client, which comprises the following steps: when the WeChat client serves as a client of a Web system or WeChat application and needs to call functions provided by a local function component of a computing device where the WeChat client operates, the WeChat client submits a function call request to an intermediary server, and then the intermediary server transmits the function call request to the function component, or the function component obtains the function call request submitted by the WeChat client from the intermediary server; after the function component obtains the function call request submitted by the WeChat client and completes function processing, the processing result is returned to the intermediary server; the intermediary server returns the processing result to the wechat client, or the wechat client obtains the calling processing result from the intermediary server. The system based on the method comprises the WeChat client, the functional component local to the computing device where the WeChat client operates and the intermediary server.
Description
Technical Field
The invention belongs to the technical field of information, and particularly relates to a method and a system for calling a local function by a WeChat client.
Background
The wechat is a common social software for people, and a wechat client running on a user side (such as a user computer and a user mobile terminal) is often used as a client (program) of other network applications besides a social function of chatting and the like, for example, the wechat client can be used as a browser to access a Web system (a Web site or a Web application system) through a built-in browser function, and can be used as a client (program) to interact with a server of wechat public signals and wechat applet applications. However, the wechat client has a certain functional limitation as a client of a Web system, wechat public number, and wechat applet, and it cannot directly call a local functional component (such as a data compression functional component, a password functional component, etc.) of a computing device (such as a user computer, a user mobile terminal, etc.) where the wechat client operates, or interact with the local functional component in a network communication manner to call a special function provided by the functional component.
Disclosure of Invention
The invention aims to provide a method and a system for calling functions provided by local function components (modules and programs) by a WeChat client.
Aiming at the aim of the invention, the technical scheme provided by the invention comprises a method for calling the local function by the WeChat client and a corresponding system.
The method for calling the local function by the WeChat client is specifically as follows.
When a WeChat client as a client of a Web system or a WeChat application (such as a WeChat public number and a WeChat applet application) needs to call a function provided by a function component local to a computing device (such as a user computer and a user mobile terminal) where the WeChat client operates, submitting a function call request to an intermediary server (through a network) by the WeChat client, and then transmitting the function call request to the function component by the intermediary server (through the network) or obtaining the function call request submitted by the WeChat client from the intermediary server by the function component (through the network);
the functional component returns a processing result to the intermediary server after obtaining the function calling request submitted by the WeChat client and completing function processing;
the intermediary server returns the processing result to the wechat client, or the wechat client obtains the calling processing result from the intermediary server;
the intermediary server is a system which is used as a data transmission and exchange bridge between the WeChat client and the local functional component of the computing device where the WeChat client operates; the mediating server is the system that the wechat client is allowed to access (in wechat community number, wechat applet applications, systems that the wechat client can allow access to are restricted).
The mode of the WeChat client side for exchanging data (including submitting function calling request and returning processing result) with the function component comprises a session connection mode and a non-session connection mode;
the mode with session connection means that before data exchange is carried out between the WeChat client and the functional component, network session connection is established through an intermediary server, and then data (such as function call request and processing result) is exchanged through session connection;
the session-free connection mode means that before data exchange is carried out between the WeChat client and the functional component, network session connection is not established through the intermediary server, the WeChat client directly submits a function calling request to the intermediary server, and the functional component inquires and requests to acquire the function calling request submitted to the functional component from the intermediary server; after verifying and determining that the functional component is a submission object of the function invocation request submitted by the WeChat client, the intermediary server returns the function invocation request to the functional component; the functional component returns a processing result to the intermediary server after finishing the function processing; the WeChat client requests to acquire a processing result from the intermediary server; and the intermediary server returns the processing result to the WeChat client after verifying that the WeChat client is the return object of the processing result.
The functional component is prompted to be started by the WeChat client when the WeChat client needs to invoke the function of the functional component or has been started (automatically by the computing device or manually by the user) before the WeChat client needs to invoke the function of the functional component.
If the data exchange (including function call request submission and processing result return) between the wechat client and the functional component is a session connection mode, and the functional component is started before the wechat client needs to call the function of the functional component (automatically started by a computing device or manually started by a user), the functional component establishes a session connection with the intermediate server after being started, and maintains the session connection with the intermediate server (the session connection belongs to a part of a complete session connection between the wechat client and the functional component).
If the mode of data exchange (including function call request submission and processing result return) between the WeChat client and the functional component is a mode without session connection, and the functional component is started (automatically by a computing device or manually by a user) before the WeChat client needs to invoke the function of the functional component, the functional component regularly queries the intermediary server whether the function call request submitted to the functional component exists.
On the basis of the method for calling the local function by the WeChat client, a corresponding system for calling the local function by the WeChat client can be constructed, wherein the system comprises the WeChat client, a functional component which is local to a computing device and is used for providing a preset function and an intermediary server, and the WeChat client runs; when the WeChat client as a Web system or a WeChat application client needs to call the function provided by the local function component of the computing device where the WeChat client operates, the WeChat client calls the local function according to the method for calling the local function by the WeChat client and obtains a processing result.
As can be seen from the above description, with the method and system of the present invention, when the wechat client, as a client of the Web system or the wechat application, needs to invoke a function provided by a function component local to the computing device where the wechat client operates, the wechat client may complete component function invocation through an intermediary server and obtain a processing result.
Drawings
FIG. 1 schematic representation of the present invention
Detailed Description
The present invention will be further described with reference to the following examples.
Examples 1,
In this embodiment, when the wechat client needs to call the function provided by the local function component of the computing device (such as a user computer and a user mobile terminal) where the wechat client operates as a client of a Web system or wechat application (such as wechat public number and wechat applet application), the wechat client and the function component establish a network session connection through an intermediary server, and then the wechat client submits a function call request to the intermediary server through the session connection, and the intermediary server transmits the function call request to the function component through the session connection; after the functional component obtains the function call request submitted by the WeChat client and completes function processing, the functional component returns a processing result to the intermediary server through session connection; the intermediary server returns the processing result to the WeChat client through the session connection.
Establishing session connection between the wechat client and the functional component through the intermediary server is similar to establishing session connection between programs respectively located in two different computing devices through an intermediary system, and many mature schemes exist, and are not described herein again.
The function component is prompted by the wechat client to start when the wechat client needs to invoke the function of the function component or has started (automatically by the computing device or manually by the user) before the wechat client needs to invoke the function of the function component.
In this embodiment, if the functional component is initiated (either automatically by the computing device or manually by the user) before the WeChat client needs to invoke the function of the functional component, the functional component establishes a session connection with the intermediary server upon initiation and maintains a session connection with the intermediary server (this session connection is part of the full session connection between the WeChat client and the functional component).
Examples 2,
In this embodiment, when the wechat client needs to call the function provided by the local function component of the computing device (such as a user computer and a user mobile terminal) where the wechat client operates as a client of a Web system or wechat application (such as wechat public number and wechat applet application), the wechat client does not establish a network session connection with the function component, but the wechat client directly submits a function call request to the intermediary server, and the function component queries and requests to obtain the function call request submitted to itself from the intermediary server; after verifying and determining that the functional component is a submission object of the function invocation request submitted by the WeChat client, the intermediary server returns the function invocation request to the functional component; the functional component returns the processing result to the intermediary server after finishing the function processing; the WeChat client requests to acquire a processing result from the intermediary server; and the intermediary server returns the processing result to the WeChat client after verifying that the WeChat client is the return object of the processing result.
The WeChat client and the functional component exchange data through the intermediary server in a session-free manner, which is similar to the way that programs respectively located in two different computing devices exchange data through an intermediary system in a session-free manner, and a mature scheme exists, and is not described herein again.
The functional component is prompted by the wechat client to start when the wechat client needs to invoke the function of the functional component or has already started (automatically by the computing device or manually by the user) before the wechat client needs to invoke the function of the functional component.
In this embodiment, if the functional component is started (automatically by the computing device or manually by the user) before the WeChat client needs to invoke the function of the functional component, the functional component periodically queries the broker server whether there is a function invocation request submitted to the functional component.
On the basis of the method for calling the local function by the WeChat client, a system for implementing the corresponding calling of the local function by the WeChat client can be constructed, wherein the system comprises the WeChat client, a functional component which is local to a computing device and is used for providing a preset function and an intermediary server, and the WeChat client runs on the computing device; when a wechat client is used as a client of a Web system or wechat application and needs to call functions provided by local function components of a computing device where the wechat client operates, the wechat client, the function components and the intermediary server call the local functions by implementing the method for calling the local functions by the wechat client, which comprises the steps of implementing embodiments 1 and 2, completing the call of the function components and obtaining a processing result.
Other specific technical implementations not described are well known to those skilled in the relevant art and will be apparent to those skilled in the relevant art.
Claims (6)
1. A method for calling local function by WeChat client, the WeChat client as the client of Web or WeChat application and the service end of Web or WeChat application together form a Web or WeChat application system to provide Web or WeChat application function for users, the Web or WeChat application refers to Web application or WeChat application, its characteristic is:
when the WeChat client is used as a Web or WeChat application client and needs to call the function provided by a local function component of a computing device where the WeChat client operates in the process of interacting with the Web or WeChat application server and providing the Web or WeChat application function, the WeChat client submits a function call request to an intermediary server, and then the intermediary server transmits the function call request to the function component, or the function component obtains the function call request submitted by the WeChat client from the intermediary server;
the functional component returns a processing result to the intermediary server after obtaining the function call request submitted by the WeChat client and completing the function processing;
the intermediary server returns the processing result to the WeChat client, or the WeChat client obtains the calling processing result from the intermediary server;
the functional component is a program or a program module which can exchange data with the intermediary server in a communication mode and provide function online calling; the intermediary server is a system which runs outside the computing device where the WeChat client runs; the server side of the Web or WeChat application and the intermediary server are two different systems; the intermediary server is a system which is used as a data online transmission and exchange bridge between the WeChat client and the local functional component of the computing device where the WeChat client operates in the process of calling the functional component online by the WeChat client; the intermediary server is a system which is allowed to be accessed by the WeChat client;
the function called by the WeChat client through the intermediary server calling function component is the function of the function component expected to be called when the WeChat client is used as the client of the Web or WeChat application and is originally expected to directly call the local function component but cannot directly call the local function component in the interaction process of the client of the Web or WeChat application and the service end of the Web or WeChat application when the intermediary server is not available, and the function of the function component expected to be called when the client is originally expected to interactively call the function component through the network communication mode and the local function component but cannot interactively call the function component through the network communication mode.
2. The method for the WeChat client to call the local function according to claim 1, wherein:
the mode of the WeChat client for data exchange with the functional component comprises a session connection mode and a non-session connection mode;
the mode with session connection means that before data exchange is carried out between the WeChat client and the functional component, network session connection is established through an intermediary server, and then data exchange is carried out through session connection;
the session-free connection mode means that before data exchange is carried out between the WeChat client and the functional component, network session connection is not established through the intermediary server, the WeChat client directly submits a function calling request to the intermediary server, and the functional component inquires and requests to acquire the function calling request submitted to the functional component from the intermediary server; after verifying and determining that the functional component is a submission object of the function calling request submitted by the WeChat client, the intermediary server returns the function calling request to the functional component; the functional component returns a processing result to the intermediary server after finishing the function processing; the WeChat client requests to acquire a processing result from the intermediary server; and the intermediary server returns the processing result to the WeChat client after verifying that the WeChat client is the return object of the processing result.
3. The method for calling the local function by the WeChat client according to claim 2, characterized in that:
when the WeChat client needs to call the function of the functional component, the functional component is prompted by the WeChat client to start by a user or started before the WeChat client needs to call the function of the functional component.
4. The method for calling the local function by the WeChat client according to claim 3, characterized in that:
if the mode of data exchange between the WeChat client and the functional component is a mode of session connection and the functional component is started before the WeChat client needs to call the function of the functional component, the functional component establishes session connection with the intermediary server after being started and keeps the session connection with the intermediary server.
5. The method for calling the local function by the WeChat client according to claim 3, wherein:
if the mode of data exchange between the WeChat client and the functional component is a mode without session connection and the functional component is started before the WeChat client needs to call the function of the functional component, the functional component regularly inquires whether a function call request submitted to the functional component exists in the intermediate server.
6. A system for calling local functions by a WeChat client based on the method for calling local functions by the WeChat client as claimed in any one of claims 1-5, characterized in that:
the system comprises a WeChat client, a functional component and an intermediary server, wherein the functional component is local to a computing device where the WeChat client operates and provides a preset function; when the WeChat client as a client of Web or WeChat application needs to call the function provided by the local function component of the computing device where the WeChat client operates, the WeChat client completes the call of the function component according to the method for calling the local function by the WeChat client and obtains a processing result.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010960123.5A CN112217711B (en) | 2020-09-14 | 2020-09-14 | Method and system for calling local function by WeChat client |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010960123.5A CN112217711B (en) | 2020-09-14 | 2020-09-14 | Method and system for calling local function by WeChat client |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112217711A CN112217711A (en) | 2021-01-12 |
CN112217711B true CN112217711B (en) | 2022-10-18 |
Family
ID=74050266
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010960123.5A Active CN112217711B (en) | 2020-09-14 | 2020-09-14 | Method and system for calling local function by WeChat client |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112217711B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110290055A (en) * | 2019-06-25 | 2019-09-27 | 携程计算机技术(上海)有限公司 | The communication means and system of wechat small routine WebView and primary component |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104077179B (en) * | 2014-06-16 | 2017-06-06 | 武汉理工大学 | A kind of local API Calls method of web oriented browser |
CN104158856B (en) * | 2014-07-23 | 2017-05-24 | 武汉理工大学 | Local API calling method dispense with preset of secure session |
US10528759B2 (en) * | 2017-10-17 | 2020-01-07 | Aagey Holding, LLC | Application programming interface bridge for transporting a local request from a local client system to a target server system, and method thereof |
CN108664342A (en) * | 2018-04-28 | 2018-10-16 | 广州市百果园信息技术有限公司 | Extend method, system and storage medium based on WEB specification small routine operational capabilities |
CN109947582A (en) * | 2019-03-29 | 2019-06-28 | 深圳市永兴元科技股份有限公司 | The exchange method of browser and local application, equipment and readable storage medium storing program for executing |
-
2020
- 2020-09-14 CN CN202010960123.5A patent/CN112217711B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110290055A (en) * | 2019-06-25 | 2019-09-27 | 携程计算机技术(上海)有限公司 | The communication means and system of wechat small routine WebView and primary component |
Also Published As
Publication number | Publication date |
---|---|
CN112217711A (en) | 2021-01-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6643690B2 (en) | Apparatus and method for determining a program neighborhood for a client node in a client-server network | |
CN1717913B (en) | Relay server, relay server service management method, service providing system | |
CN104102537B (en) | A kind of application call method and user terminal | |
US7995506B2 (en) | System and method for integrating information services through cellular network | |
CN101400109B (en) | General service opening interface system and general service opening method | |
CN102710640A (en) | Authorization requesting method, device and system | |
EP2039123A2 (en) | Remotely updating a user status on a presence server | |
CN102769709A (en) | Method and device for supplying service contact information to users | |
CN106357654B (en) | Remote procedure calling method, device and communication system | |
CN111787524B (en) | Internet of things equipment call control method, device and system | |
CN112217711B (en) | Method and system for calling local function by WeChat client | |
CN102148869B (en) | Method and device for JAVA application to transfer information to local | |
CN113726731A (en) | Method and system for realizing real-time communication between terminal APP and server based on TCP | |
KR100798951B1 (en) | Mobile connection broker | |
CN107332891B (en) | HTTP request processing method, server and client | |
KR100711330B1 (en) | Method and apparatus for providing mobile station information management using of access information management system | |
CN108900636B (en) | Transaction data processing method and platform | |
CN114363417A (en) | Optimization design method for service interface concurrent call between systems | |
KR19980067068A (en) | How to run internet phone using web | |
CN117667024A (en) | Service processing method and device and electronic equipment | |
KR100596396B1 (en) | System for account management using open API based on web services | |
CN114357422A (en) | Platform integration login and management based implementation method | |
CN105245512A (en) | Unidirectional file transmission method and server for implementing transmission method | |
CN115734225A (en) | Intelligent gateway access management method and device, intelligent gateway and terminal equipment | |
JPH07162480A (en) | Communication connecting method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20211022 Address after: Room 401a, building 4, yard 7, Shangdi 8th Street, Haidian District, Beijing 100085 Applicant after: ITRUSCHINA Co.,Ltd. Address before: 430070 Hubei Province, Wuhan city Hongshan District Luoshi Road No. 122 Applicant before: WUHAN University OF TECHNOLOGY |
|
GR01 | Patent grant | ||
GR01 | Patent grant |