CN105516215A - Asynchronous call method and asynchronous call device - Google Patents

Asynchronous call method and asynchronous call device Download PDF

Info

Publication number
CN105516215A
CN105516215A CN201410488062.1A CN201410488062A CN105516215A CN 105516215 A CN105516215 A CN 105516215A CN 201410488062 A CN201410488062 A CN 201410488062A CN 105516215 A CN105516215 A CN 105516215A
Authority
CN
China
Prior art keywords
layer equipment
call request
identification information
passage
client
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
CN201410488062.1A
Other languages
Chinese (zh)
Other versions
CN105516215B (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.)
Alibaba Group Holding 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 CN201410488062.1A priority Critical patent/CN105516215B/en
Publication of CN105516215A publication Critical patent/CN105516215A/en
Application granted granted Critical
Publication of CN105516215B publication Critical patent/CN105516215B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Computer And Data Communications (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention provides an asynchronous call method and an asynchronous call device. The asynchronous call method comprises the following steps: a server establishes a data stream on a channel connected with a client, and receives a call request sent by the client through the data stream; the server sends data identification information corresponding to the call request to the client and releases resources occupied by the data stream after receiving the call request, wherein different call requests correspond to different data identification information, and the data identification information enables the client to monitor the channel to acquire result data corresponding to the data identification information; and the server processes the call request to get result data, and pushes the result data to the client through the channel. By using the method, the resources of the server are fully utilized, and the throughput capacity of the server is improved.

Description

Asynchronous invoking method and device
Technical field
The application relates to communication technical field, particularly relates to a kind of asynchronous invoking method and device.
Background technology
With smart mobile phone development, the flow of service end is increasing, and the time of service end process business consumption also gets more and more, and therefore, service end bears very large pressure.
In correlation technique, client and service end can based on HTML (Hypertext Markup Language) (Hypertexttransferprotocol, http) agreement communicates, http is request-reply pattern, when client and service end are set up after three-way handshake is connected, client is initiated once to ask to service end, must wait for that the response of service end is returned, could initiate secondary http request.Before service end does not return response, the connection resource between client and service end needs to keep always.
If the business of service end process is very consuming time, so connection resource can keep not being released by serviced end always, can waste service end resource undoubtedly, causes service end throughput lower.
Summary of the invention
The application is intended to solve one of technical problem in correlation technique at least to a certain extent.
For this reason, an object of the application is to propose a kind of asynchronous invoking method, and the method can reduce resource consumption, improves service end throughput.
Another object of the application is to propose a kind of asynchronous call device.
For achieving the above object, the application's first aspect embodiment propose asynchronous invoking method, comprising: service end with newdata stream on the passage of client's side link, and by described in described data stream reception client transmission call request; After described service end receives described call request, the data identification information corresponding with described call request is sent to described client, and discharge the resource that described data flow takies, wherein, the data identification information difference that different call request is corresponding, described data identification information makes described client monitor to obtain result data corresponding to described data identification information to described passage; Described service end processes described call request, obtains result data, and described result data is pushed to described client by described passage.
The asynchronous invoking method that the application's first aspect embodiment proposes, by after distribute data identification information, the resource that release data flow takies, the timely release to service end resource can be realized, avoid the wasting of resources always keeping causing, the resource of this release may be used for providing service for other clients, therefore can reduce the service end wasting of resources, improve service end resource utilization, promote service end throughput.
For achieving the above object, the application's second aspect embodiment propose asynchronous invoking method, comprising: newdata stream on the passage is connected with service end, and by described in described data flow service end transmission call request; Receive the data identification information that described service end is fed back described call request, wherein, described service end discharges the resource that described data flow takies after sending described data identification information to client; Monitor on described passage according to described data identification information, and obtain described service end by described passage send described call request is processed after the result data that obtains.
The asynchronous invoking method that the application's second aspect embodiment proposes, by the call request that data flow service end newly-built on the passage be connected with service end sends, and according to the data identification information received, wherein, service end discharges the resource that described data flow takies after sending described data identification information, the timely release to service end resource can be realized, avoid the wasting of resources always keeping causing, the resource of this release may be used for providing service for other clients, therefore the service end wasting of resources can be reduced, improve service end resource utilization, promote service end throughput.
For achieving the above object, the application's third aspect embodiment propose asynchronous call device, comprising: receiver module, for newdata stream on the passage of client's side link, and by described in described data stream reception client transmission call request; Processing module, after receiving described call request, the data identification information corresponding with described call request is sent to described client, and discharge the resource that described data flow takies, wherein, the data identification information difference that different call request is corresponding, described data identification information makes described client monitor to obtain result data corresponding to described data identification information to described passage; Acquisition module, for processing described call request, obtaining result data, and described result data is pushed to described client by described passage.
The asynchronous call device that the application's third aspect embodiment proposes, by after distribute data identification information, the resource that release data flow takies, the timely release to service end resource can be realized, avoid the wasting of resources always keeping causing, the resource of this release may be used for providing service for other clients, therefore can reduce the service end wasting of resources, improve service end resource utilization, promote service end throughput.
For achieving the above object, the application's fourth aspect embodiment propose asynchronous call device, comprising: sending module, for newdata stream on the passage is connected with service end, and by described in described data flow service end transmission call request; Receiver module, for receiving the data identification information that described service end is fed back described call request, wherein, described service end discharges the resource that described data flow takies after sending described data identification information to client; Acquisition module, for monitoring on described passage according to described data identification information, and obtain described service end by described passage send described call request is processed after the result data that obtains.
The asynchronous call device that the application's fourth aspect embodiment proposes, by the call request that data flow service end newly-built on the passage be connected with service end sends, and according to the data identification information received, wherein, service end discharges the resource that described data flow takies after sending described data identification information, the timely release to service end resource can be realized, avoid the wasting of resources always keeping causing, the resource of this release may be used for providing service for other clients, therefore the service end wasting of resources can be reduced, improve service end resource utilization, promote service end throughput.
The aspect that the application adds and advantage will part provide in the following description, and part will become obvious from the following description, or be recognized by the practice of the application.
Accompanying drawing explanation
The application above-mentioned and/or additional aspect and advantage will become obvious and easy understand from the following description of the accompanying drawings of embodiments, wherein:
Fig. 1 is the schematic flow sheet of the asynchronous invoking method that the application one embodiment proposes;
Fig. 2 is the schematic flow sheet of the asynchronous invoking method that another embodiment of the application proposes;
Fig. 3 is the schematic flow sheet of the asynchronous invoking method that another embodiment of the application proposes;
Fig. 4 is the system configuration schematic diagram that in the embodiment of the present application, Fig. 3 is corresponding;
Fig. 5 is http repeating query process schematic in the embodiment of the present application;
Fig. 6 is spdy invoked procedure schematic diagram in the embodiment of the present application;
Fig. 7 is the schematic flow sheet of the asynchronous invoking method that another embodiment of the application proposes;
Fig. 8 is the structural representation of the asynchronous call device that another embodiment of the application proposes;
Fig. 9 is the structural representation of the asynchronous call device that another embodiment of the application proposes;
Figure 10 is the structural representation of the asynchronous call device that another embodiment of the application proposes;
Figure 11 is the structural representation of the asynchronous call device that another embodiment of the application proposes.
Embodiment
Be described below in detail the embodiment of the application, the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has element that is identical or similar functions from start to finish.Being exemplary below by the embodiment be described with reference to the drawings, only for explaining the application, and the restriction to the application can not being interpreted as.On the contrary, the embodiment of the application comprise fall into attached claims spirit and intension within the scope of all changes, amendment and equivalent.
Fig. 1 is the schematic flow sheet of the asynchronous invoking method that the application one embodiment proposes, and the method comprises:
S11: service end with newdata stream on the passage of client's side link, and by described in described data stream reception client send call request.
The passage of service end and client's side link can be spdy passage or http protocol passage or socket (socket) the long communication channel based on tcp/ip.Wherein, spdy is the application layer protocol based on transmission control protocol (TransmissionControlProtocol, TCP) of Google exploitation.
Data flow (stream) is a kind of tunnel, and this tunnel is positioned at the passage of service end and client's side link, and this data flow can transmit call request.Concrete, data flow can be two-way byte stream, each call request data stream transmitting, different call request different pieces of information flow transmission, data flow can in the passage of service end and client's side link parallel transmission call request.
Call request can be the call request of the application programming interface (ApplicationProgrammingInterface, api) of specifying, and such as, realizes the api of the business operation placed an order in e-commerce system.
S12: after described service end receives described call request, sends the data identification information corresponding with described call request to described client, and discharges the resource that described data flow takies.
Wherein, the data identification information that different call request is corresponding is different.Described client can be monitored to obtain result data corresponding to described data identification information to described passage according to described data identification information.
Wherein, the data identification information that each call request is corresponding unique, accordingly, the result data identical data identification information corresponding to this call request that call request is corresponding.By data identification information, client can listen to result data corresponding to its call request sent.
In correlation technique, before service end returns results to client, the resource that data flow takies is kept always, and this mode can waste service end resource, reduces service end throughput.
And in the present embodiment, service end is after client return data identification information, the resource that the data flow that just release is used for the call request that transmission client sends takies instead of always keep, the resource of release may be used for providing service for other clients, therefore, service end resource utilization can be improved, improve service end throughput.
S13: described service end processes described call request, obtains result data, and described result data is pushed to described client by described passage.
Wherein, after service end receives call request, service corresponding to call request can be obtained from service provider, such as, when doing shopping, call request is the api request obtaining dotey details, so service end can obtain dotey's details the page as a result data return to client.
Concrete, service end, after acquisition result data, adopts the mode of active push that result data is sent to client.Service end, when pushing result data, can also comprise the data identification information corresponding with call request simultaneously, and client can find the result data of its request by this data identification information.
The present embodiment is by after distribute data identification information, the resource that release data flow takies, the timely release to service end resource can be realized, avoid the wasting of resources always keeping causing, the resource of this release may be used for providing service for other clients, therefore can reduce the service end wasting of resources, improve service end resource utilization, promote service end throughput.
Fig. 2 is the schematic flow sheet of the asynchronous invoking method that another embodiment of the application proposes, and the method comprises:
S21: newdata stream on the passage be connected with service end, and by described in described data flow service end send call request.
The executive agent of the present embodiment is client.
Service end specifically can comprise access layer equipment, application layer equipment, service providing device and push server.
The passage of service end and client's side link can be spdy passage or http protocol passage or socket (socket) the long communication channel based on tcp/ip.Wherein, spdy is the application layer protocol based on transmission control protocol (TransmissionControlProtocol, TCP) of Google exploitation.
Data flow (stream) is a kind of tunnel, and this tunnel is positioned at the passage of service end and client's side link, and this data flow can transmit call request.Concrete, data flow can be two-way byte stream, each call request data stream transmitting, different call request different pieces of information flow transmission, data flow can in the passage of service end and client's side link parallel transmission call request.
Call request can be the application programming interface (ApplicationProgrammingInterface of setting, api) call request, such as in e-commerce system, the api of the business operation that the carrying out provided by E-business service supplier places an order.
S22: receive the data identification information that described service end is fed back described call request, wherein, described service end discharges the resource that described data flow takies after sending described data identification information to client.
Wherein, the data identification information that each call request is corresponding unique, accordingly, the result data identical data identification information corresponding to this call request that call request is corresponding.By data identification information, client can monitor result data corresponding to its call request sent.
S23: monitor on described passage according to described data identification information, and obtain described service end by described passage send described call request is processed after the result data that obtains.
Wherein, after service end receives call request, service corresponding to call request can be obtained from service provider, such as, when doing shopping, call request is the api request obtaining dotey details, so service end can obtain dotey's details the page as a result data return to client.
Concrete, service end, after acquisition result data, adopts the mode of active push that result data is sent to client.Service end, when pushing result data, can also comprise the data identification information corresponding with call request simultaneously, and client can find corresponding result data by this data identification information.
After client receives data identification information, initiate the monitoring to passage, whether the result data of monitoring its call request sent corresponding returns, and does follow-up service logic again with this.
Client mainly monitors the result returned, and the result returned can be return data identification information or abnormal results (such as time-out) information.
Further, client carries out page presentation according to described result data after receiving the result data of service end transmission.
The call request that the present embodiment is sent by data flow service end newly-built on the passage be connected with service end, and according to the data identification information received, wherein, service end discharges the resource that described data flow takies after sending described data identification information, the timely release to service end resource can be realized, avoid the wasting of resources always keeping causing, the resource of this release may be used for providing service for other clients, therefore the service end wasting of resources can be reduced, improve service end resource utilization, promote service end throughput.
Fig. 3 is the schematic flow sheet of the asynchronous invoking method that another embodiment of the application proposes, and Fig. 4 is the system configuration schematic diagram that Fig. 3 is corresponding.
See Fig. 4, this system comprises client 41 and service end 42, and service end comprises access layer equipment 421, application layer equipment 422, service providing device 423 and push server 424.Access layer equipment wjas represents, wjas belongs to access layer equipment, is a high performance HTTP and Reverse Proxy; Application layer equipment mtop represents, mtop belongs to application layer equipment, is that a kind of wireless gateway java applies; Service providing device server represents; Push server pushserver represents.
See Fig. 3, be the call request of the application programming interface (ApplicationProgrammingInterface, api) of specifying for call request, the method for the present embodiment comprises:
S301: client sends api call request to the wjas of service end.
Wherein, client and wjas can connect passage in advance, and as shown in Figure 4, this interface channel is for spdy passage.
Client can on spdy passage newdata stream (stream), by this data flow api call request.
Further, the data flow that spdy passage is set up can be unidirectional traffic, and close in client and write, Service supportive end writes data to client.
S302: the wjas of service end when self opens push mode, distribute data identification information, and forwards api call request to described mtop.
Wherein, wjas and mtop can select to open or close (push) pattern of propelling movement, and push mode also can be called asynchronous mode.
Passage between wjas and mtop can be spdy passage or http passage, see Fig. 4, for http passage.
Wjas sends to the identification information and described data identification information that comprise described access layer equipment wjas in the api call request of mtop.
Identification information specifically can comprise the IP address of access layer equipment wjas, protocol number and port numbers.
Data identification information is corresponding with api call request, and each api call request can a unique corresponding data identification information, and data result corresponding to this api call request is too to should data identification information.
After S303:mtop receives api call request, checking whether wjas and mtop opens push pattern, as opened the queue that then api call request joined request, and performing S304.
Wherein, when wjas sends api call request to mtop, the identification information whether wjas opens push pattern can also be comprised in this api call request, know to make mtop whether wjas opens push pattern.In addition, mtop can obtain self whether to open push pattern according to self configuration.
S304:mtop sends the information having accepted api call request for identifying mtop to wjas.
Particularly, the statscode that mtop can return http to wjas is 202, and this coding 202 represents and accepts api call request.Can carry out after mtop accepts api call request carrying out asynchronous call to api call request.
On the other hand, when at least one in wjas and mtop does not open push pattern, normal http request answer-mode can be performed.
Normal http request answer-mode comprises http repeating query and spdy calls, and see Fig. 5,6, respectively illustrates http repeating query, spdy invoked procedure schematic diagram.
After S305:wjas receives the information having accepted api call request for identifying mtop, send the data identification information corresponding with api call request to client, and discharge the resource that data flow takies.
S306: after client receives data identification information, initiates the monitoring to data on the long communication channel of spdy.
Client, when data decryptor, if listening to mark corresponding to data result is the data identification information that self obtains, then can know that this data result will send to self, can obtain this data result afterwards.
On the other hand, mtop receives api call request at S303 and after the queue that joins request, can call, obtain first result corresponding with data identification information according to this api call request; First result and data identification information, according to the identification information of wjas, are sent to wjas by mtop; Wjas, by the first result and data identification information, is pushed to client by passage.
Concrete, the method can also comprise:
S307:mtop obtains api call request from request queue.
S308:mtop calls according to api call request, obtains the first result.
Concrete, mtop can according to api call request, asynchronous call is initiated to service providing device server, asynchronous call can specifically call by High-SpeedServiceFramework, namely hsf calls, afterwards, the first result is returned to mtop by callback after obtaining the first result corresponding to api call request by server.Such as, api call request is the request of request dotey details, then the first result can be the particular content of dotey's details.
First result and data identification information, according to the identification information of the wjas obtained in advance and data identification information, are sent to the wjas that the identification information of wjas is corresponding by S309:mtop.
First result and data identification information are passed through spdy passage by S310:wjas, are pushed to client.
S311: after client listens to data identification information and the first result, when the data identification information that the data identification information monitored obtains in advance with self is consistent, the business corresponding according to this first result treatment.
Such as, the first result is the particular content of dotey's details, then show the particular content of dotey's details to user.
The above-mentioned service end that gives obtains data result according to the api call request of client, and in another embodiment, all right active push data result of service end is to client.The data result of service end active push can be called the second result, and see Fig. 7, the flow process that client obtains the second result can comprise:
S71: described access layer equipment is after setting up described passage with described client, and send log-on message to described push server, described log-on message comprises the identification information of described access layer equipment.
When access layer equipment is wjas, the identification information of access layer equipment specifically can comprise the ip address of wjas, the information such as agreement, port numbers.
Push Service end specifically can refer to the pushserver in Fig. 4.
Passage between access layer equipment and client can specifically refer to spdy passage.
S72: service providing device receives the api call request that application layer equipment sends, and obtains the second result and data identification information according to described api call request.
Embodiment as shown in Figure 3, after mtop receives api call request, can send to service providing device server by api call request, comprise data identification information in api call request.
In a upper embodiment, service providing device can obtain the first result according to api call request, in the present embodiment, server can also determine that active push is to the data of client, these data can be called the second result, and such as, api call request is that article are added shopping cart, if article inventory is nervous, then can the data result of active push stock anxiety.
S73: the second result and data identification information are sent to push server by service providing device.
S74: described second result and data identification information, according to the identification information of the described access layer equipment obtained in advance, are sent to described access layer equipment by described push server.
S75: described access layer equipment, by described second result and described data identification information, is pushed to described client by described passage.
The present embodiment is by after distribute data identification information, the resource that release data flow takies, the timely release to service end resource can be realized, avoid the wasting of resources always keeping causing, the resource of this release may be used for providing service for other clients, therefore can reduce the service end wasting of resources, improve service end resource utilization, promote service end throughput.In addition, the present embodiment, by the long communication channel of spdy and the cooperation of client and service end, can realize calling the complete asynchronization of api call request.At middle return data identification information, after client initiates monitoring, the data flow that on spdy passage, current api call request is corresponding can discharge completely, reduces the memory consumption of service end, takes full advantage of the resource of service end, promotes the handling capacity of service end.
Fig. 8 is the structural representation of the asynchronous call device that another embodiment of the application proposes, and this device 80 comprises receiver module 81, processing module 82 and acquisition module 83.
Receiver module 81 for newdata stream on the passage of client's side link, and by described in described data stream reception client send call request.
The device of the present embodiment can be positioned at service end.
Service end specifically can comprise access layer equipment, application layer equipment, service providing device and push server.
The passage of service end and client's side link can be spdy passage or http protocol passage or socket (socket) the long communication channel based on tcp/ip.Wherein, spdy is the application layer protocol based on transmission control protocol (TransmissionControlProtocol, TCP) of Google exploitation.
Data flow (stream) is a kind of tunnel, and this tunnel is positioned at the passage of service end and client's side link, and this data flow can transmit call request.Concrete, data flow can be two-way byte stream, each call request data stream transmitting, different call request different pieces of information flow transmission, data flow can in the passage of service end and client's side link parallel transmission call request.
Call request can be the call request of the application programming interface (ApplicationProgrammingInterface, api) of specifying, and such as, realizes the api of the business operation placed an order in e-commerce system.
Processing module 82, for after receiving described call request, sends the data identification information corresponding with described call request to described client, and discharges the resource that described data flow takies.
Wherein, the data identification information that different call request is corresponding is different.Described client can be monitored to obtain result data corresponding to described data identification information to described passage according to described data identification information.
Wherein, the data identification information that each call request is corresponding unique, accordingly, the result data identical data identification information corresponding to this call request that call request is corresponding.By data identification information, client can listen to result data corresponding to its call request sent.
In correlation technique, before service end returns results to client, the resource that data flow takies is kept always, and this mode can waste service end resource, reduces service end throughput.
And in the present embodiment, service end is after client return data identification information, the resource that the data flow that just release is used for the call request that transmission client sends takies instead of always keep, the resource of release may be used for providing service for other clients, therefore, service end resource utilization can be improved, improve service end throughput.
In an embodiment, as shown in Figure 9, described service end also comprises application layer equipment, and described processing module 82 comprises first module 821, second unit 822 and the 3rd unit 823.
First module 821 when self opens push mode, distributes described data identification information for described access layer equipment, and to call request described in described application layer device forwards.
Wherein, wjas and mtop can select to open or close (push) pattern of propelling movement, and push mode also can be called asynchronous mode.
Passage between wjas and mtop can be spdy passage or http passage, see Fig. 4, for http passage.
Wjas sends to the identification information and described data identification information that comprise described access layer equipment wjas in the api call request of mtop.
Identification information specifically can comprise the IP address of access layer equipment wjas, protocol number and port numbers.
Data identification information is corresponding with api call request, and each api call request can a unique corresponding data identification information, and data result corresponding to this api call request is too to should data identification information.
Second unit 822 receives the information of the asynchronous call request that accepted for identifying described application layer equipment that described application layer equipment sends for described access layer equipment, and the described information having accepted asynchronous call request for identifying described application layer equipment is that described application layer equipment receives described call request and determines that described access layer equipment and described application layer equipment send after all having opened push mode.
Particularly, the statscode that mtop can return http to wjas is 202, and this coding 202 represents and accepts api call request.Can carry out after mtop accepts api call request carrying out asynchronous call to api call request.
On the other hand, when at least one in wjas and mtop does not open push pattern, normal http request answer-mode can be performed.
Normal http request answer-mode comprises http repeating query and spdy calls, and see Fig. 5,6, respectively illustrates http repeating query, spdy invoked procedure schematic diagram.
3rd unit 823 receives described for identifying after described application layer equipment accepted the information of asynchronous call request for described access layer equipment, send the data identification information corresponding with described call request to described client, and discharge the resource that described data flow takies.
Acquisition module 83, for processing described call request, obtains result data, and described result data is pushed to described client by described passage.
Wherein, after service end receives call request, service corresponding to call request can be obtained from service provider, such as, when doing shopping, call request is the api request obtaining dotey details, so service end can obtain dotey's details the page as a result data return to client.
Concrete, service end, after acquisition result data, adopts the mode of active push that result data is sent to client.Service end, when pushing result data, can also comprise the data identification information corresponding with call request simultaneously, and client can find the result data of its request by this data identification information.
In another embodiment, the identification information of described access layer equipment and described data identification information is comprised in the described call request that described access layer equipment forwards, described result data comprise response described call request the first result, described acquisition module 83 specifically for:
After described application layer equipment receives described call request, call according to described call request, obtain first result corresponding with described data identification information;
Concrete, mtop can according to api call request, asynchronous call is initiated to service providing device server, asynchronous call can specifically call by High-SpeedServiceFramework, namely hsf calls, afterwards, the first result is returned to mtop by callback after obtaining the first result corresponding to api call request by server.Such as, api call request is the request of request dotey details, then the first result can be the particular content of dotey's details.
Described first result and described data identification information, according to the identification information of described access layer equipment, are sent to described access layer equipment by described application layer equipment;
Described access layer equipment, by described first result and described data identification information, is pushed to described client by described passage.
In another embodiment, described service end also comprises service providing device and push server, and described result data comprises the second result of service providing device active push, described acquisition module 83 further specifically for:
Described push server receives the second result and the data identification information of described service providing device active transmission, and described second result and described data identification information are that the call request that described service providing device sends according to described application layer equipment obtains; Described second result, according to the identification information of the described access layer equipment obtained in advance, is sent to described access layer equipment by described push server; Described access layer equipment, by described second result and described data identification information, is pushed to described client by described passage.
In another embodiment, described acquisition module 83 further specifically for: described access layer equipment is after setting up described passage with described client, send log-on message to described push server, described log-on message comprises the identification information of described access layer equipment.
When access layer equipment is wjas, the identification information of access layer equipment specifically can comprise the ip address of wjas, the information such as agreement, port numbers.
Push Service end specifically can refer to the pushserver in Fig. 4.
Passage between access layer equipment and client can specifically refer to spdy passage.
The present embodiment is by after distribute data identification information, the resource that release data flow takies, the timely release to service end resource can be realized, avoid the wasting of resources always keeping causing, the resource of this release may be used for providing service for other clients, therefore can reduce the service end wasting of resources, improve service end resource utilization, promote service end throughput.
Figure 10 is the structural representation of the asynchronous call device that another embodiment of the application proposes, and this device 100 comprises sending module 101, receiver module 102 and acquisition module 103.
Sending module 101 for newdata stream on the passage be connected with service end, and by described in described data flow service end send call request.
The device of the present embodiment can be positioned at client.
Service end specifically can comprise access layer equipment, application layer equipment, service providing device and push server.
The passage of service end and client's side link can be spdy passage or http protocol passage or socket (socket) the long communication channel based on tcp/ip.Wherein, spdy is the application layer protocol based on transmission control protocol (TransmissionControlProtocol, TCP) of Google exploitation.
Data flow (stream) is a kind of tunnel, and this tunnel is positioned at the passage of service end and client's side link, and this data flow can transmit call request.Concrete, data flow can be two-way byte stream, each call request data stream transmitting, different call request different pieces of information flow transmission, data flow can in the passage of service end and client's side link parallel transmission call request.
Call request can be the application programming interface (ApplicationProgrammingInterface of setting, api) call request, such as in e-commerce system, the api of the business operation that the carrying out provided by E-business service supplier places an order.
The data identification information that receiver module 102 feeds back described call request for receiving described service end, wherein, described service end discharges the resource that described data flow takies after sending described data identification information to client.
Wherein, the data identification information that each call request is corresponding unique, accordingly, the result data identical data identification information corresponding to this call request that call request is corresponding.By data identification information, client can monitor result data corresponding to its call request sent.
Acquisition module 103 for monitoring on described passage according to described data identification information, and obtain described service end by described passage send described call request is processed after the result data that obtains.
In another embodiment, see Figure 11, described device 100 also comprises display module 104, for showing described result data in user interface.
Wherein, after service end receives call request, service corresponding to call request can be obtained from service provider, such as, when doing shopping, call request is the api request obtaining dotey details, so service end can obtain dotey's details the page as a result data return to client.
Concrete, service end, after acquisition result data, adopts the mode of active push that result data is sent to client.Service end, when pushing result data, can also comprise the data identification information corresponding with call request simultaneously, and client can find corresponding result data by this data identification information.
After client receives data identification information, initiate the monitoring to passage, whether the result data of monitoring its call request sent corresponding returns, and does follow-up service logic again with this.
Client mainly monitors the result returned, and the result returned can be return data identification information or abnormal results, and abnormal results is time-out information such as.
The call request that the present embodiment is sent by data flow service end newly-built on the passage be connected with service end, and according to the data identification information received, wherein, service end discharges the resource that described data flow takies after sending described data identification information, the timely release to service end resource can be realized, avoid the wasting of resources always keeping causing, the resource of this release may be used for providing service for other clients, therefore the service end wasting of resources can be reduced, improve service end resource utilization, promote service end throughput.
It should be noted that, in the description of the application, term " first ", " second " etc. only for describing object, and can not be interpreted as instruction or hint relative importance.In addition, in the description of the application, except as otherwise noted, the implication of " multiple " is two or more.
Describe and can be understood in flow chart or in this any process otherwise described or method, represent and comprise one or more for realizing the module of the code of the executable instruction of the step of specific logical function or process, fragment or part, and the scope of the preferred implementation of the application comprises other realization, wherein can not according to order that is shown or that discuss, comprise according to involved function by the mode while of basic or by contrary order, carry out n-back test, this should understand by the embodiment person of ordinary skill in the field of the application.
Should be appreciated that each several part of the application can realize with hardware, software, firmware or their combination.In the above-described embodiment, multiple step or method can with to store in memory and the software performed by suitable instruction execution system or firmware realize.Such as, if realized with hardware, the same in another embodiment, can realize by any one in following technology well known in the art or their combination: the discrete logic with the logic gates for realizing logic function to data-signal, there is the application-specific integrated circuit (ASIC) of suitable combinational logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA) etc.
Those skilled in the art are appreciated that realizing all or part of step that above-described embodiment method carries is that the hardware that can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, this program perform time, step comprising embodiment of the method one or a combination set of.
In addition, each functional unit in each embodiment of the application can be integrated in a processing module, also can be that the independent physics of unit exists, also can be integrated in a module by two or more unit.Above-mentioned integrated module both can adopt the form of hardware to realize, and the form of software function module also can be adopted to realize.If described integrated module using the form of software function module realize and as independently production marketing or use time, also can be stored in a computer read/write memory medium.
The above-mentioned storage medium mentioned can be read-only memory, disk or CD etc.
In the description of this specification, at least one embodiment that specific features, structure, material or feature that the description of reference term " embodiment ", " some embodiments ", " example ", " concrete example " or " some examples " etc. means to describe in conjunction with this embodiment or example are contained in the application or example.In this manual, identical embodiment or example are not necessarily referred to the schematic representation of above-mentioned term.And the specific features of description, structure, material or feature can combine in an appropriate manner in any one or more embodiment or example.
Although illustrate and described the embodiment of the application above, be understandable that, above-described embodiment is exemplary, can not be interpreted as the restriction to the application, and those of ordinary skill in the art can change above-described embodiment, revises, replace and modification in the scope of the application.

