CN106453592A - Asynchronous call processing method and apparatus, and distributed system - Google Patents

Asynchronous call processing method and apparatus, and distributed system Download PDF

Info

Publication number
CN106453592A
CN106453592A CN201610944766.4A CN201610944766A CN106453592A CN 106453592 A CN106453592 A CN 106453592A CN 201610944766 A CN201610944766 A CN 201610944766A CN 106453592 A CN106453592 A CN 106453592A
Authority
CN
China
Prior art keywords
node
service
telegon
call
result
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
CN201610944766.4A
Other languages
Chinese (zh)
Other versions
CN106453592B (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.)
Suzhou Yudeshui Electric Technology Co Ltd
Original Assignee
Huawei Technologies Co 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201610944766.4A priority Critical patent/CN106453592B/en
Publication of CN106453592A publication Critical patent/CN106453592A/en
Application granted granted Critical
Publication of CN106453592B publication Critical patent/CN106453592B/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/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • 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/51Discovery or management thereof, e.g. service location protocol [SLP] or web 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/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

Abstract

The embodiment of the invention provides an asynchronous call processing method and apparatus, and a distributed system. The method is applied to the distributed system comprising a coordinator and at least two service nodes, the service node requested by a client to provide services is a master node, and the service node called by the master node to accomplish the services is a slave node, and the method comprises the following steps: the coordinator receives an asynchronous call request initiated by the master node to the slave node based on the services requested by the client; the coordinator creates a call record according to the asynchronous call request and calls the slave node to process the asynchronous call request; the coordinator receives a processing result sent by the slave node and records the processing result in the call record; the coordinator receives a processing result acquisition request sent by the service node needing to use the processing result in the services requested by the client; and the coordinator acquires the processing result from the call record, and sends the processing result to the service node needing to use the processing result. The asynchronous call processing method and apparatus is used for improving the processing efficiency of the distributed system.

Description

