Nothing Special   »   [go: up one dir, main page]

CN106470226A - The Proxy Method of a kind of client and service end mutual message and device - Google Patents

The Proxy Method of a kind of client and service end mutual message and device Download PDF

Info

Publication number
CN106470226A
CN106470226A CN201510509663.0A CN201510509663A CN106470226A CN 106470226 A CN106470226 A CN 106470226A CN 201510509663 A CN201510509663 A CN 201510509663A CN 106470226 A CN106470226 A CN 106470226A
Authority
CN
China
Prior art keywords
message
mutual message
task
client
service end
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510509663.0A
Other languages
Chinese (zh)
Other versions
CN106470226B (en
Inventor
严东华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201510509663.0A priority Critical patent/CN106470226B/en
Publication of CN106470226A publication Critical patent/CN106470226A/en
Application granted granted Critical
Publication of CN106470226B publication Critical patent/CN106470226B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The Proxy Method of a kind of the application client of offer and service end mutual message and device.Methods described includes:After receiving the mutual message that client is interacted with service end, call corresponding interface that described mutual message is processed;When processing the current interface of described mutual message to having multiple tasks, it is that described mutual message determines goal task in the plurality of task;Execute described goal task for described mutual message, to realize the process to described mutual message for the described current interface;After the total interface calling all is processed to described mutual message, forward described mutual message.The application, when realizing multiple function by same interface, can reduce the degree of coupling of code, is easy to subsequent development and maintenance.

Description

The Proxy Method of a kind of client and service end mutual message and device
Technical field
The application is related to communication technical field, the generation of more particularly, to a kind of client and service end mutual message Reason method and apparatus.
Background technology
With the fast development of Internet technology, various applications emerge in an endless stream, in order to meet front end engineer Various demands, the instrument of acting on behalf of of client and service end arises at the historic moment.For example, windows Act on behalf of instrument fiddler, mac acts on behalf of instrument charles etc..
Current various instruments of acting on behalf of often are provided with self-defining interface, to realize specific demand, Such as:Certain script is injected inside the page of user's request.However, being on the increase with demand, The function of realizing by same interface is needed to get more and more, this may result in code coupling, after being unfavorable for Continuous exploitation and maintenance.
Content of the invention
In view of this, the Proxy Method of a kind of the application client of offer and service end mutual message and device.
Specifically, the application is achieved by the following technical solution:
A kind of client and the Proxy Method of service end mutual message, methods described includes:
After receiving the mutual message that client is interacted with service end, call corresponding interface to institute State mutual message to be processed;
When processing the current interface of described mutual message to having multiple tasks, in the plurality of task Determine goal task for described mutual message;
Execute described goal task for described mutual message, to realize described current interface to described interaction The process of message;
After the total interface calling all is processed to described mutual message, forward described mutual message.
Optionally, described is that described mutual message determines goal task in the plurality of task, including:
According to default mapping relations, it is that described mutual message determines corresponding mesh in the plurality of task Mark task.
Optionally, separate between the corresponding the plurality of task of described current interface.
Optionally, described mutual message includes:Client is sent to request message and the service of service end End is sent to the response message of client for described request message.
Optionally, when described mutual message is the request message that client is sent to service end, described turn Sending out mutual message described includes:Described request message is transmitted to service end;
When described mutual message is that service end is directed to the response message that described request message is sent to client, The described mutual message of described forwarding includes:Described response message is transmitted to client.
A kind of client and the agent apparatus of service end mutual message, described device includes:
Interface interchange unit, after receiving the mutual message that client is interacted with service end, calls Corresponding interface is processed to described mutual message;
Task determining unit, when processing the current interface of described mutual message to having multiple tasks, It is that described mutual message determines goal task in the plurality of task;
Task executing units, execute described goal task for described mutual message, described current to realize The process to described mutual message for the interface;
Message retransmission unit, after the total interface calling all is processed to described mutual message, forwards Described mutual message.
Optionally, described task determining unit, with specific reference to default mapping relations, at the plurality of It is that described mutual message determines corresponding goal task in business.
Optionally, separate between the corresponding the plurality of task of described current interface.
Optionally, described mutual message includes:Client is sent to request message and the service of service end End is sent to the response message of client for described request message.
Optionally, when described mutual message is the request message that client is sent to service end, described report Described request message is transmitted to service end by civilian retransmission unit;
When described mutual message is that service end is directed to the response message that described request message is sent to client, Described response message is transmitted to client by described message retransmission unit.
By above description as can be seen that the application is by multiple functional module tasks of same interface, and When the current interface processing mutual message is to having multiple tasks, it is described interaction in the plurality of task Message determines goal task, and executes described goal task for described mutual message, to realize described working as The process to described mutual message for the front port, such that it is able to reduce the degree of coupling of code, is easy to subsequent development And maintenance.
Brief description
Fig. 1 is the generation of a kind of client shown in the application one exemplary embodiment and service end mutual message The schematic flow sheet of reason method.
Fig. 2 is another kind of client shown in the application one exemplary embodiment and service end mutual message The schematic flow sheet of Proxy Method.
Fig. 3 is the generation of a kind of client shown in the application one exemplary embodiment and service end mutual message One hardware structure diagram of reason device place terminal.
Fig. 4 is the generation of a kind of client shown in the application one exemplary embodiment and service end mutual message The structured flowchart of reason device.
Specific embodiment
Here will in detail exemplary embodiment be illustrated, its example is illustrated in the accompanying drawings.Following When description is related to accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represent same or analogous Key element.Embodiment described in following exemplary embodiment does not represent the institute consistent with the application There is embodiment.On the contrary, they be only with such as appended claims in described in detail, the application one The example of a little consistent apparatus and method of aspect.
It is the purpose only merely for description specific embodiment in term used in this application, and be not intended to be limiting The application." a kind of " of singulative used in the application and appended claims, " institute State " and " being somebody's turn to do " be also intended to including most forms, unless context clearly shows that other implications.Also should Work as understanding, term "and/or" used herein refers to and comprises one or more associated to list item Any or all possible combination of purpose.
It will be appreciated that though may be described various using term first, second, third, etc. in the application Information, but these information should not necessarily be limited by these terms.These terms only be used for by same type of information that This distinguishes.For example, in the case of without departing from the application scope, the first information can also be referred to as Two information, similarly, the second information can also be referred to as the first information.Depending on linguistic context, as in this institute Use word " if " can be construed to " and ... when " or " when ... when " or " response In determination ".
Realize the high problem of the code degree of coupling that several functions are led to, the application for by same interface A kind of Proxy Method is provided, refer to Fig. 1, Fig. 1 is the one kind shown in the application one exemplary embodiment The schematic flow sheet of the Proxy Method of client and service end mutual message, described Proxy Method can include Following steps:
Step 101, after receiving the mutual message that client is interacted with service end, calls correspondence Interface described mutual message is processed.
In the present embodiment, after receiving described mutual message, can be according to the class of described mutual message Type calls one or more interface that described mutual message is processed successively.As an example it is assumed that pin To mutual message 1, the interface calling is needed to be interface 1, interface 2 and interface 3, then receiving After stating mutual message 1, first calling interface 1 is processed to described mutual message 1, then can call Interface 2 is processed to described mutual message 1, and last calling interface 3 is carried out to described mutual message 1 Process, and after interface 3 is disposed to described mutual message 1, be considered as completing to described interaction The process of message 1.
In the present embodiment, described mutual message can include:Client is sent to the request report of service end Literary composition and service end are sent to the response message of client for described request message.
Step 102, when processing the current interface of described mutual message to having multiple tasks, described It is that described mutual message determines goal task in multiple tasks.
In the present embodiment, when needing to realize multiple function by some interface, can be by each work( Can module be split so that each functional module task, by executing some task, Ke Yishi Existing corresponding function.Therefore, separate between the multiple tasks of some interface, such that it is able to Solve the code degree of coupling high, the problems such as being unfavorable for subsequent development and safeguard.
Based on abovementioned steps 101, when calling a certain interface that mutual message is processed, can first sentence Whether the disconnected current interface being processed is to should have multiple tasks, if current interface is only to should have one to appoint Business, then can execute this task for described mutual message;If current interface is to should have multiple tasks, Then can be according to the mapping relations of the mutual message pre-setting and goal task, in the plurality of task Determine corresponding goal task for described mutual message.Wherein, described mapping relations can be by developer It is configured according to demand and safeguard.
For example, refer to table 1 it is assumed that interface 1 is to there being three tasks, respectively task A, Task B and task C, task A is used for realizing function A, and task B is used for realizing function B, task C is used for realizing function C, then in this step, can according to the mapping relations pre-setting task A, Goal task is determined for mutual message in task B and task C.
Table 1
Step 103, executes described goal task for described mutual message, to realize described current interface Process to described mutual message.
Based on abovementioned steps 102, when calling a certain interface that mutual message is processed, for described After mutual message determines goal task, execute described goal task, that is, execute this current interface pair The processing procedure of described mutual message.
Taking the citing of abovementioned steps 102 as a example it is assumed that according to the mapping relations pre-setting task A, The goal task determining for mutual message in task B and task C is task B and task C, then exist In this step, execute task B and task C for described mutual message, to realize interface 1 to described The process of mutual message.
Step 104, after the total interface calling all is processed to described mutual message, forwards described Mutual message.
By above description as can be seen that the application is by multiple functional module tasks of same interface, and When the current interface processing mutual message is to having multiple tasks, it is described interaction in the plurality of task Message determines goal task, and executes described goal task for described mutual message, to realize described working as The process to described mutual message for the front port, such that it is able to reduce the degree of coupling of code, is easy to subsequent development And maintenance.
Realize process with reference to what specific embodiment to describe the application.
Fig. 2 is another kind of client shown in the application one exemplary embodiment and service end mutual message The schematic flow sheet of Proxy Method.
Refer to Fig. 2 it is assumed that the request message sending for client needs to call first interface, for The response message that service end sends needs to call second interface, then described Proxy Method can include following walking Suddenly:
Step 201, receives the request message that client is sent to service end.
Step 202, calls first interface that described request message is processed.
Step 203, when first interface is to having multiple tasks, is described asking in the plurality of task Message is asked to determine goal task.
Step 204, in described request message execution step 203 determine described goal task, with Realize the process to described request message for the described first interface.
Step 205, described request message is transmitted to service end.
Step 206, receives the response message that service end is sent to client for described request message.
Step 207, calls second interface that described response message is processed.
Step 208, when second interface is to having multiple tasks, is described sound in the plurality of task Message is answered to determine goal task.
Step 209, in described response message execution step 208 determine described goal task, with Realize the process to described response message for the described second interface.
Step 210, described response message is transmitted to client.
In the embodiment shown in Figure 2, can be using the embodiment of the method shown in aforementioned Fig. 1 to client Mutual message and service end between is processed, and will not be described here.
Corresponding with the embodiment of the Proxy Method of service end mutual message with aforementioned client, the application is also Provide the embodiment of client and the agent apparatus of service end mutual message.
The embodiment of the agent apparatus of the application client and service end mutual message can be applied in terminal. Device embodiment can be realized by software it is also possible to realize by by way of hardware or software and hardware combining. As a example implemented in software, as the device on a logical meaning, it is the processor by its place terminal Computer program instructions corresponding in nonvolatile memory are read and in internal memory, runs formation.From hard For part aspect, as shown in figure 3, the agent apparatus institute for the application client and service end mutual message In a kind of hardware structure diagram of terminal, except the processor shown in Fig. 3, internal memory, network interface and Outside nonvolatile memory, in embodiment device be located terminal generally according to this terminal actual functional capability, Other hardware can also be included, this is repeated no more.
Refer to Fig. 4, Fig. 4 is a kind of client shown in the application one exemplary embodiment and service end The agent apparatus of the structured flowchart of the agent apparatus of mutual message, described client and service end mutual message 300 can include:Interface interchange unit 301, task determining unit 302, task executing units 303 with And message retransmission unit 304.
Wherein, described interface interchange unit 301, is receiving the friendship that client is interacted with service end Mutually after message, call corresponding interface that described mutual message is processed;
Described task determining unit 302, is processing the current interface of described mutual message to should have multiple During business, it is that described mutual message determines goal task in the plurality of task;
Described task executing units 303, execute described goal task for described mutual message, to realize The process to described mutual message for the described current interface;
Described message retransmission unit 304, is all processed to described mutual message in the total interface calling Afterwards, forward described mutual message.
Optionally, described task determining unit 302, with specific reference to default mapping relations, described many It is that described mutual message determines corresponding goal task in individual task.
Optionally, separate between the corresponding the plurality of task of described current interface.
Optionally, described mutual message includes:Client is sent to request message and the service of service end End is sent to the response message of client for described request message.
Optionally, when described mutual message is the request message that client is sent to service end, described report Described request message is transmitted to service end by civilian retransmission unit 304;
When described mutual message is that service end is directed to the response message that described request message is sent to client, Described response message is transmitted to client by described message retransmission unit 304.
In said apparatus, the process of realizing of the function of unit and effect specifically refers to correspondence in said method Step realize process, will not be described here.
For device embodiment, because it corresponds essentially to embodiment of the method, so related part ginseng See that the part of embodiment of the method illustrates.Device embodiment described above is only schematically, The wherein said unit illustrating as separating component can be or may not be physically separate, make For the part that unit shows can be or may not be physical location, you can with positioned at a place, Or can also be distributed on multiple NEs.Can select according to the actual needs part therein or The whole module of person is realizing the purpose of application scheme.Those of ordinary skill in the art are not paying creativeness In the case of work, you can to understand and to implement.
The foregoing is only the preferred embodiment of the application, not in order to limit the application, all this Within the spirit of application and principle, any modification, equivalent substitution and improvement done etc., should be included in Within the scope of the application protection.

Claims (10)

1. the Proxy Method of a kind of client and service end mutual message is it is characterised in that methods described bag Include:
After receiving the mutual message that client is interacted with service end, call corresponding interface to institute State mutual message to be processed;
When processing the current interface of described mutual message to having multiple tasks, in the plurality of task Determine goal task for described mutual message;
Execute described goal task for described mutual message, to realize described current interface to described interaction The process of message;
After the total interface calling all is processed to described mutual message, forward described mutual message.
2. method according to claim 1 is it is characterised in that described be in the plurality of task Described mutual message determines goal task, including:
According to default mapping relations, it is that described mutual message determines corresponding mesh in the plurality of task Mark task.
3. method according to claim 1 it is characterised in that
Separate between the corresponding the plurality of task of described current interface.
4. method according to claim 1 it is characterised in that
Described mutual message includes:Client is sent to the request message of service end and service end is directed to institute State the response message that request message is sent to client.
5. method according to claim 4 it is characterised in that
When described mutual message is the request message that client is sent to service end, the described friendship of described forwarding Mutually message includes:Described request message is transmitted to service end;
When described mutual message is that service end is directed to the response message that described request message is sent to client, The described mutual message of described forwarding includes:Described response message is transmitted to client.
6. the agent apparatus of a kind of client and service end mutual message are it is characterised in that described device bag Include:
Interface interchange unit, after receiving the mutual message that client is interacted with service end, calls Corresponding interface is processed to described mutual message;
Task determining unit, when processing the current interface of described mutual message to having multiple tasks, It is that described mutual message determines goal task in the plurality of task;
Task executing units, execute described goal task for described mutual message, described current to realize The process to described mutual message for the interface;
Message retransmission unit, after the total interface calling all is processed to described mutual message, forwards Described mutual message.
7. device according to claim 6 it is characterised in that
Described task determining unit, with specific reference to default mapping relations, for institute in the plurality of task State mutual message and determine corresponding goal task.
8. device according to claim 6 it is characterised in that
Separate between the corresponding the plurality of task of described current interface.
9. device according to claim 6 it is characterised in that
Described mutual message includes:Client is sent to the request message of service end and service end is directed to institute State the response message that request message is sent to client.
10. device according to claim 9 it is characterised in that
When described mutual message is the request message that client is sent to service end, described message forwards single Described request message is transmitted to service end by unit;
When described mutual message is that service end is directed to the response message that described request message is sent to client, Described response message is transmitted to client by described message retransmission unit.
CN201510509663.0A 2015-08-18 2015-08-18 Agent method and device for message interaction between client and server Active CN106470226B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510509663.0A CN106470226B (en) 2015-08-18 2015-08-18 Agent method and device for message interaction between client and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510509663.0A CN106470226B (en) 2015-08-18 2015-08-18 Agent method and device for message interaction between client and server

Publications (2)

Publication Number Publication Date
CN106470226A true CN106470226A (en) 2017-03-01
CN106470226B CN106470226B (en) 2020-01-03

Family

ID=58213811

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510509663.0A Active CN106470226B (en) 2015-08-18 2015-08-18 Agent method and device for message interaction between client and server

Country Status (1)

Country Link
CN (1) CN106470226B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6606649B1 (en) * 1999-09-28 2003-08-12 Microsoft Corporation Application programming interface functions for supporting an improved message store for hand-held computers
CN101388887A (en) * 2008-10-15 2009-03-18 中兴通讯股份有限公司 Network service processing method and system
CN103345420A (en) * 2013-06-03 2013-10-09 百度在线网络技术(北京)有限公司 Method for massively calling API interfaces, system for massively calling API interfaces and device for massively calling API interfaces
CN103488536A (en) * 2013-09-29 2014-01-01 华为技术有限公司 Task scheduling method and device and operating system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6606649B1 (en) * 1999-09-28 2003-08-12 Microsoft Corporation Application programming interface functions for supporting an improved message store for hand-held computers
CN101388887A (en) * 2008-10-15 2009-03-18 中兴通讯股份有限公司 Network service processing method and system
CN103345420A (en) * 2013-06-03 2013-10-09 百度在线网络技术(北京)有限公司 Method for massively calling API interfaces, system for massively calling API interfaces and device for massively calling API interfaces
CN103488536A (en) * 2013-09-29 2014-01-01 华为技术有限公司 Task scheduling method and device and operating system

Also Published As

Publication number Publication date
CN106470226B (en) 2020-01-03

Similar Documents

Publication Publication Date Title
US11641355B2 (en) Security service for an unmanaged device
CN108540536B (en) Block chain-based network mass service processing method, equipment and storage medium
US9973472B2 (en) Methods and systems for orchestrating physical and virtual switches to enforce security boundaries
WO2021129186A1 (en) File processing method, electronic apparatus, system, and storage medium
WO2018076759A1 (en) Block chain-based multi-chain management method and system, electronic device, and storage medium
JP6091724B2 (en) Link health check method and apparatus
US20210194698A1 (en) Private data processing method, device and medium
JP2018525713A (en) Protection of confidential chat data
CN105550051A (en) Asynchronous processing method and device of business request
US10887261B2 (en) Dynamic attachment delivery in emails for advanced malicious content filtering
CN105939291A (en) Message processing unit and network device
KR20230065226A (en) Web application server, method for handling user request and method for handling intergrated request
US20160226719A1 (en) Network based virtual collaborative problem solving space
US10713279B2 (en) Enhanced replication
JP5961471B2 (en) Output comparison method in multiple information systems
CN106470226A (en) The Proxy Method of a kind of client and service end mutual message and device
CN113347208B (en) Method and apparatus for determining network node
CN115421841A (en) Notification processing method, terminal device, server and computer storage medium
CN105939220A (en) Remote port mirroring realization method and device
US20190065163A1 (en) Partial redundancy elimination with a fixed number of temporaries
US20180367326A1 (en) Automatic connection switching for meeting room management devices
CN108055337A (en) The method and apparatus that multiple service platform docks public platform
JP2014164571A (en) Virtual desktop system, server device, client device, input method and program
EP2513780A1 (en) Modifying computer management request
CN112988426A (en) Message processing method and device

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200923

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200923

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Ltd.