Claims (24)

1. an asynchronous invoking method, is characterized in that, comprising:
Service end with newdata stream on the passage of client's side link, and by described in described data stream reception client send call request;
After described service end receives described call request, the data identification information corresponding with described call request is sent to described client, and discharge the resource that described data flow takies, wherein, the data identification information difference that different call request is corresponding, described data identification information makes described client monitor to obtain result data corresponding to described data identification information to described passage;
Described service end processes described call request, obtains result data, and described result data is pushed to described client by described passage.
2. method according to claim 1, is characterized in that, described service end comprises access layer equipment, described service end with newdata stream on the passage of client's side link, comprising:
Described access layer equipment with newdata stream on the passage of client's side link.
3. method according to claim 2, is characterized in that, described service end also comprises application layer equipment, after described service end receives described call request, sends data identification information to described client, and discharges the resource that described data flow takies, and comprising:
Described access layer equipment, when self opens push mode, distributes described data identification information, and to call request described in described application layer device forwards;
Described access layer equipment receives the information of the asynchronous call request that accepted for identifying described application layer equipment that described application layer equipment sends, and the described information having accepted asynchronous call request for identifying described application layer equipment is that described application layer equipment receives described call request and determines that described access layer equipment and described application layer equipment send after all having opened push mode;
Described access layer equipment receives and described sends the data identification information corresponding with described call request for identifying after described application layer equipment accepted the information of asynchronous call request to described client, and discharges the resource that described data flow takies.
4. method according to claim 3, it is characterized in that, the identification information of described access layer equipment and described data identification information is comprised in the described call request that described access layer equipment forwards, described result data comprises the first result of the described call request of response, described service end processes described call request, obtain result data, and described result data be pushed to described client by described passage, comprising:
After described application layer equipment receives described call request, call according to described call request, obtain first result corresponding with described data identification information;
Described first result and described data identification information, according to the identification information of described access layer equipment, are sent to described access layer equipment by described application layer equipment;
Described access layer equipment, by described first result and described data identification information, is pushed to described client by described passage.
5. method according to claim 3, it is characterized in that, described service end also comprises service providing device and push server, described result data comprises the second result of service providing device active push, described service end processes described call request, obtain result data, and described result data be pushed to described client by described passage, comprising:
Described push server receives the second result and the data identification information of described service providing device active transmission, and described second result and described data identification information are that the call request that described service providing device sends according to described application layer equipment obtains;
Described second result, according to the identification information of the described access layer equipment obtained in advance, is sent to described access layer equipment by described push server;
Described access layer equipment, by described second result and described data identification information, is pushed to described client by described passage.
6. method according to claim 5, is characterized in that, also comprises:
Described access layer equipment is after setting up described passage with described client, and send log-on message to described push server, described log-on message comprises the identification information of described access layer equipment.
7. the method according to claim 4 or 6, is characterized in that, the identification information of described access layer equipment comprises: IP address, protocol number and the port numbers of described access layer equipment.
8. method according to claim 1, is characterized in that, the passage between described service end and described client is spdy passage, http passage or the long communication channel of socket based on tcp/ip.
9. method according to claim 3, it is characterized in that, the described call request that described access layer equipment forwards is by the channel transfer between described access layer equipment and described application layer equipment, and the passage between described access layer equipment and described application layer equipment is spdy passage or http passage.
10. an asynchronous invoking method, is characterized in that, comprising:
Newdata stream on the passage be connected with service end, and by described in described data flow service end send call request;
Receive the data identification information that described service end is fed back described call request, wherein, described service end discharges the resource that described data flow takies after sending described data identification information to client;
Monitor on described passage according to described data identification information, and obtain described service end by described passage send described call request is processed after the result data that obtains.
11. methods according to claim 10, is characterized in that, also comprise:
Page presentation is carried out according to described result data.
12. methods according to claim 10, is characterized in that, described passage is spdy passage, http passage or the long communication channel of socket based on tcp/ip.
13. 1 kinds of asynchronous call devices, is characterized in that, comprising:
Receiver module, for newdata stream on the passage of client's side link, and by described in described data stream reception client send call request;
Processing module, after receiving described call request, the data identification information corresponding with described call request is sent to described client, and discharge the resource that described data flow takies, wherein, the data identification information difference that different call request is corresponding, described data identification information makes described client monitor to obtain result data corresponding to described data identification information to described passage;
Acquisition module, for processing described call request, obtaining result data, and described result data is pushed to described client by described passage.
14. devices according to claim 13, is characterized in that, described service end comprises access layer equipment, described receiver module specifically for: described access layer equipment with newdata stream on the passage of client's side link.
15. devices according to claim 14, it is characterized in that, described service end also comprises application layer equipment, described processing module comprises:
First module, for described access layer equipment when self opens push mode, distributes described data identification information, and to call request described in described application layer device forwards;
Second unit, receive the information of the asynchronous call request that accepted for identifying described application layer equipment that described application layer equipment sends for described access layer equipment, the described information having accepted asynchronous call request for identifying described application layer equipment is that described application layer equipment receives described call request and determines that described access layer equipment and described application layer equipment send after all having opened push mode;
Unit the 3rd, receive described for identifying after described application layer equipment accepted the information of asynchronous call request for described access layer equipment, send the data identification information corresponding with described call request to described client, and discharge the resource that described data flow takies.
16. devices according to claim 15, it is characterized in that, the identification information of described access layer equipment and described data identification information is comprised in the described call request that described access layer equipment forwards, described result data comprise response described call request the first result, described acquisition module specifically for:
After described application layer equipment receives described call request, call according to described call request, obtain first result corresponding with described data identification information;
Described first result and described data identification information, according to the identification information of described access layer equipment, are sent to described access layer equipment by described application layer equipment;
Described access layer equipment, by described first result and described data identification information, is pushed to described client by described passage.
17. devices according to claim 15, is characterized in that, described service end also comprises service providing device and push server, and described result data comprises the second result of service providing device active push, described acquisition module further specifically for:
Described push server receives the second result and the data identification information of described service providing device active transmission, and described second result and described data identification information are that the call request that described service providing device sends according to described application layer equipment obtains;
Described second result, according to the identification information of the described access layer equipment obtained in advance, is sent to described access layer equipment by described push server;
Described access layer equipment, by described second result and described data identification information, is pushed to described client by described passage.
18. devices according to claim 17, is characterized in that, described acquisition module further specifically for:
Described access layer equipment is after setting up described passage with described client, and send log-on message to described push server, described log-on message comprises the identification information of described access layer equipment.
19. devices according to claim 16 or 18, it is characterized in that, the identification information of described access layer equipment comprises: IP address, protocol number and the port numbers of described access layer equipment.
20. devices according to claim 13, is characterized in that, the passage between described service end and described client is spdy passage, http passage or the long communication channel of socket based on tcp/ip.
21. devices according to claim 15, it is characterized in that, the described call request that described access layer equipment forwards is by the channel transfer between described access layer equipment and described application layer equipment, and the passage between described access layer equipment and described application layer equipment is spdy passage or http passage.
22. 1 kinds of asynchronous call devices, is characterized in that, comprising:
Sending module, for newdata stream on the passage be connected with service end, and by described in described data flow service end send call request;
Receiver module, for receiving the data identification information that described service end is fed back described call request, wherein, described service end discharges the resource that described data flow takies after sending described data identification information to client;
Acquisition module, for monitoring on described passage according to described data identification information, and obtain described service end by described passage send described call request is processed after the result data that obtains.
23. devices according to claim 22, is characterized in that, also comprise:
Display module, for carrying out page presentation according to described result data.
24. devices according to claim 22, is characterized in that, described passage is spdy passage, http passage or the long communication channel of socket based on tcp/ip.
CN201410488062.1A 2014-09-22 2014-09-22 Asynchronous invoking method and device Active CN105516215B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410488062.1A CN105516215B (en) 2014-09-22 2014-09-22 Asynchronous invoking method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410488062.1A CN105516215B (en) 2014-09-22 2014-09-22 Asynchronous invoking method and device