Asynchronous call processing method, equipment and distributed system
Technical field
The present embodiments relate to communication technical field, more particularly, to a kind of asynchronous call processing method, equipment and distribution Formula system.
Background technology
With the continuous development of computer technology, distributed system is widely applied.Arrange in a distributed system There are multiple nodes, have and can mutually be called to complete preset function between the node of difference in functionality.
In the prior art, in order to improve the treatment effeciency of distributed system, generally realized between node using multithreading Carry out asynchronous call, so that multiple node can be with parallel running.Specifically, need other multiple nodes are carried out in a node When calling, multiple threads can be started simultaneously and respectively other multiple nodes are called.But, when a node is many to other When there is dependence between the calling of individual node, between the plurality of thread, also can only carry out serial process.For example, it is assumed that node 1 needs to call node 2 and node 3, and when node 1 calls node 3, node 1 needs to pass the result of node 2 as parameter Pass node 3, so, only after node 2 obtains result, node 1 could call to node 3.
From the foregoing, it will be observed that in the prior art, between a node is to the calling of other multiple nodes, there is dependence When, serial process can only be carried out to the plurality of calling, lead to the treatment effeciency of distributed system relatively low.
Content of the invention
The embodiment of the present invention provides a kind of asynchronous call processing method, equipment and distributed system, distributed for improving The treatment effeciency of system.
In a first aspect, the embodiment of the present invention provides a kind of asynchronous call processing method, the method can apply to including association Adjust the distributed system of device and at least two service nodes.Wherein, save based on the service node that service is provided by client request Point, is called the service node to complete servicing to be from node by host node.
After host node receives the service of client request, host node send to telegon include to be called from section The asynchronous call request of the node identification of point.Telegon calls record according to what asynchronous call request created that this calls, and adjusts With from node corresponding with node identification, asynchronous call request is processed.In from node, asynchronous call request is processed and complete Afterwards, from node is to telegon transmission processe result, so that telegon is calling result record in record.When host node exists When the other from nodes called in service need using result, obtain request to telegon transmission processe result, with from association Adjust and in device, obtain result.
In above process, it is provided with telegon in a distributed system, so that each service node can pass through this association Device is adjusted mutually to be called.Telegon can also cache the process knot that in a service, each service node is asked to asynchronous call Really.So, when host node to the second from node call depend on host node to the call result of the first from node when, host node When calling to the second from node, host node is without waiting for the call result to the first from node.In host node to second When from node calls, corresponding for the result of the first from node identification information is sent to the second from node by host node, with Make the second from node can obtain result according to the corresponding identification information of result in telegon, and then realize main section Point can carry out parallel calling to multiple complementary from nodes, and then improves the treatment effeciency of distributed system.
In a kind of possible embodiment, after telegon has created and called record, telegon can also construct use Call the identification information of record in searching this, send identification information to host node, and by host node to host node in service Calling, need using result from node send identification information.In this manner it is ensured that need using result from Node can obtain result according to this identification information in telegon.
In alternatively possible embodiment, need the result sending using the node of result to telegon Obtain in request and can also carry identification information.Accordingly, telegon can be by feasible as follows implementation from calling note Result is obtained in record:Telegon is searched according to identification information and is called record, and judges to call in record with the presence or absence of process Result;
If so, then telegon obtains result.If it is not, then telegon is by the mark of the node needing using result Add and wait list, and when there is result in calling record, obtain result, and will need using result The mark removal of node waits list.
In this kind of embodiment, when needing to need using the service node of result to obtain result, and call When there is not yet this result in record, the mark of the service node needing using result is added to wait by telegon List.So, when call there is this result in record when, telegon can the very first time to needing using result Service node sends this result so that telegon can be quickly to the service node feedback processing needing using result As a result, so make distributed system treatment effeciency higher.
In alternatively possible embodiment, what telegon created calls record can also include for identifying this tune Call mark.Accordingly, telegon can be configured to lookup according to the feasible implementation of the following two kinds and call record Identification information:
A kind of feasible implementation:Telegon is directly to call mark to call the identification information of record as lookup.Separately A kind of feasible implementation:Construction calls the identification information of record based on the handle object calling mark as lookup.
In alternatively possible embodiment, receive what host node was sent based on the service of client request in telegon After service-creation request, can ask according to service-creation, create clothes that this services, including for searching service log Business record, and send service identifiers to host node.So, service mark can be carried in the asynchronous call request that host node is initiated Know, so that telegon is when record is called in establishment, record can will be called to create under service log according to service identifiers.
In this kind of embodiment, indicate a service by service identifiers, and by one service in all call note Record creates under this service.So, it is easy to distributed system the record that calls in service is monitored managing.
Optionally, telegon can be configured to search the mark calling record by the feasible implementation of the following two kinds Information:
A kind of feasible implementation:Telegon by service identifiers and calls mark to be combined as to search the mark calling record Knowledge information.So, when record is called according to identification information lookup, first service log can be determined according to service identifiers, then Call record according to calling mark to determine in service log, so that acquisition calls the efficiency of record higher.
Another kind of feasible implementation:Telegon construction based on service identifiers and calls the handle object of mark as looking into Look for the identification information calling record.Due to handle object take up room generally less, so when call by passing identifies, Ke Yiti High-transmission efficiency.
In alternatively possible embodiment, service log and call record can be tree.Wherein, tree-like knot Structure, with service log as root node, calls the child node being recorded as being articulated under root node.By the form of tree structure to one The record that calls in individual service is stored, and is easy to distributed system and calls record to be monitored managing each in each service Reason, and then improve the efficiency of management to service.
Second aspect, the embodiment of the present invention provides a kind of asynchronous call processing method, and the method is applied to including telegon Distributed system with least two service nodes.Wherein, the service node being provided service by client request is host node, quilt It is from node that host node calls the service node to complete servicing.
When client is to host node request service, host node, according to the service of client request, determines what needs called From node, and call the asynchronous call of the first from node to ask to telegon transmission.Telegon is according to asynchronous call request call First from node is processing asynchronous call and ask and record the result that the first from node is asked to asynchronous call;First from Node is one of from node that the needs determined call.Host node always according to need between each from node of calling according to Bad relation, recognize the need for needing in the from node called using the first from node to the result that asynchronous call is asked Two from nodes, host node calls the second from node, and indicates the second from node from coordination during calling the second from node Device obtains the result that the first from node is asked to asynchronous call.
In above process, it is provided with telegon in a distributed system, so that each service node can pass through this association Device is adjusted mutually to be called.Meanwhile, telegon can also cache what each service node in a service was asked to asynchronous call Result.So, when host node to the second from node call depend on host node to the call result of the first from node when, , when calling to the second from node, host node is without waiting for the call result to the first from node for host node.In host node When second from node is called, corresponding for the result of the first from node identification information is sent to second from section by host node Point, so that the second from node can obtain result, Jin Ershi according to the corresponding identification information of result in telegon Existing host node can carry out parallel calling to multiple complementary from nodes, and then improves the treatment effeciency of distributed system.
In a kind of possible embodiment, the service initiated according to client in host node, determine the section needing to call Before point, the service also based on client request for the host node, send service-creation request to telegon, so that described telegon root According to the request of described service-creation, create the service log of this service, service log is included for searching described service log Service identifiers, telegon create service log after, telegon to host node send service identifiers.So, in host node Service identifiers and the mark of the first from node can be included in the asynchronous call request sending to telegon.
Optionally, after host node sends to telegon and calls the asynchronous call of the first from node to ask, host node connects Receive that telegon sends, for searching the asynchronous call corresponding identification information calling record of request.Accordingly, host node is permissible Send identification information to the second from node, so that the second from node obtains the first from node pair according to identification information in telegon The result of asynchronous call request.
In this process, indicate a service by service identifiers, and all the calling in a service is recorded establishment Under this service.So, it is easy to distributed system the record that calls in service is monitored managing.Meanwhile, telegon passes through Identification information can quickly find and call record, and quick obtaining result in calling record.
The third aspect, the embodiment of the present invention provides a kind of telegon, and this telegon can execute any one of first aspect institute The method stated.This telegon can be realized by software and/or hardware.Optionally, this telegon can include receiver module, place Reason module and sending module, and the method described in any one of first aspect is executed by each module.
Fourth aspect, the embodiment of the present invention provides a kind of service node, and it is arbitrary that this service node can execute second aspect Method described in.This service node can be realized by software and/or hardware.Optionally, this service node can include connecing Receive module, processing module and sending module, and the method described in any one of second aspect is executed by each module.
5th aspect, the embodiment of the present invention provides a kind of telegon, and this telegon can execute any one of first aspect institute The method stated.This telegon can include receiver, processor, transmitter and the memory for storing application program, processes Device can read and execute the application program in memory.
6th aspect, the embodiment of the present invention provides a kind of service node, and it is arbitrary that this service node can execute first aspect Method described in.This service node can include receiver, processor, transmitter and the storage for storing application program Device, processor can read and execute the application program in memory.
7th aspect, the embodiment of the present invention provides a kind of distributed system, and this distributed system includes above-mentioned 5th side Telegon described in face and the service node described in the 6th aspect.
Asynchronous call processing method provided in an embodiment of the present invention, equipment and distributed system, the embodiment of the present invention provides Asynchronous call processing method, be provided with telegon in a distributed system, so that each service node can pass through this coordination Device is mutually called.Telegon can also cache the process knot that in a service, each service node is asked to asynchronous call Really.So, when host node to the second from node call depend on host node to the call result of the first from node when, host node When calling to the second from node, host node is without waiting for the call result to the first from node.In host node to second When from node calls, corresponding for the result of the first from node identification information is sent to the second from node by host node, with Make the second from node can obtain result according to the corresponding identification information of result in telegon, and then realize main section Point can carry out parallel calling to multiple complementary from nodes, and then improves the treatment effeciency of distributed system.
Brief description
The application scenarios schematic diagram of the asynchronous invoking method that Fig. 1 provides for the present invention;
The schematic flow sheet one of the asynchronous call processing method that Fig. 2 provides for the present invention;
Fig. 3 obtains the schematic flow sheet of result method for the telegon that the present invention provides;
The schematic flow sheet two of the asynchronous call processing method that Fig. 4 provides for the present invention;
The tree structure schematic diagram that Fig. 5 provides for the present invention;
The structural representation of the telegon that Fig. 6 provides for the present invention;
The structural representation one of the service node that Fig. 7 provides for the present invention;
The structural representation two of the service node that Fig. 8 provides for the present invention;
The hardware configuration of the telegon that Fig. 9 provides for the present invention is illustrated;
The hardware architecture diagram one of the service node that Figure 10 provides for the present invention;
The hardware architecture diagram two of the service node that Figure 11 provides for the present invention.
Specific embodiment
The application scenarios schematic diagram of the asynchronous invoking method that Fig. 1 provides for the present invention, refers to Fig. 1, including distributed system System 101 and client 102, wherein, distributed system 101 includes telegon 1011 and multiple service node (is designated as respectively 1012-1 to 1012-2).Each service node individually can provide service to client 102 it is also possible to save with other services Point provides service to client 102 jointly.In this application, clothes are provided in a service node (host node) to client 102 During business, this service node can be called to other service nodes (from node) by telegon 1011, and by assisting Adjust device 1011 caching process result, on the one hand, when host node depends on host node to first from section calling of the second from node Point call result when, host node when calling to the second from node, without waiting for the call result to the first from node, When host node calls to the second from node, only corresponding for the result of the first from node identification information need to be sent to the Two from nodes, so that the second from node can obtain result according to the corresponding identification information of result in telegon, And then realize host node multiple complementary from nodes can be carried out with parallel calling, and then improve the process of distributed system Efficiency.
It should be noted that in this application, the service node of service will be provided to be referred to as host node by client request, will The service node to complete servicing is called to be referred to as from node by host node, wherein, host node and from node are relative concept, one Service node can be for host node or other service node from service node.
Below, by specific embodiment, the technical scheme shown in the application is described in detail.It should be noted that under These specific embodiments of face can be combined with each other, may be in certain embodiments for same or analogous concept or process Repeat no more.
The schematic flow sheet one of the asynchronous call processing method that Fig. 2 provides for the present invention, refers to Fig. 2, and the method is permissible Including:
S201, host node, according to the service of client request, determine the from node needing to call.
In actual application, when client needs to obtain service in a distributed system, client request is distributed In formula system, host node corresponding with this service provides service, the mistake service of client request being processed in host node Cheng Zhong, this host node may need the other nodes (from node) in distributed system are called, and just can complete client The service of request.
When in host node needs to distributed system, other nodes call, host node is according to the clothes of client request Business, determines the from node needing to call.Optionally, the type of the sub-services that host node can include according to service, determines and needs From node to be called, for example, can store the type of sub-services and the corresponding relation of from node in the master node, so, main Node can determine, according to the type of this corresponding relation and sub-services, the from node needing to call.
S202, host node send asynchronous call request to telegon, and asynchronous call request includes from node to be called Node identification.
S203, telegon according to asynchronous call request create this call call record.
In once servicing, record is called in corresponding one of each asynchronous call request, calls in record and can store this Asynchronous call asks corresponding result, optionally, can also store asynchronous call and ask corresponding asking in calling record Ask mark, the mark of requested node (from node) of node (host node), in actual application, can be according to actual need Determine the content calling record to include.
S204, telegon are configured to search the identification information that this calls record.
Optionally, what telegon created call can include in record calling mark for identify that this calls, accordingly , telegon directly can call the identification information of record as searching calling to identify, or, construction is based on calling mark Handle object calls the identification information of record as searching.
S205, telegon send this identification information to host node.
S206, telegon call from node that asynchronous call request is processed.
After telegon receives the asynchronous call request of host node, telegon obtains in asynchronous call request to be needed The mark of the from node called, and the mark of the from node called as needed, call the corresponding from node of mark of from node Asynchronous call request is processed.Optionally, telegon can generate according to asynchronous call request and call finger to from node Order, and carry the content information in asynchronous call request in call instruction, telegon sends this call instruction to from node, with From node is made according to this call instruction, asynchronous call request to be processed.
It should be noted that S203-S205 and S206 can execute it is also possible to order executes, in practical application mistake simultaneously Cheng Zhong, can arrange the execution sequence of S203-S205 and S206 according to actual needs, and the present invention is not especially limited to this.
S207, from node are to telegon transmission processe result.
After telegon calls to from node, from node is processed to asynchronous call request, asynchronous to obtain The corresponding result of call request, and send, to telegon, the result acquiring.
S208, telegon are calling result record in record.
S209, during host node calls to other from nodes in current service, when host node calls When other from nodes need using result, host node sends identification information to this from node.
S210, the from node using result is needed to obtain request to telegon transmission processe result.
S211, telegon obtain request according to result, obtain in identification information corresponding calling and process knot in record Really.
Optionally, after getting result and obtaining request, telegon can obtain in result please for telegon Ask middle to obtain for searching the identification information calling record, searched according to this identification information and call record, and in the tune finding With obtaining result in record.
S212, telegon are to needing to send this result using the from node of result.
It should be noted that S206-S208 and S209-S210 can be with executed in parallel.
Also, it should be noted during host node is processed to the service of client request, host node may It is also required to the result sending using from node in S207 to telegon.When host node needs using this result, main Node to telegon transmission processe result obtain request, and result obtain request in carry for search call record Identification information.Telegon obtains request according to result, obtains result in corresponding the calling in record of identification information, and Send this result to host node.It should be noted that the process that telegon obtains result may refer to S211, herein No longer repeated.
Below, by specific example, the method shown in Fig. 2 embodiment is described in detail.
Exemplary it is assumed that distributed system includes 5 nodes, be designated as node 1- node 5 respectively.
When client needs to obtain in a distributed system service 1, client is true in 5 nodes of distributed system The fixed host node being used for providing service 1 is node 1, then client request node 1 is processed to service 1.
During node 1 is processed to the service 1 of client request, node 1 determines the from node needing to call. Assume node 1 during service 1 is processed, node 1 needs node 2 and node 3 are called.When node 1 need right Node 2 calls, then node 1 sends asynchronous call request to telegon, and carries the mark of node 2 in asynchronous call request Know.
What the asynchronous call request that telegon sends according to node 1 created that this calls calls record, this call record right Calling of answering is designated " 001 ", and calls node 2 that the request of this asynchronous call is processed.Create in telegon and call record 1 Afterwards, telegon builds the identification information calling record for searching this, and for example, " 001 " can be directly defined as by telegon This calls the identification information of record, and telegon sends this identification information to node 1.
Node 2 carries out process and obtains result to asynchronous call request, and result is sent to telegon, by assisting Device is adjusted to call in record this result record at this.
In node 1 in the processing procedure of service 1, node 1 also needs to call node 3 by telegon, because node 3 is right Asynchronous call request needs using the result called in record 1 during processing.In this application, node 1 need not be Node 2 determination calls to node 3 after obtaining result again, when node 1 needs node 3 is called, node 1 Just node 3 is called, and send identification information " 001 " to node 3, so that node 3 is needing the process knot using node 2 During fruit, obtain request to telegon transmission processe result, and obtain in request in result and carry and call note for searching this The identification information (" 001 ") of record 1, telegon obtains the identification information in request according to result, searches this and calls record, Call acquisition result in record at this, and send this result to node 3.
In above process, after node 1 is to the calling of node 2, when node 1 needs node 3 is called, and to node 3 when calling the result depending on node 2, node 1 without wait node 2 result so that node 1 can be right Node 2 and node 3 carry out parallel calling, and then improve the treatment effeciency of distributed system.
Asynchronous call processing method provided in an embodiment of the present invention, is provided with telegon in a distributed system, so that respectively Individual service node mutually can be called by this telegon.Telegon can also cache each service node in a service Result to asynchronous call request.So, when host node to the second from node call depend on host node to first from During the call result of node, host node when calling to the second from node, without waiting for knot is called to the first from node Really.When host node calls to the second from node, corresponding for the result of the first from node identification information is sent out by host node Give the second from node, so that the second from node can the acquisition process in telegon according to the corresponding identification information of result And then improve distributed system as a result, and then realize host node and can carry out parallel calling to multiple complementary from nodes, Treatment effeciency.
On the basis of embodiment illustrated in fig. 2, optionally, need to send to telegon using the service node of result Result obtains in request and can carry for searching the identification information calling record.Accordingly, telegon can be according to such as Under feasible implementation obtain result in record (in embodiment illustrated in fig. 2 in identification information corresponding calling S211).The implementing of this acquisition process, embodiment shown in Figure 3.
Fig. 3 obtains the schematic flow sheet of result method for the telegon that the present invention provides, and refers to Fig. 3, the method Can include:
S301, telegon are searched according to identification information and are called record.
After telegon receives the result acquisition request needing to send using the service node of result, association Adjust device can obtain in request in result and obtain identification information, and acquisition is searched according to this identification information and call record.
S302, telegon judge to call in record with the presence or absence of result.
If so, then execute S303.
If it is not, then executing S304-S306.
S303, telegon obtain result in calling record.
The mark of the node needing using result is added wait list by S304, telegon.
If judging to call in record and there is not result, illustrating that corresponding from node is also untreated and obtaining this and call record Corresponding result, then telegon will need using result node add wait list, at this time, it may be necessary to using process The node of result can first carry out the event that other is independent of this result.
S305, when there is result in calling record, telegon obtains result.
The mark removal of the node needing using result is waited list by S306, telegon.
In above process, when needing to need using the service node of result to obtain result, and call record In when there is not yet this result, the mark of the service node needing using result is added to wait row by telegon Table.So, when call there is this result in record when, telegon can the very first time to the clothes needing using result Business node sends this result so that telegon can be quickly to the service node feedback processing knot needing using result Fruit is so that the treatment effeciency of distributed system is higher.
On the basis of any one embodiment above-mentioned, below, by the embodiment shown in Fig. 4 to above-mentioned asynchronous call at Reason method is described in further detail.
The schematic flow sheet two of the asynchronous call processing method that Fig. 4 provides for the present invention, refers to Fig. 4, and the method is permissible Including:
S401, host node, according to the service of client request, send service-creation request to telegon.
Optionally, the mark servicing can be included in the request of this service-creation.In actual application, can be according to reality Border is it needs to be determined that service-creation asks the content including.
S402, telegon according to service-creation request create this service service log, service log include for Search the service identifiers of service log.
Optionally, when telegon creates service log, this service log can be created in the form of a tree structure, And this service log is the root node of tree structure.While telegon creates service log, telegon also generates and is used for looking into Look for the service identifiers of this service identifiers, optionally, this service identifiers can pass through string representation, and for example, service identifiers are permissible For " 001 ", " abc1 " etc..
S403, telegon send service identifiers to host node.
, according to the service of client request, determining needs to call the first from node for S404, host node.
S405, host node send asynchronous call request to telegon, and asynchronous call request includes the node of the first from node Mark and service identifiers.
S406, telegon are asked according to asynchronous call, create and call record under the corresponding service log of service identifiers, adjust Include calling mark for identify that this calls with record.
Wherein, record is called can to create under the service log that this calls the service of place.Specifically, this calls the record can Create under the root node representing described service, as the child node of this root node.
Optionally, the form of record of calling creating in the service log creating in S402 and S406 can be as shown in Figure 5. The tree structure schematic diagram that Fig. 5 provides for the present invention, refers to Fig. 5, and the root node of this tree structure is service log, and this is tree-like The child node of structure is to call record, calls record to hang on the root node of service log.Can include locating in calling record Reason result and wait list, wait list to be used for the mark that storage waits the node of this result, optionally, are calling record In can also include nesting allocation record.Certainly, other contents can also be included in tree structure, the present invention does not make to this to have Body limits.
By the form of tree structure, the record that calls in one service is stored, be easy to distributed system to this clothes Each in business calls record to be monitored managing, and for example, distributed system can monitor each according to this tree structure and call Whether record normally completes (whether obtaining result), and then improves the efficiency of management to service.
It should be noted that the implementation procedure of S404-S406 may refer to the S201-S203 in embodiment illustrated in fig. 2, this Place is no longer repeated.
S407, telegon according to service identifiers and call mark, and construction searches the identification information calling record.
Optionally, telegon can be searched by the feasible implementation construction of the following two kinds and call the mark of record to believe Breath:
A kind of feasible implementation:Telegon by service identifiers and calls mark to be combined as to search the mark calling record Knowledge information.Optionally, telegon by service identifiers and can call mark to be combined according to default built-up sequence, obtains this mark Knowledge information.For example, it is assumed that service identifiers are " 001 ", call and be designated " abc ", then identified really with calling according to this service identifiers Surely the identification information obtaining can be " 001-abc ".
Another kind of feasible implementation:Telegon construction based on service identifiers and calls the handle object of mark as looking into Look for the identification information calling record.Optionally, handle object and service identifiers can be set and call corresponding between mark closing System so that obtain can uniquely being determined according to handle object obtain service identifiers and one call mark.For example, it is possible to Setting handle object " A " and service identifiers " 001 " and call mark " abc " corresponding, then can determine that according to handle object " A " Service identifiers are " 001 ", call and are designated " abc ".
S408, telegon send identification information to host node.
S409, telegon call the first from node that asynchronous call request is processed.
S410, the first from node are to telegon transmission processe result.
S411, telegon are calling result record in record.
It should be noted that the implementation procedure of S409-S411 may refer to the S206-S208 in embodiment illustrated in fig. 2, this Place is no longer repeated.
It should be noted that S407-S408 and S409-S411 can sequentially execute it is also possible to execute simultaneously, the present invention is real Apply example the execution sequence of S407-S408 and S409-S411 is not especially limited.
Dependence between each from node that S412, host node call as needed, recognize the need for using first from Second from node to the result that asynchronous call is asked for the node.
Dependence between each from node is used for indicating the result which from node is a from node need using, Or, the result of a from node needs to be used by which from node, and for example, this dependence can be service node C Rely on (needing to use) node B result called to node A.
S413, when host node calls the second from node, to second from node send identification information to indicate second from section Point obtains, according to identification information, the result that the first from node is asked to asynchronous call from telegon.
S414, the second from node send the result acquisition request including identification information to telegon.
S415, telegon are searched according to identification information and are called record, and judge to call in record with the presence or absence of result;
If so, then execute S416-S417;
If it is not, then executing S418-S420.
S416, telegon obtain result in calling record.
S417, telegon are to the second from node transmission processe result.
The mark of the second from node is added wait list by S418, telegon, when there is result in calling record, Telegon obtains result;
S419, telegon are to the second from node transmission processe result.
The mark removal of the second from node is waited list by S420, telegon.
It should be noted that the implementation procedure of S415-S420 may refer to the embodiment shown in Fig. 3, no longer carry out herein Repeat.
Below, by specific example, the method shown in Fig. 4 embodiment is described in detail.
Exemplary it is assumed that distributed system includes 5 nodes, be designated as node 1- node 5 respectively it is further assumed that node 1 Be designated " a ", being designated " b " of node 2, node 3 be designated " c ".
When client needs to obtain in a distributed system service 1, client is true in 5 nodes of distributed system The fixed host node being used for providing service 1 is node 1, then client request node 1 is processed to service 1.
Node 1, according to the service of client request, sends service-creation request to telegon, coordinates according to this service-creation Request, creates the service log of this service, and service log includes the service identifiers for searching this service log, telegon Also send this service identifiers to node 1 it is assumed that the service log of this service is service log 1, service identifiers are " 001 ".Can Choosing, when telegon creates service log 1, a tree structure can be created, and this service log 1 is the root of this tree structure Node.
During node 1 is processed to the service 1 of client request, node 1 determines needs to call node 2 (the One from node), and send asynchronous call request to telegon, the request of this asynchronous call includes " b " (node identification of node 2) " 001 " (mark of service 1).
Telegon is asked according to this asynchronous call, calls record 1 in 1 time establishment of service log, and this calls record 1 to include Call mark " ab ", optionally, call record 1 can hang in the node of the tree structure with service log 1 as root node.
Telegon calls node 2 that asynchronous call request is processed, and after node 2 determines to obtain result, saves Point 2 sends this result to telegon, so that telegon is calling this result record in record 1.Meanwhile, telegon Also " 001-ab " is defined as the identification information calling record 1 for searching this, and sends this identification information to node 1.
During node 1 is processed to the service 1 of client request, node 1 determines the from node needing to call Including node 2 and node 3, and when node 1 calls node 3, node 1 needs to pass to the result of node 2 as parameter Node 3 (node 3 needs the result using node 2), then telegon according to this dependence, node 3 is defined as second From node.
When node 1 needs to call node 3, node 1 sends to node 3 without waiting for the result of node 2, node 1 Identification information " 001-ab ", so that node 3 can obtain result according to this identification information " 001-ab " from telegon.
When node 3 needs the result using node 2, node 3 obtains request to telegon transmission processe result, and Result obtain request in carry identification information " 001-ab ", telegon according to this identification information, in service identifiers " 001 " Search in corresponding service log 1 and call that mark " ab " is corresponding to call record 1, and judge to call in record 1 with the presence or absence of locating Reason result.
If existing, telegon directly obtains result in calling record 1, and to node 3 transmission processe result.
If not existing, the mark " c " of node 3 is added wait list by telegon, exists and process knot in calling record 1 During fruit, telegon obtains result, and to node 3 transmission processe result, meanwhile, the mark " c " of node 3 is also moved by telegon Go out to wait list.
In above process, after node 1 calls to node 2, when node 1 needs node 3 is called, node 1 without waiting for node 2 result, and then allow node 1 to carry out parallel calling to node 2 and node 3, and then improve The efficiency of asynchronous process.
The structural representation of the telegon that Fig. 6 provides for the present invention, this telegon is located in distributed system, and this is distributed At least two service nodes are also included in system.Wherein, being provided the service node of service by client request is host node, by institute Stating host node and calling the service node to complete described service is from node.Refer to Fig. 6, described telegon includes receiver module 11st, processing module 12 and sending module 13, wherein,
Described receiver module 11 is used for, and receiving described host node please based on the asynchronous call that the service of client request is initiated Ask, described asynchronous call request includes the node identification of from node to be called.
Described processing module 12 is used for, according to described asynchronous call request create this call call record, call with The corresponding from node of described node identification is processed to the request of described asynchronous call.
Described receiver module 11 is additionally operable to, and receives the result that described from node sends.
Described processing module 12 is additionally operable to, and described result record is called in record described.
Described receiver module 11 is additionally operable to, and receives in the service of described client request, needs using described result Service node send result obtain request, described need using described result service node be described main section Other from nodes that point calls in described service.
Described processing module 12 is additionally operable to, and obtains described result from described calling record.
Described sending module 13 is used for, and needs to send described process knot using the service node of described result to described Really.
Telegon provided in an embodiment of the present invention can execute the technical scheme shown in Fig. 2 embodiment, its realize principle with And beneficial effect no longer can be repeated referring specifically to the embodiment shown in Fig. 2 herein.
In a kind of possible embodiment, described processing module 12 can also be according to the S204 in embodiment illustrated in fig. 2 It is configured to described in searching, call the identification information of record, it realizes principle and beneficial effect is similar to, and is no longer gone to live in the household of one's in-laws on getting married herein State.Accordingly, described sending module 13 can send described identification information to described host node, and by described host node to institute State host node described service in call, need using described result from node send described identification information.
Optionally, described call record also to include calling mark for identify that this calls, accordingly, described process mould Block 12 can method construct according to the S204 in embodiment illustrated in fig. 2 be used for searching described in call the mark of record to believe Breath, it realizes principle and beneficial effect is similar to, and is no longer repeated herein.
In alternatively possible embodiment, described result obtains in request and carries described identification information;Accordingly , described processing module 12 can obtain described result according to embodiment illustrated in fig. 3 from described calling record, its realization Principle and beneficial effect are similar to, and are no longer repeated herein.
In alternatively possible embodiment, described processing module 12 can also be according in embodiment illustrated in fig. 4 S402 creates the service log including the service identifiers for searching service log, and it realizes principle and beneficial effect is similar to, No longer repeated herein.Accordingly, described sending module 13 can send described service identifiers to described host node;So that institute Described service identifiers are carried, so, described processing module 12 is creating institute in the described asynchronous call request stating host node initiation State when calling record, record can be called according to described service identifiers to create under described service log by described.
In alternatively possible embodiment, described receiver module 11 is additionally operable to, and receives described host node based on described The service-creation request that the service of client request sends, so that processing module 12 can be with the side shown in S402 in Fig. 4 embodiment Method creates the service log of this service, and it realizes principle and beneficial effect is similar to, and is no longer repeated herein.
In alternatively possible embodiment, described processing module 12 can be according to S410 institute in embodiment illustrated in fig. 4 The method construct showing calls the identification information of record described in being used for searching, and it realizes principle and beneficial effect is similar to, herein not Repeated again.
In alternatively possible embodiment, described service log and described calling are recorded as tree;Described tree Shape structure, with described service log as root node, described calls the child node being recorded as being articulated under described root node.This kind of reality Apply the service log in mode and call the form of record to may refer to such as Fig. 5, no longer repeated herein.
The structural representation one of the service node that Fig. 7 provides for the present invention, described service node is in distributed system Host node, described distributed system includes telegon and at least two service nodes.Wherein, provided service by client request Service node is described host node, is called the service node to complete described service to be from node by described host node.Refer to Fig. 7, described host node includes processing module 21 and sending module 22, wherein,
Described processing module 21 is used for, and according to the service of client request, determines the from node needing to call.
Described sending module 22 is used for, and sends to described telegon and calls the asynchronous call of the first from node to ask, passes through Described telegon calls described first from node to process described asynchronous call request and to record described first from node to institute State the result of asynchronous call request;Described first from node is in the described from node that the needs determined call Individual.
Described processing module 21 is additionally operable to, the dependence between each from node called as needed, identifies described Need to need in the from node called using described first from node to the second of the result that described asynchronous call is asked from Node.
Described processing module 21 is additionally operable to, and calls described second from node, and is calling the process of described second from node The middle process knot indicating that described second from node is asked to described asynchronous call from described first from node of described telegon acquisition Really.
Service node provided in an embodiment of the present invention can execute the technical scheme shown in Fig. 2 embodiment, and it realizes principle And beneficial effect may refer to the embodiment shown in Fig. 2, no longer repeated herein.
The structural representation two of the service node that Fig. 8 provides for the present invention, on the basis of embodiment illustrated in fig. 7, please join See Fig. 8, described host node also includes receiver module 23, wherein,
Described sending module 22 is additionally operable to, the service initiated according to client in described processing module 21, determines and needs to adjust Before node, service-creation request is sent to described telegon according to the S401 in Fig. 4 embodiment, so that described telegon Asked according to described service-creation, create the service log of this service, it realizes principle and beneficial effect is similar to, herein not Repeated again.Accordingly, described receiver module 23 is used for receiving the mark of the described service that described telegon sends.Accordingly , described asynchronous call request includes described service identifiers and the mark of described first from node.
Optionally, sending to described telegon in described sending module 22 calls the asynchronous call of the first from node to ask it Afterwards, described receiver module 23 be additionally operable to receive that described telegon sends, be used for searching described asynchronous call and ask corresponding tune Identification information with record.Accordingly, described sending module 22 is additionally operable to, and sends described mark letter to described second from node Breath, so that described second from node obtains described first from node to described different according to described identification information in described telegon The result of step call request.
The hardware configuration of the telegon that Fig. 9 provides for the present invention is illustrated, and this telegon is located in distributed system, described point At least two service nodes are also included in cloth system.Wherein, the service node being provided service by client request is host node, Called the service node to complete described service to be from node by described host node.Described telegon includes receiver 31, processes Device 32, transmitter 33, memory 34 and communication bus 35 for storing application program, described processor 32 is used for according to institute State the application program execution corresponding operating in memory 34, communication bus 35 is used for realizing the communication connection between element, wherein,
Described receiver 31 is used for, and receiving described host node please based on the asynchronous call that the service of client request is initiated Ask, described asynchronous call request includes the node identification of from node to be called.
Described processor 32 is used for, and what according to the request establishment of described asynchronous call, this called calls record, calls and institute State the corresponding from node of node identification the request of described asynchronous call is processed.
Described receiver 31 is additionally operable to, and receives the result that described from node sends.
Described processor 32 is additionally operable to, and described result record is called in record described.
Described receiver 31 is additionally operable to, and receives in the service of described client request, needs using described result Service node send result obtain request, described need using described result service node be described host node The other from nodes called in described service.
Described processor 32 is additionally operable to, and obtains described result from described calling record.
Described transmitter 33 is used for, and needs to send described process knot using the service node of described result to described Really.
Optionally, described processor 32 is additionally operable to, and is configured to call the identification information of record described in searching.Described transmission Device 33 is additionally operable to, and sends described identification information to described host node, and passes through described host node to described host node in described clothes Calling in business, need using described result from node send described identification information.
Optionally, described processor 32 create described in call record also to include calling mark for identify that this calls Know, described processor 32 is configured to call the identification information of record to specifically include described in lookup:Directly call mark with described As the identification information calling record described in lookup, or, construction is based on the described handle object calling mark as lookup institute State the identification information calling record.
Telegon provided in an embodiment of the present invention can execute the technical scheme shown in Fig. 2 embodiment, its realize principle with And beneficial effect no longer can be repeated referring specifically to the embodiment shown in Fig. 2 herein.
In a kind of possible embodiment, described result obtains in request and carries described identification information.
Accordingly, described processor 32 obtains described result and specifically includes from described calling record:
Call record according to described identification information is searched, and call described in judging and in record, whether there is described process Result.
If so, then described processor 32 is used for obtaining described result.
If it is not, then the described mark needing the node using described result is added wait row by described processor 32 Table, and described call there is described result in record when, obtain described result, and need described using described The mark of the node of result removes described wait list.
In this kind of possible embodiment, telegon realize principle and beneficial effect can be referring specifically to Fig. 3 institute The embodiment shown, is no longer repeated herein.
In alternatively possible embodiment, described processor 32 is additionally operable to, the service based on described client request Create the service log of this service, described service log includes the service identifiers for searching described service log.
Described transmitter 33 is additionally operable to, and sends described service identifiers to described host node.
Described service identifiers are carried, described processor 32 is creating in the described asynchronous call request that described host node is initiated Described when calling record, call record to create under described service log according to described service identifiers by described.
Optionally, described receiver 31 is additionally operable to, and receives the service based on described client request for the described host node and sends Service-creation request.
Described processor 32 specifically includes according to the service log that the request of described service-creation creates this service:According to institute State service-creation request, create the service log of this service.
In this kind of possible embodiment, telegon realize principle and beneficial effect can be referring specifically to Fig. 4 institute Show the S401-S402 in embodiment, no longer repeated herein.
In alternatively possible embodiment, described processor 32 is configured to call the mark of record to believe described in lookup Breath specifically includes:
By described service identifiers and described call mark be combined as searching described in call the identification information of record, or, Construction is based on described service identifiers and the described handle object calling mark as the identification information calling record described in lookup.
In this kind of possible embodiment, telegon realize principle and beneficial effect can be referring specifically to Fig. 4 institute Show the S410 in embodiment, no longer repeated herein.
In alternatively possible embodiment, described service log and described calling are recorded as tree;Described tree Shape structure, with described service log as root node, described calls the child node being recorded as being articulated under described root node.
In this kind of possible embodiment, telegon realize principle and beneficial effect can be referring specifically to Fig. 4 institute Show the S402-S406 in embodiment, no longer repeated herein.
The hardware architecture diagram one of the service node that Figure 10 provides for the present invention, described service node is distributed system In host node, described distributed system includes telegon and at least two service nodes, wherein, is provided clothes by client request The service node of business is described host node, is called the service node to complete described service to be from node by described host node.Please Referring to Figure 10, it is total that described host node includes processor 41, transmitter 42, the memory 43 being used for storing application program and communication Line 44, described processor 41 is used for according to the application program execution corresponding operating in described memory 43, and communication bus 44 is used for Realize the communication connection between element, wherein,
Described processor 41 is used for, and according to the service of client request, determines the from node needing to call.
Described transmitter 42 is used for, and sends to described telegon and calls the asynchronous call of the first from node to ask, by institute Stating telegon calls described first from node to process described asynchronous call request and to record described first from node to described The result of asynchronous call request;Described first from node is one of described from node that the needs determined call.
Described processor 41 is additionally operable to, the dependence between each from node called as needed, identifies described need Need in from node to be called using described first from node to the second of the result that described asynchronous call is asked from section Point.
Described processor 41 is additionally operable to, and calls described second from node, and during calling described second from node Indicate that described second from node obtains, from described telegon, the result that described first from node is asked to described asynchronous call.
Service node provided in an embodiment of the present invention can execute the technical scheme shown in Fig. 2 embodiment, and it realizes principle And beneficial effect may refer to the embodiment shown in Fig. 2, no longer repeated herein.
The hardware architecture diagram two of the service node that Figure 11 provides for the present invention, on the basis of embodiment illustrated in fig. 10 On, refer to Figure 11, described host node also includes receiver 45, wherein,
Described transmitter 42 is additionally operable to, the service initiated according to client in described processor 41, determines what needs called Before node, based on the service of described client request, send service-creation request to described telegon, so that described telegon Asked according to described service-creation, create the service log of this service, described service log is included for searching described clothes The service identifiers of business record.
Described receiver 45 is used for, and receives the mark of the described service that described telegon sends.
Accordingly, described asynchronous call request includes described service identifiers and the mark of described first from node.
In this kind of possible embodiment, service node realize principle and beneficial effect can be referring specifically to Fig. 4 S401-S402 in illustrated embodiment, is no longer repeated herein.
Optionally, sending to described telegon in described transmitter 42 calls the asynchronous call of the first from node to ask it Afterwards, described receiver 45 be additionally operable to receive that described telegon sends, be used for searching that described asynchronous call request is corresponding to call The identification information of record.
Accordingly, described transmitter 42 is additionally operable to, and sends described identification information to described second from node, so that described the Two from nodes obtain what described first from node was asked to described asynchronous call according to described identification information in described telegon Result.
In this kind of possible embodiment, service node realize principle and beneficial effect can be referring specifically to Fig. 4 S411, S413 in illustrated embodiment, is no longer repeated herein.
The embodiment of the present invention also provides a kind of distributed system, including the telegon shown in Fig. 9 embodiment, Figure 10 or Figure 11 Shown service node and at least one described service node call to complete to service from service node, wherein,
Described telegon is used for storing the corresponding result of each asynchronous call in described service, so that described service node With each described from service node when needing using described result, obtain described result from described telegon.
One of ordinary skill in the art will appreciate that:The all or part of step realizing above-mentioned each method embodiment can be led to Cross the related hardware of programmed instruction to complete.Aforesaid program can be stored in a computer read/write memory medium.This journey Sequence upon execution, executes the step including above-mentioned each method embodiment;And aforesaid storage medium includes:ROM, RAM, magnetic disc or Person's CD etc. is various can be with the medium of store program codes.
Finally it should be noted that:Various embodiments above only in order to technical scheme to be described, is not intended to limit;To the greatest extent Pipe has been described in detail to the present invention with reference to foregoing embodiments, it will be understood by those within the art that:Its according to So the technical scheme described in foregoing embodiments can be modified, or wherein some or all of technical characteristic is entered Row equivalent;And these modifications or replacement, do not make the essence of appropriate technical solution depart from various embodiments of the present invention technology The scope of scheme.

