Summary of the invention
The invention process provides a kind of method of distributed multi-service logic asynchronous processing, in order to solve the big problem of length consuming time, calculating pressure that exists in the data processing in enormous quantities.
The method of a kind of distributed multi-service logic asynchronous processing that the embodiment of the invention provides comprises:
Client is according to the business of a server issue in the described system, and at least one business determining current request is current accessible business, comprises the current accessible business of other server in current accessible business of described server and the described system;
Client is obtained from described server and described at least one professional corresponding tag template, and by described tag template generation and every professional corresponding label, the business datum that each label is handled with needs is submitted to described server, described label is meant and comprises identification data source, state, target, and the structural data that comprises the desired related data of business processing interface, wherein, the source is meant the Data Source sign of record data unit; State is meant the situation that record data are current, and comprises parameter information or the contextual information that need submit to target processing, and the data type of the current definition of system, status indicator and handle history information; Target is meant data element delivery service device address and corresponding service Processing Interface sign, comprises the desired related data of business processing interface and is meant the supplemental characteristic that calls the submission of business processing interface requirement;
Described server is according to this business corresponding service Processing Interface sign that writes down in each label, and corresponding service Processing Interface in the server of every business of definite processing and this server is called described business processing interface and carried out corresponding service processing.
The system of a kind of distributed multi-service logic asynchronous processing that the embodiment of the invention provides comprises:
First server, be used to issue current accessible business, the tag template of described business is provided to client, and when at least one the business processing request that receives client, according to the information that writes down in the label that receives, determine to handle the server of every business, and when definite described server is not book server, the information that writes down in the label according to this business correspondence, described label and business datum are transmitted to the corresponding server processing, described label is meant and comprises the identification data source, state, target, and the structural data that comprises the desired related data of business processing interface, wherein, the source is meant the Data Source sign of record data unit; State is meant the situation that record data are current, and comprises parameter information or the contextual information that need submit to target processing, and the data type of the current definition of system, status indicator and handle history information; Target is meant data element delivery service device address and corresponding service Processing Interface sign, comprises the desired related data of business processing interface and is meant the supplemental characteristic that calls the submission of business processing interface requirement;
Second server is used to receive the label and the business datum of described first server forwards, and calls the corresponding service processing interface and handle;
Client, be used for when at least one business determining request is described first server issue professional, from described first server, obtain and described at least one professional corresponding tag template, and, the business datum that each label is handled with needs is submitted to described first server by described tag template generation and every professional corresponding label.
The server of a kind of distributed multi-service logic asynchronous processing that the embodiment of the invention provides comprises:
Administration module is used to issue current accessible business, and the tag template of described business is provided to client;
The letter sorting module, be used for the information that writes down according to each label of receiving from described client, determine to handle the server address of every business, and when definite described server is not book server, the information that writes down in the label according to this business correspondence, described label and business datum are transmitted to the corresponding server processing, described label is meant and comprises identification data source, state, target, and the structural data that comprises the desired related data of business processing interface, wherein, the source is meant the Data Source sign of record data unit; State is meant the situation that record data are current, and comprises parameter information or the contextual information that need submit to target processing, and the data type of the current definition of system, status indicator and handle history information; Target is meant data element delivery service device address and corresponding service Processing Interface sign, comprises the desired related data of business processing interface and is meant the supplemental characteristic that calls the submission of business processing interface requirement;
Scheduler module, be used for when described letter sorting module determine to handle that wherein the server of a business is book server, according to the information of the tag record of this business correspondence, determine to handle this professional business processing interface, and call this business processing interface described business is handled.
The client of a kind of distributed multi-service logic asynchronous processing that the embodiment of the invention provides comprises:
Acquisition module is used for when at least one business determining request is the current accessible business of a server issue of system, obtains from described server and described at least one professional corresponding tag template;
Submit module to, generate and every professional corresponding label by described tag template, the business datum that each label is handled with needs is submitted to described server, described label is meant and comprises identification data source, state, target, and the structural data that comprises the desired related data of business processing interface, wherein, the source is meant the Data Source sign of record data unit; State is meant the situation that record data are current, and comprises parameter information or the contextual information that need submit to target processing, and the data type of the current definition of system, status indicator and handle history information; Target is meant data element delivery service device address and corresponding service Processing Interface sign, comprises the desired related data of business processing interface and is meant the supplemental characteristic that calls the submission of business processing interface requirement.
In the embodiment of the invention, a server in the system is according to the occupation condition of other server in current self and the system, issue current manageable business to client, client can be according to the type of service of this server issue, submit one or multinomial business processing request to this server, and label is set, described label sends to this server with the business datum of Request Processing, this server is according to the information that writes down in the label, call corresponding server and the business processing interface is handled accordingly to described business datum, like this, realized the dispersion treatment of large batch of data, the time that has been consumed when having reduced centralized data processing, the while has also alleviated the calculating pressure of computing machine.
Embodiment
In the embodiment of the invention, a server in the system is according to the situation of the utilization of resources of other server in self and the system, registration and issue disclose current accessible business, client can be according to the business of described server issue, to this server requests corresponding one or multinomial business processing, before one of transmission or multinomial business processing request, obtain every professional corresponding label model from described server earlier, according to each label model requirement, record and every data that task is relevant, the business datum that each label is handled with needs sends to described server then, this server is according to the information that writes down in each label, determine to handle each professional business interface, call the corresponding business interface then each business is handled.Like this, the data in enormous quantities that needs focus on are carried out dispersion treatment, reduced the pressure that calculates, shortened the follow-up time that this batch data is handled.
Below in conjunction with Figure of description the specific embodiment of the present invention is elaborated.
As shown in Figure 1, the method for distributed service logic asynchronous process mainly may further comprise the steps in the invention process:
Step 100: client is according to the business of a server issue in the system, and at least one business determining current request is current accessible business.
Wherein, described server is according to the operating position of other server resource in current self and the system, determines current manageable business, and is then that described service distribution is open, specifically comprises:
Step 100a: the current accessible business of each Service Component of other server in described server registers book server and the system is provided with each professional configuration information.
Wherein, Service Component is to be used for the assembly of managing business in the server specially, and a Service Component can comprise one or more business processing interfaces, and each business processing interface is handled a business, each business processing interface configuration structurized data, i.e. a label.For each business setting configuration information, data structure in the label is set exactly.
Wherein, label is meant and comprises identification data source, state, target, and the structural data that comprises the desired related data of business processing interface, and wherein, the source is meant the Data Source sign of record data unit; State is meant the situation that record data are current, and comprises parameter information or the contextual information that need submit to target processing, and the data type of the current definition of system, status indicator and handle information such as historical record; Target is meant data element delivery service device address and corresponding service Processing Interface sign, comprises the desired related data of business processing interface and is meant the supplemental characteristic that calls the submission of business processing interface requirement.
Label can also nested subtab.The corresponding label of each calling service interface, a business processing assembly can comprise 1 to a plurality of calling service interfaces, and promptly a business processing assembly can comprise 1 to a plurality of labels.
For example, in Rail Transit System, bill is divided into two kinds: all-purpose card and electronics ticket money, wherein there is 5% discount rate in all-purpose card.Need carry out bill data day statistics, Zhou Tongji, month statistics and all-purpose card discount money day statistics.
Server comprises bill day statistics, Zhou Tongji, month statistics and adds up these four business processing assemblies all-purpose card discount money day, these four business processing assemblies respectively comprise a business processing interface, each interface is provided with corresponding label, and its business processing interface identifier is respectively: server1-001, sever1-002, sever1-003 and sever1-004.Wherein, the label definition of the business processing interface correspondence of day statistics may comprise following content:
<tag1 name=" day statistics "
<source>client</source>
<state>valid</state>
<object>server1-001</object>
</tag1>
<datas>
<data?id=”ID”>
<enter?type=”float”></enter>
<exit?type=”float”></exit>
<ticket?type=”int”></ticket>
</data>
</datas>
Wherein desired data are the enter the station amount of money, the departures amount of money and the electronics ticket money amount of money of all-purpose card, and variable name is respectively enter, exit and ticket, and wherein ID is the sign of electronics ticket money or all-purpose card.
For access rights are limited, when configuration information, also should dispose the access rights of corresponding service, such as, specify this business to initiate service request etc. by which client.
Step 100b: described server is openly issued current accessible business in default scope.
Described server registers after the accessible business, according to default scope, announce to client.
Client is before sending service request, whether need this business of inquiry is that server has openly been issued, because all server can only be handled the business that discloses in the system, if determining the business asked is that server discloses, then obtain the tag template of this business correspondence from described server end.
Step 110: client is obtained from described server and described at least one professional corresponding tag template, and, the business datum that each label is handled with needs is submitted to described server by described tag template generation and every professional corresponding label.
Client is according to the tag template that obtains, in conjunction with every service conditions, in corresponding label, wherein Ji Lu data comprise with concrete content record: this professional Data Source, current situation, and handle this professional server address and business processing interface identifier.
Further, in order to guarantee that the tag template that client is obtained is up-to-date, when generating label, also need write down the term of validity of label and the version of current label, like this, described server can be judged that this label is whether expired or not be latest edition after receiving service request according to these information.
In specific implementation process, client can append to one or more labels on the business datum, service request of each tag identifier.
Before additional service data, need handle the requirement that this data fit follow-up data is handled to business datum.
When on business datum, adding a plurality of label, a label can comprise another subtab, such as, because all-purpose card discount money day, statistics need use the intermediate data in day statistical treatment process, therefore the business processing interface label tag4 that this all-purpose card discount money day is added up is set at day subtab of statistical service interface label.
Particularly, if business datum is added label tag1, then need business datum is carried out following encapsulation:
<package>
<info>
<tagl name=" day statistics "
<source>AG1001203</source>
<state>valid</state>
<object>server1-001</object>
</tag1>
</info>
<datas>
<data?id=”IC17750”>
<enter?type=”float”>28.4</enter>
<exit?type=”float”>25.4</exit>
<ticket?type=”int”>0</ticket>
</data>
</datas>
</package>
Wherein add label data recording from the ticket checking machine that is numbered AG1001203, all-purpose card ID is that the passenger's of IC17750 the amount of money that enters the station is 28.4, departures the amount of money be 25.4, this data amount of money of electronics ticket money is 0.The data of having added label just can be submitted to the processing module processing of the appointment of server1-001, and this day statistical module is handled.
In specific implementation process, the business datum that can need to handle encapsulates, again corresponding label is appended to encapsulated layer, multinomial service request for a business datum, can repeatedly encapsulate, have a label in the same encapsulated layer at least, the packet after will encapsulating then sends to server.
Such as, if comprise simultaneously in the business of client-requested: bill day statistics, Zhou Tongji, month statistics and add up these four business all-purpose card discount money day, then need business datum is carried out following encapsulation:
<package>
<info>
<tag1>
<tag4>
<\tag4>
<\tag1>
<tag2>
<\tag2>
<tag3>
<\tag3>
<\info>
<datas>
<\datas>
<\package>
Step 120: described server is according to this business corresponding service Processing Interface sign that writes down in each label, corresponding service Processing Interface in the server of every business of definite processing and this server is called described business processing interface and is carried out corresponding service processing.
Described server at first needs to determine to handle this professional server when determining to handle this professional business processing interface, and therefore, step 120 specifically comprises:
Step 120a: described server determines to handle the server of described business according to this professional server address of the processing of writing down in the described label, if this server is not a book server, then continues step 120b, otherwise, enter step 120c.
Step 120b: described server is transmitted to corresponding server according to this professional server address of the processing of writing down in the described label together with described label and business datum.
Step 120c: described according to the business processing interface identifier that writes down in the described label, determine in the corresponding with service device business processing interface of described business.
In order to determine the service request authority and the time bar of client, before determining to handle the server of every business, also need to judge the access rights of client, and the validity of every service request, therefore, before step 120, this method also should comprise:
Step 121: described server is asked the client of described business according to the permission of writing down in each label, determine to submit to the client of this service request whether to have this professional authority of request,, then withdraw from the processing of this business if do not have, otherwise, continue step 122.
Step 122: whether before the deadline described server judges the current time according to the term of validity that writes down in the described label, if not, then withdraw from the processing of this business, otherwise, step 123 continued.
Step 123: described server judges according to the version of record tag template in the described label whether the version of described tag template is up-to-date, if not, then withdraw from the processing of this business, otherwise, step 120 continued.
Described server after the corresponding service Processing Interface, calls each business processing interface respectively in the server of determining every business and this server, every business is handled.
For the packet of many labels, described server carries out corresponding every business processing at first according to the record of outermost all labels in this packet, and then according to the record of the label of nexine, carries out the processing of corresponding every business.
Such as, in the above-mentioned example, after server is finished above-mentioned bill day statistics, Zhou Tongji, month statistical service, whether there is subtab with continuing to search these outermost layer labels, there is all-purpose card discount money day statistical service processing subtab as day statistical service processing label, then will search the corresponding service processing interface, proceed the processing of all-purpose card discount money day statistical service according to this labeling requirement.Thereby finish the business processing of all label appointments.
As shown in Figure 2, the system of a kind of distributed multi-service logic asynchronous processing of the embodiment of the invention comprises: first server 20, second server 21 and client 22.
First server 20, be used to issue current accessible business, the tag template of described business is provided to client, and when at least one the business processing request that receives client, according to the information that writes down in the label that receives, determine to handle the server of every business, and when definite described server is not book server, the information that writes down in the label according to this business correspondence is transmitted to the corresponding server processing with described label and business datum;
Second server 21 is used to receive the label and the business datum of described first server forwards, and calls the corresponding service processing interface and handle;
Client 22, be used for when at least one business determining request is described first server issue professional, from described first server, obtain and described at least one professional corresponding tag template, and, the business datum that each label is handled with needs is submitted to described first server by described tag template generation and every professional corresponding label.
22 of clients are carried out alternately with first server 20, and when the business processing interface of client 22 requests during at second server, client 22 needs to specify the way address of corresponding server.
Further, described first server is when determine handling that wherein the server of a business is book server, be further used for information, determine to handle this professional business processing interface, and call this business processing interface described business is handled according to the tag record of this business correspondence.
As shown in Figure 3, the server of a kind of distributed multi-service logic asynchronous processing that the embodiment of the invention provides comprises: administration module 40, letter sorting module 41 and scheduler module 42.
Administration module 40 is used to issue current accessible business, and the tag template of described business is provided to client.
Wherein, administration module 40 can further comprise: registration submodule 400 and issue submodule 401.
Register submodule 400, be used for the current accessible business of each Service Component of register server and other server of system, each professional configuration information is set.
Issue submodule 401 is used for the business of described registration submodule registration is issued in default scope.
Letter sorting module 41, be used for the information that writes down according to each label of receiving from described client, determine to handle the server address of every business, and when definite described server is not book server, the information that writes down in the label according to this business correspondence is transmitted to the corresponding server processing with described label and business datum.
Scheduler module 42, be used for when described letter sorting module determine to handle that wherein the server of a business is book server, according to the information of the tag record of this business correspondence, determine to handle this professional business processing interface, and call this business processing interface described business is handled.
Further, this server can also comprise: determination module 43.
Determination module 43 was used for before described letter sorting module determines to handle the server address of every business, determined to submit to the client of described service request to have this professional authority of request.
And, determination module 43 also is used for, before described letter sorting module is determined to handle the server address of every business, version according to the term of validity that writes down in the described label and tag template, determine the current time in the term of validity of each tag record, and the version of the described tag template that writes down in definite each label is up-to-date.
As shown in Figure 4, the client of a kind of distributed multi-service logic asynchronous processing that the embodiment of the invention provides comprises: acquisition module 50 and submission module 51.
Acquisition module 50 is used for when at least one business determining request is the current accessible business of a server issue of system, obtains from described server and described at least one professional corresponding tag template.
Submit module 51 to, generate and every professional corresponding label, the business datum that each label is handled with needs is submitted to described server by described tag template.
Wherein, described submission module 51 comprises: generate submodule 510 and submit submodule 511 to.
Generate submodule 510, be used for requirement, write down this professional Data Source, current situation, and handle this professional server address and business processing interface identifier, generate label according to described label model.
Submit submodule 511 to, be used for each label that described generation submodule is generated and the business datum that needs are handled and submit to described server.
Described generation submodule 511 is further used for writing down the version of the term of validity and the corresponding label template of each label.
In the embodiment of the invention, a server in the system is according to the situation of the utilization of resources of other server in self and the system, registration and issue disclose current accessible business, client can be according to the business of described server issue, to described server requests corresponding one or multinomial business processing, when sending the business processing request, obtain every professional corresponding label model from this server, according to each label model requirement, write down each professional related data, the business datum that this label is handled with needs sends to described server then, this server is according to the information that writes down in this label, determine to handle each professional server and business processing interface, call each business of business interface then and handle.Like this, the data in enormous quantities that needs focus on are carried out dispersion treatment, reduced the pressure that calculates, shortened the follow-up time that this batch data is handled.And, because data have been disperseed to handle, when data are retrieved, can improve effectiveness of retrieval follow-up, promoted the performance of data processing.
Obviously, those skilled in the art can carry out various changes and distortion to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within claim of the present invention and the equivalent technologies scope thereof, then the present invention also is intended to comprise these changes and modification interior.