Publications (2)

Publication Number Publication Date
CN105516215A true CN105516215A (en) 2016-04-20
CN105516215B CN105516215B (en) 2018-11-16

Family

ID=55723849

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410488062.1A Active CN105516215B (en) 2014-09-22 2014-09-22 Asynchronous invoking method and device

Country Status (1)

Country Link
CN (1) CN105516215B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110943886A (en) * 2019-11-29 2020-03-31 新华三技术有限公司 Performance data transmission method and device
CN113129865A (en) * 2021-03-05 2021-07-16 联通(广东)产业互联网有限公司 Method and device for processing communication voice transcription AI connector intermediate element

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101047962A (en) * 2006-03-31 2007-10-03 华为技术有限公司 Service release method for multimedia broadcast/multicast service
US20120096112A1 (en) * 2010-10-19 2012-04-19 Sap Ag. Transparent distribution and decoupling of modules using asynchronous communication and scopes
US20130021919A1 (en) * 2006-05-17 2013-01-24 Research In Motion Limited Method and system for a signaling connection release indication
CN102957674A (en) * 2011-08-26 2013-03-06 中兴通讯股份有限公司 Resource control method and resource control system for broadband network
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
CN103501305A (en) * 2013-10-14 2014-01-08 中国联合网络通信集团有限公司 Internet service realization method, application server and calling proxy server

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101047962A (en) * 2006-03-31 2007-10-03 华为技术有限公司 Service release method for multimedia broadcast/multicast service
US20130021919A1 (en) * 2006-05-17 2013-01-24 Research In Motion Limited Method and system for a signaling connection release indication
US20120096112A1 (en) * 2010-10-19 2012-04-19 Sap Ag. Transparent distribution and decoupling of modules using asynchronous communication and scopes
CN102957674A (en) * 2011-08-26 2013-03-06 中兴通讯股份有限公司 Resource control method and resource control system for broadband network
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
CN103501305A (en) * 2013-10-14 2014-01-08 中国联合网络通信集团有限公司 Internet service realization method, application server and calling proxy server

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110943886A (en) * 2019-11-29 2020-03-31 新华三技术有限公司 Performance data transmission method and device
CN113129865A (en) * 2021-03-05 2021-07-16 联通(广东)产业互联网有限公司 Method and device for processing communication voice transcription AI connector intermediate element