Claims (23)

1. a kind of asynchronous call processing method it is characterised in that be applied to including telegon and at least two service nodes point Cloth system, wherein, the service node being provided service by client request is host node, is called to complete institute by described host node The service node stating service is from node, and methods described includes:
Described telegon receives the asynchronous call request that described host node is initiated, described asynchronous tune based on the service of client request Include the node identification of from node to be called with request;
Described telegon according to described asynchronous call request create this call call record, call and described node identification pair The from node answered is processed to the request of described asynchronous call;
Described telegon receives the result that described from node sends, and described result record is called record described In;
Described telegon receives in the service of described client request, need to send using the service node of described result Result obtain request, described need using described result service node be described host node described service in tune Other from nodes;
Described telegon obtains described result from described calling record, and needs using described result to described Service node sends described result.
2. method according to claim 1 is it is characterised in that methods described also includes:
Described telegon is configured to call the identification information of record described in lookup, sends described identification information to host node, and By described host node to described host node described service in call, need using described result from node send Described identification information.
3. method according to claim 2 carries described mark letter it is characterised in that described result obtains in request Breath;
Described telegon obtains described result from described calling record, including:
Described telegon calls record according to described identification information is searched;
Described telegon calls in record with the presence or absence of described result described in judging;
If so, then described telegon obtains described result;
If it is not, then the described mark needing the node using described result is added wait list by described telegon, and Described call when there is described result in record, obtain described result, and need to process knot using described by described The mark of the node of fruit removes described wait list.
4. according to the method in claim 2 or 3 it is characterised in that calling record also to wrap described in the establishment of described telegon Include for identifying the mark of calling that this calls, described be configured to search described in call the identification information of record to specifically include:
Described telegon directly calls mark as the identification information calling record described in lookup using described, or, construction is based on The described handle object calling mark is as the identification information calling record described in lookup.
5. according to the method in claim 2 or 3 it is characterised in that methods described also includes:
The service log of this service of the service-creation based on described client request for the described telegon, wraps in described service log Include the service identifiers for searching described service log, send described service identifiers to described host node;
Described service identifiers are carried, described telegon is creating described tune in the described asynchronous call request that described host node is initiated During with record, record is called to create under described service log according to described service identifiers by described.
6. method according to claim 5 it is characterised in that the described service-creation based on described client request this The service log of service specifically includes:
Described telegon receives the service-creation request that described host node is sent based on the service of described client request;
Described telegon is asked according to described service-creation, creates the service log of this service.
7. the method according to claim 5 or 6 is it is characterised in that described be configured to call the mark of record described in lookup Knowledge information specifically includes:
Described telegon by described service identifiers and described call mark be combined as searching described in call the identification information of record, Or, construction calls the mark of record to believe based on described service identifiers and the described handle object calling mark as described in lookup Breath.
8. method according to claim 5 is it is characterised in that described service log and described calling are recorded as tree-shaped knot Structure;Described tree structure, with described service log as root node, described calls the son section being recorded as being articulated under described root node Point.
9. a kind of asynchronous call processing method it is characterised in that be applied to including telegon and at least two service nodes point Cloth system, wherein, the service node being provided service by client request is host node, is called to complete institute by described host node The service node stating service is from node, and methods described includes:
Described host node, according to the service of client request, determines the from node needing to call;
Described host node sends to described telegon and calls the asynchronous call of the first from node to ask, and is called by described telegon Described first from node is processing the request of described asynchronous call and to record described first from node described asynchronous call is asked Result;Described first from node is one of described from node that the needs determined call;
Dependence between each from node that described host node calls as needed, identifies the from node that described needs call Middle need the second from node to the result that described asynchronous call is asked using described first from node;
Described host node calls described second from node, and indicate during calling described second from node described second from Node obtains, from described telegon, the result that described first from node is asked to described asynchronous call.
10. method according to claim 9 is it is characterised in that in the service initiated according to client, determine that needs call Node before, also include:
The service based on described client request for the described host node, sends service-creation request to described telegon, so that described Telegon is asked according to described service-creation, creates the service log of this service, and described service log is included for searching The service identifiers of described service log;
Described host node receives the described service identifiers that described telegon sends;
Accordingly, described asynchronous call request includes described service identifiers and the mark of described first from node.
11. methods according to claim 9 or 10 are it is characterised in that described host node calls to the transmission of described telegon After the asynchronous call request of the first from node, also include:
Described host node receives that described telegon sends, for searching the described asynchronous call corresponding mark calling record of request Knowledge information;
Accordingly, indicate that described second from node obtains from described telegon during calling described second from node described The result that first from node is asked to described asynchronous call, including:
To described second from node send described identification information so that described second from node according to described identification information described The result that described first from node is asked is obtained to described asynchronous call in telegon.
A kind of 12. telegons, it is characterised in that being located in distributed system, also include at least two in described distributed system Service node, wherein, the service node being provided service by client request is host node, is called to complete institute by described host node The service node stating service is from node, and described telegon includes receiver module, processing module and sending module, wherein,
Described receiver module is used for, and receives the asynchronous call request that described host node is initiated, institute based on the service of client request State the node identification that asynchronous call request includes from node to be called;
Described processing module is used for, and what according to the request establishment of described asynchronous call, this called calls record, calls and described section The corresponding from node of point identification is processed to the request of described asynchronous call;
Described receiver module is additionally operable to, and receives the result that described from node sends;
Described processing module is additionally operable to, and described result record is called in record described;
Described receiver module is additionally operable to, the service receive in the service of described client request, needing using described result The result that node sends obtains request, and the described service node needing using described result is for described host node in institute State the other from nodes called in service;
Described processing module is additionally operable to, and obtains described result from described calling record;
Described sending module is used for, and needs to send described result using the service node of described result to described.
13. telegons according to claim 12 it is characterised in that
Described processing module is additionally operable to, and is configured to call the identification information of record described in searching;
Described sending module is additionally operable to, and sends described identification information to described host node, and by described host node to described master Node described service in call, need using described result from node send described identification information.
14. telegons according to claim 13 carry described mark it is characterised in that described result obtains in request Knowledge information;
Accordingly, described processing module obtains described result and specifically includes from described calling record:
Call record according to described identification information is searched, and call described in judging to whether there is in record and described process knot Really;
If so, then described processing module is used for obtaining described result;
If it is not, then the described mark needing the node using described result is added wait list by described processing module, and Described call there is described result in record when, obtain described result, and need described using described process The mark of the node of result removes described wait list.
15. telegons according to claim 13 or 14 are it is characterised in that call note described in the establishment of described processing module Record also includes calling mark for identify that this calls, described processing module be configured to search described in call the mark of record Information specifically includes:
Directly using the described identification information calling and identifying as calling record described in lookup, or, construction calls mark based on described The handle object known is as the identification information calling record described in lookup.
16. telegons according to claim 13 or 14 it is characterised in that
Described processing module is additionally operable to, the service log of this service of the service-creation based on described client request, described clothes Business record includes the service identifiers for searching described service log;
Described sending module is additionally operable to, and sends described service identifiers to described host node;
Described service identifiers are carried, described processing module is described in establishment in the described asynchronous call request that described host node is initiated When calling record, record is called to create under described service log according to described service identifiers by described.
17. telegons according to claim 16 it is characterised in that
Described receiver module is additionally operable to, and receiving described host node please based on the service-creation that the service of described client request sends Ask;
Described processing module specifically includes according to the service log that the request of described service-creation creates this service:According to described clothes Business request to create, creates the service log of this service.
18. telegons according to claim 16 or 17 are it is characterised in that described processing module is configured to described in lookup The identification information calling record specifically includes:
By described service identifiers and described call mark be combined as searching described in call the identification information of record, or, construction Based on described service identifiers and the described handle object calling mark as the identification information calling record described in lookup.
19. telegons according to claim 16 are it is characterised in that described service log and described calling are recorded as tree-shaped Structure;Described tree structure, with described service log as root node, described calls the son being recorded as being articulated under described root node Node.
A kind of 20. service nodes are it is characterised in that described service node is the host node in distributed system, described distributed System includes telegon and at least two service nodes, and wherein, the service node being provided service by client request is described master Node, is called the service node to complete described service to be from node, described host node includes processing module by described host node And sending module, wherein,
Described processing module is used for, and according to the service of client request, determines the from node needing to call;
Described sending module is used for, and sends to described telegon and calls the asynchronous call of the first from node to ask, by described association Device is adjusted to call described first from node to process described asynchronous call request and to record described first from node to described asynchronous The result of call request;Described first from node is one of described from node that the needs determined call;
Described processing module is additionally operable to, the dependence between each from node called as needed, identify described need adjust The second from node to the result that described asynchronous call is asked using described first from node is needed in from node;
Described processing module is additionally operable to, and calls described second from node, and indicates during calling described second from node Described second from node obtains, from described telegon, the result that described first from node is asked to described asynchronous call.
21. service nodes according to claim 20 it is characterised in that described service node also includes receiver module, its In,
Described sending module is additionally operable to, the service initiated according to client in described processing module, determines the node needing to call Before, the service based on described client request, to described telegon send service-creation request so that described telegon according to Described service-creation request, creates the service log of this service, and described service log is included for searching described service note The service identifiers of record;
Described receiver module is used for, and receives the mark of the described service that described telegon sends;
Accordingly, described asynchronous call request includes the mark of described service and the mark of described first from node.
22. service nodes according to claim 21 are it is characterised in that send to described telegon in described sending module After calling the asynchronous call of the first from node to ask, described receiver module be additionally operable to receive that described telegon sends, be used for Search described asynchronous call and ask the corresponding identification information calling record;
Accordingly, described sending module is additionally operable to, to described second from node send described identification information so that described second from Node obtains, according to described identification information, the process that described first from node is asked to described asynchronous call in described telegon Result.
A kind of 23. distributed systems are it is characterised in that include the telegon described in any one of claim 12-19, claim Service node described in any one of 20-22.
CN201610944766.4A 2016-11-02 2016-11-02 Asynchronous call processing method, device and distributed system Active CN106453592B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610944766.4A CN106453592B (en) 2016-11-02 2016-11-02 Asynchronous call processing method, device and distributed system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610944766.4A CN106453592B (en) 2016-11-02 2016-11-02 Asynchronous call processing method, device and distributed system

Publications (2)

Publication Number Publication Date
CN106453592A true CN106453592A (en) 2017-02-22
CN106453592B CN106453592B (en) 2020-05-08

Family

ID=58177691

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610944766.4A Active CN106453592B (en) 2016-11-02 2016-11-02 Asynchronous call processing method, device and distributed system

Country Status (1)

Country Link
CN (1) CN106453592B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108919756B (en) * 2018-06-25 2020-07-28 首都师范大学 Method for loading and calling CPS node function processing method
WO2022206429A1 (en) * 2021-03-30 2022-10-06 华为云计算技术有限公司 Distributed transaction implementation method and distributed system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101056429A (en) * 2007-05-29 2007-10-17 华为技术有限公司 Universal service system and its implementation method
CN101447981A (en) * 2008-04-03 2009-06-03 中兴通讯股份有限公司 Client-server interaction method based on LDAP protocol and system thereof
US7770188B2 (en) * 2006-04-20 2010-08-03 Microsoft Corporation Winsock APIs
CN105099989A (en) * 2014-04-24 2015-11-25 阿里巴巴集团控股有限公司 Service request processing and service processing result acquiring method, device and system
CN105159786A (en) * 2015-07-03 2015-12-16 北京奇虎科技有限公司 Method and device for inter-process communication
CN105516086A (en) * 2015-11-25 2016-04-20 广州华多网络科技有限公司 Service processing method and apparatus
CN105700937A (en) * 2016-01-04 2016-06-22 北京百度网讯科技有限公司 Multi-thread task processing method and device
CN105872578A (en) * 2016-03-30 2016-08-17 青岛海信电器股份有限公司 Invoking method and server

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7770188B2 (en) * 2006-04-20 2010-08-03 Microsoft Corporation Winsock APIs
CN101056429A (en) * 2007-05-29 2007-10-17 华为技术有限公司 Universal service system and its implementation method
CN101447981A (en) * 2008-04-03 2009-06-03 中兴通讯股份有限公司 Client-server interaction method based on LDAP protocol and system thereof
CN105099989A (en) * 2014-04-24 2015-11-25 阿里巴巴集团控股有限公司 Service request processing and service processing result acquiring method, device and system
CN105159786A (en) * 2015-07-03 2015-12-16 北京奇虎科技有限公司 Method and device for inter-process communication
CN105516086A (en) * 2015-11-25 2016-04-20 广州华多网络科技有限公司 Service processing method and apparatus
CN105700937A (en) * 2016-01-04 2016-06-22 北京百度网讯科技有限公司 Multi-thread task processing method and device
CN105872578A (en) * 2016-03-30 2016-08-17 青岛海信电器股份有限公司 Invoking method and server

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108919756B (en) * 2018-06-25 2020-07-28 首都师范大学 Method for loading and calling CPS node function processing method
WO2022206429A1 (en) * 2021-03-30 2022-10-06 华为云计算技术有限公司 Distributed transaction implementation method and distributed system

Also Published As

Publication number Publication date
CN106453592B (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN103500191B (en) Flow table configuration, query and table item deleting method and device
CN106649632B (en) Method of data synchronization and system
JP2016534456A (en) Method and apparatus for storing data
CN105260485B (en) A kind of method and apparatus of data load
US9294390B2 (en) Hash table storage and search methods and devices
CN103701653B (en) The processing method of a kind of interface hot plug configuration data and network configuration server
CN109743346B (en) Session flow configuration method, device and computer-readable storage medium
CN107305570B (en) Data retrieval method and system
CN109933585B (en) Data query method and data query system
CN105610971B (en) A kind of load-balancing method and device
CN104301990B (en) A kind of method and device of data syn-chronization
WO2017097124A1 (en) Method, apparatus and system for transmitting tasks based on sub-libraries and sub-tables
CN110941741A (en) Path search processing method, device, server and storage medium for graph data
CN107623731A (en) A kind of method for scheduling task, client, service cluster and system
CN106453592A (en) Asynchronous call processing method and apparatus, and distributed system
CN115470236A (en) Multi-subgraph matching method, device and equipment
CN110995489A (en) Large data platform server management method, device, server and storage medium
CN109361625A (en) Verify the method, apparatus and controller of forwarding-table item
CN110505276A (en) Object matching method, apparatus and system, electronic equipment and storage medium
CN105095455A (en) Data connection optimization method and data operation system
CN106533818B (en) Monitoring method and communication method, system and equipment based on NFV resource pool
CN112261097B (en) Object positioning method for distributed storage system and electronic equipment
CN106469168B (en) The method and device that diversiform data is handled in data integrated system
US20180357119A1 (en) File information collection system and method, and storage medium
CN111339089B (en) Data storage and acquisition method and device applied to blockchain

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

Effective date of registration: 20211118

Address after: 215010 room 704, building 5, No. 556, Changjiang Road, high tech Zone, Suzhou, Jiangsu

Patentee after: SUZHOU YUDESHUI ELECTRICAL TECHNOLOGY Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.