Also Published As

Publication number Publication date
CN105516215B (en) 2018-11-16

Similar Documents

Publication Publication Date Title
CN102904959B (en) Network accelerating method and gateway
CN104980898A (en) Information pushing method, system and equipment
US20190179663A1 (en) Generic communication architecture for cloud microservice infrastructure
CN109218041B (en) Request processing method and device for server system
CN104462033A (en) Method and device for realizing editing operation among devices
CN104717041A (en) Method and device for transmitting data
CN104123380A (en) Webpage access method and device
CN111541555A (en) Group chat optimization method and related product
CN113300854A (en) Edge node capability expansion method, system and expansion box
CN111464352A (en) Call link data processing method and device
CN109688200A (en) A kind of message treatment method, device and equipment
CN115988053A (en) Communication node, data transmission method and storage medium
CN105516215A (en) Asynchronous call method and asynchronous call device
CN108370500B (en) Optimized settings for wireless devices
CN101651713B (en) Smart card network data transmitting method and device
CN115412597B (en) Real-time data communication method
US20160088076A1 (en) Method, device and system for obtaining mobile network data resources
CN108289165A (en) A kind of implementation method, device and terminal device controlling camera based on mobile phone
EP2847967B1 (en) Method and system for prefetching data
CN113992644A (en) Internet of things gateway system based on non-service technology and data processing method thereof
CN115699823A (en) Method and apparatus for supporting mobility in collecting and analyzing network data in a wireless communication network
CN104753990A (en) Data synchronization method, device and system
CN113722115A (en) Method, device, equipment and computer readable medium for calling interface
CN114189562B (en) Data processing method, device, terminal and storage medium
CN111431925B (en) Message data processing method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant