Summary of the invention
In view of the above problems, the present invention is proposed to provide a kind of overcoming the problems referred to above or a kind of asynchronous processing method of service request solved the problem at least in part and device.
According to one aspect of the present invention, provide a kind of asynchronous processing method of service request, comprising:
In response to the data interaction instruction that user triggers, obtain the multiple service request relevant to described data interaction instruction;
The service request belonging to pre-set business type is put into message queue, from described message queue, takes out service request for application server and process.
Alternatively, each service request is according to type of service corresponding different priorities respectively, and described pre-set business type is the type of service of priority lower than priority threshold value.
Alternatively, described message queue has multiple;
Correspondingly, described the service request belonging to pre-set business type is put into message queue, from described message queue, takes out service request for application server and process, comprise further:
The service request belonging to pre-set business type is put into each message queue respectively, from described message queue, takes out service request for application server and process.
Alternatively, the quantity of described message queue and one_to_one corresponding identical with lower than the priority quantity of priority threshold value;
Described the service request belonging to pre-set business type is put into each message queue respectively, from described message queue, takes out service request for application server and process, comprise further:
The service request belonging to pre-set business type is put into corresponding message queue respectively according to priority, from described message queue, takes out service request for described application server successively according to priority order from high to low and process.
Alternatively, described priority comprises non-instant type of traffic lower than the type of service of priority threshold value.
Alternatively, after multiple service request that described acquisition is relevant to described data interaction instruction, described method also comprises:
The service request not belonging to pre-set business type is sent to described application server, to make described application server, the service request received is processed.
Alternatively, the described data interaction instruction triggered in response to user, before obtaining multiple service request relevant to described data interaction instruction, described method also comprises:
Detect local network speed, when described local network speed is lower than default network speed, performs the described data interaction instruction triggered in response to user, obtain the step of the multiple service request relevant to described data interaction instruction.
Alternatively, the described data interaction instruction triggered in response to user, before obtaining multiple service request relevant to described data interaction instruction, described method also comprises:
Detect local setting, arrange in described this locality and meet when arranging, perform the described data interaction instruction in response to user's triggering, obtain the step of the multiple service request relevant to described data interaction instruction.
According to another aspect of the present invention, provide a kind of asynchronous process device of service request, comprising:
Acquisition request unit, is suitable for the data interaction instruction triggered in response to user, obtains the multiple service request relevant to described data interaction instruction;
Unit is put in request, is suitable for the service request belonging to pre-set business type to put into message queue, takes out service request process for application server from described message queue.
Alternatively, each service request is according to type of service corresponding different priorities respectively, and described pre-set business type is the type of service of priority lower than priority threshold value.
Alternatively, described message queue has multiple;
Correspondingly, described request puts into unit, is further adapted for and the service request belonging to pre-set business type is put into each message queue respectively, takes out service request process for application server from described message queue.
Alternatively, the quantity of described message queue and one_to_one corresponding identical with lower than the priority quantity of priority threshold value;
Described request puts into unit, be further adapted for and the service request belonging to pre-set business type is put into corresponding message queue respectively according to priority, from described message queue, take out service request for described application server successively according to priority order from high to low and process.
Alternatively, described priority comprises non-instant type of traffic lower than the type of service of priority threshold value.
Alternatively, described device also comprises:
Request transmitting unit, is suitable for the service request not belonging to pre-set business type to be sent to described application server, processes to make described application server to the service request received.
Alternatively, described device also comprises:
Wire-speed detection unit, is suitable for detecting local network speed, when described local network speed is lower than default network speed, calls described request acquiring unit.
Alternatively, described device also comprises:
Detecting unit is set, is suitable for detecting local setting, arrange in described this locality and meet when arranging, call described request acquiring unit.
The present invention is no longer direct is sent to application server successively by service request, but the service request belonging to pre-set business type in multiple service request relevant to data interaction instruction is put into message queue, from described message queue, take out service request for application server to process, can without the need to waiting for the feedback of application server to the service request of pre-set business type in data exchange process, thus improve the efficiency of data exchange process, improve Consumer's Experience.
Embodiment
Below in conjunction with drawings and Examples, the specific embodiment of the present invention is described in further detail.Following examples for illustration of the present invention, but are not used for limiting the scope of the invention.
Fig. 1 is the process flow diagram of the asynchronous processing method of the service request of one embodiment of the present invention; With reference to Fig. 1, described method comprises:
S101: the data interaction instruction triggered in response to user, obtains the multiple service request relevant to described data interaction instruction;
It should be noted that, the executive agent of the method for present embodiment is terminal, and described terminal is the equipment such as mobile phone, panel computer, palm PC PDA or notebook, and certainly, also can be the equipment that other have identity function, present embodiment is not limited this.
Will be understood that, the data interaction instruction that user triggers inputs by various ways, and such as: the mutual trigger element being clicked client by mouse, or click the mutual trigger element of client on the touchscreen, present embodiment is not limited this.
In specific implementation, the mutual trigger element of described client can be understood as the login element in client, that is, in the display interface of described client, show there is login element, when user triggers login element, client can be made to carry out account login, thus trigger the data interaction between application server.
The mutual trigger element of described client also can be understood as the more new element in client, that is, in the display interface of client, show there is trigger element, when user's trigger element, client can be made to carry out Data Update (such as: carry out historical information synchronous etc.), now, client needs Data Update, thus triggers the data interaction between application server.
Certainly, also can be regarded as other analogous elements, present embodiment is not limited this.
Be understood that, usual described data interaction instruction is to having relevant multiple service request, for the data interaction instruction that account logs in, this data interaction instruction can corresponding multiple service request, such as: account checking request and log acquisition request etc., but prior art can be realized by the mode being similar to serial, that is, can be by: account checking request and log acquisition request etc. are sent to application server successively, after application server all feeds back the request received, just can complete account to log in, but some request is not necessary in data exchange process, make the efficiency of whole data exchange process too low, cause Consumer's Experience poor.
S102: the service request belonging to pre-set business type is put into message queue, takes out service request for application server and processes from described message queue (messagequeue).
It should be noted that, the service request of described pre-set business type is included in service request nonessential in data exchange process.
Present embodiment is no longer direct is sent to application server successively by service request, but the service request belonging to pre-set business type in multiple service request relevant to data interaction instruction is put into message queue, from described message queue, take out service request for application server to process, can without the need to waiting for the feedback of application server to the service request of pre-set business type in data exchange process, thus improve the efficiency of data exchange process, improve Consumer's Experience.
Fig. 2 is the process flow diagram of the asynchronous processing method of the service request of one embodiment of the present invention; With reference to Fig. 2, described method comprises:
S201: the data interaction instruction triggered in response to user, obtain the multiple service request relevant to described data interaction instruction, each service request is according to type of service corresponding different priorities respectively, and described pre-set business type is the type of service of priority lower than priority threshold value;
Will be understood that, for ease of selecting described pre-set business type, in present embodiment, service request can be respectively according to type of service and priority is set, when determining pre-set business type, can directly using priority lower than the type of service of priority threshold value as pre-set business type.
It should be noted that, described priority threshold value can be arranged as required, but in order to ensure that the service request of described pre-set business type is included in service request nonessential in data exchange process, so, in present embodiment, described priority comprises non-instant type of traffic lower than the type of service of priority threshold value, and that is, priority threshold value is higher than the priority of non-instant type of traffic.
S202: the service request belonging to pre-set business type is put into each message queue respectively, from described message queue, take out service request for application server and process, described message queue has multiple.
In specific implementation, suppose to belong to pre-set business type service number of requests more when, message queue only has one, can make application server from described message queue, take out the speed of service request slower, for improving the speed of taking out service request, in present embodiment, described message queue has multiple, make described application server from multiple message queue, can take out service request, present embodiment is not limited this simultaneously.
Fig. 3 is the process flow diagram of the asynchronous processing method of the service request of one embodiment of the present invention; With reference to Fig. 3, described method comprises:
S301: the data interaction instruction triggered in response to user, obtain the multiple service request relevant to described data interaction instruction, each service request is according to type of service corresponding different priorities respectively, and described pre-set business type is the type of service of priority lower than priority threshold value;
The step S201 of the embodiment shown in step S301 and Fig. 2 is identical, does not repeat them here.
S302: the service request belonging to pre-set business type is put into corresponding message queue respectively according to priority, from described message queue, take out service request for described application server successively according to priority order from high to low to process, the quantity of described message queue and one_to_one corresponding identical with lower than the priority quantity of priority threshold value.
Will be understood that, because service request has priority, service request is supposed to put into different message queues at random, and queue is a kind of data structure of first in first out, the priority of taking out service request from message queue can be made like this to be unordered, but the service request that priority is higher usually needs priority processing, the service request that suppose priorities is higher is processed for a long time, Consumer's Experience can be affected, for avoiding this problem, in present embodiment, the quantity of described message queue is identical with the priority quantity lower than priority threshold value, and one_to_one corresponding, now, the service request belonging to pre-set business type can be put into corresponding message queue respectively according to priority, make described application server can take out service request successively from described message queue according to priority order from high to low to process.
Fig. 4 is the process flow diagram of the asynchronous processing method of the service request of one embodiment of the present invention; With reference to Fig. 4, described method comprises:
S401: the data interaction instruction triggered in response to user, obtains the multiple service request relevant to described data interaction instruction;
The step S101 of the embodiment shown in step S401 and Fig. 1 is identical, does not repeat them here.
S402: the service request not belonging to pre-set business type is sent to described application server, processes the service request received to make described application server;
Will be understood that, because the service request of described pre-set business type is included in service request nonessential in data exchange process, therefore, the described service request not belonging to pre-set business type can be regarded as and is included in service request necessary in data exchange process.
So, in present embodiment, the described service request not belonging to pre-set business type is needed to be sent to described application server, in specific implementation, can HTTP request agreement be adopted to be sent to described application server the described service request not belonging to pre-set business type, certainly, also send by other request protocol, present embodiment is not limited this.
S403: the service request belonging to pre-set business type is put into message queue, takes out service request for application server and processes from described message queue.
The step S102 of the embodiment shown in step S403 and Fig. 1 is identical, does not repeat them here.
Fig. 5 is the process flow diagram of the asynchronous processing method of the service request of one embodiment of the present invention; With reference to Fig. 5, described method comprises:
S500: detect local network speed, when described local network speed is lower than default network speed, performs step S501;
It should be noted that, the executive agent due to present embodiment is terminal, so described local network speed can be interpreted as the network speed of described terminal.
Will be understood that, due to the efficiency that step S501 ~ S502 is to improve data exchange process, especially when local network speed is slower, effect is better, suppose that local network speed is very fast, even if adopt step S501 ~ S502 also little for Consumer's Experience impact, therefore, in present embodiment, when local network speed is lower than default network speed, perform step S501.
In specific implementation, described default network speed can be arranged as required, and present embodiment is not limited this.
S501: the data interaction instruction triggered in response to user, obtains the multiple service request relevant to described data interaction instruction;
S502: the service request belonging to pre-set business type is put into message queue, takes out service request for application server and processes from described message queue.
Step S101 ~ the S102 of the embodiment shown in step S501 ~ S502 and Fig. 1 is identical, does not repeat them here.
Fig. 6 is the process flow diagram of the asynchronous processing method of the service request of one embodiment of the present invention; With reference to Fig. 6, described method comprises:
S600: detect local setting, arranges in described this locality and meets when arranging, execution step S601;
It should be noted that, the executive agent due to present embodiment is terminal, so described this locality arranges the setting that namely can be regarded as described terminal.
Will be understood that, for ease of the dirigibility of user, in present embodiment, can be arranged described terminal by user, thus determine whether perform step S601 ~ S602, add dirigibility.
S601: the data interaction instruction triggered in response to user, obtains the multiple service request relevant to described data interaction instruction;
S602: the service request belonging to pre-set business type is put into message queue, takes out service request for application server and processes from described message queue.
Step S101 ~ the S102 of the embodiment shown in step S601 ~ S602 and Fig. 1 is identical, does not repeat them here.
For embodiment of the method, in order to simple description, therefore it is all expressed as a series of combination of actions, but those skilled in the art should know, the embodiment of the present invention is not by the restriction of described sequence of movement, because according to the embodiment of the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in instructions all belongs to preferred embodiment, and involved action might not be that the embodiment of the present invention is necessary.
Fig. 7 is the structured flowchart of the asynchronous process device of the service request of one embodiment of the present invention; With reference to Fig. 7, described device comprises:
Acquisition request unit 701, is suitable for the data interaction instruction triggered in response to user, obtains the multiple service request relevant to described data interaction instruction;
Unit 702 is put in request, is suitable for the service request belonging to pre-set business type to put into message queue, takes out service request process for application server from described message queue.
In a kind of embodiment of the present invention, each service request is according to type of service corresponding different priorities respectively, and described pre-set business type is the type of service of priority lower than priority threshold value.
In a kind of embodiment of the present invention, described message queue has multiple;
Correspondingly, described request puts into unit, is further adapted for and the service request belonging to pre-set business type is put into each message queue respectively, takes out service request process for application server from described message queue.
In a kind of embodiment of the present invention, the quantity of described message queue and one_to_one corresponding identical with lower than the priority quantity of priority threshold value;
Described request puts into unit, be further adapted for and the service request belonging to pre-set business type is put into corresponding message queue respectively according to priority, from described message queue, take out service request for described application server successively according to priority order from high to low and process.
In a kind of embodiment of the present invention, described priority comprises non-instant type of traffic lower than the type of service of priority threshold value.
In a kind of embodiment of the present invention, described device also comprises:
Request transmitting unit, is suitable for the service request not belonging to pre-set business type to be sent to described application server, processes to make described application server to the service request received.
In a kind of embodiment of the present invention, described device also comprises:
Wire-speed detection unit, is suitable for detecting local network speed, when described local network speed is lower than default network speed, calls described request acquiring unit.
In a kind of embodiment of the present invention, described device also comprises:
Detecting unit is set, is suitable for detecting local setting, arrange in described this locality and meet when arranging, call described request acquiring unit.
For device embodiment, due to itself and embodiment of the method basic simlarity, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
Should be noted that, in all parts of device of the present invention, the function that will realize according to it and logical partitioning has been carried out to parts wherein, but, the present invention is not limited to this, can repartition all parts as required or combine, such as, can be single parts by some component combinations, or some parts can be decomposed into more subassembly further.
All parts embodiment of the present invention with hardware implementing, or can realize with the software module run on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that the some or all functions that microprocessor or digital signal processor (DSP) can be used in practice to realize according to the some or all parts in the device of the embodiment of the present invention.The present invention can also be embodied as part or all equipment for performing method as described herein or device program (such as, computer program and computer program).Realizing program of the present invention and can store on a computer-readable medium like this, or the form of one or more signal can be had.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computing machine of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.
Above embodiment is only suitable for the present invention is described; and be not limitation of the present invention; the those of ordinary skill of relevant technical field; without departing from the spirit and scope of the present invention; can also make a variety of changes and modification; therefore all equivalent technical schemes also belong to category of the present invention, and scope of patent protection of the present invention should be defined by the claims.
The invention discloses the asynchronous processing method of A1, a kind of service request, comprising:
In response to the data interaction instruction that user triggers, obtain the multiple service request relevant to described data interaction instruction;
The service request belonging to pre-set business type is put into message queue, from described message queue, takes out service request for application server and process.
A2, method as described in A1, each service request is according to type of service corresponding different priorities respectively, and described pre-set business type is the type of service of priority lower than priority threshold value.
A3, method as described in A2, described message queue has multiple;
Correspondingly, described the service request belonging to pre-set business type is put into message queue, from described message queue, takes out service request for application server and process, comprise further:
The service request belonging to pre-set business type is put into each message queue respectively, from described message queue, takes out service request for application server and process.
A4, method as described in A3, the quantity of described message queue and one_to_one corresponding identical with lower than the priority quantity of priority threshold value;
Described the service request belonging to pre-set business type is put into each message queue respectively, from described message queue, takes out service request for application server and process, comprise further:
The service request belonging to pre-set business type is put into corresponding message queue respectively according to priority, from described message queue, takes out service request for described application server successively according to priority order from high to low and process.
A5, method as described in A2, described priority comprises non-instant type of traffic lower than the type of service of priority threshold value.
A6, method according to any one of A1 ~ A5, after multiple service request that described acquisition is relevant to described data interaction instruction, described method also comprises:
The service request not belonging to pre-set business type is sent to described application server, to make described application server, the service request received is processed.
A7, method according to any one of A1 ~ A6, the described data interaction instruction triggered in response to user, before obtaining multiple service request relevant to described data interaction instruction, described method also comprises:
Detect local network speed, when described local network speed is lower than default network speed, performs the described data interaction instruction triggered in response to user, obtain the step of the multiple service request relevant to described data interaction instruction.
A8, method according to any one of A1 ~ A6, the described data interaction instruction triggered in response to user, before obtaining multiple service request relevant to described data interaction instruction, described method also comprises:
Detect local setting, arrange in described this locality and meet when arranging, perform the described data interaction instruction in response to user's triggering, obtain the step of the multiple service request relevant to described data interaction instruction.
The invention also discloses the asynchronous process device of B9, a kind of service request, comprising:
Acquisition request unit, is suitable for the data interaction instruction triggered in response to user, obtains the multiple service request relevant to described data interaction instruction;
Unit is put in request, is suitable for the service request belonging to pre-set business type to put into message queue, takes out service request process for application server from described message queue.
B10, device as described in B9, each service request is according to type of service corresponding different priorities respectively, and described pre-set business type is the type of service of priority lower than priority threshold value.
B11, device as described in B10, described message queue has multiple;
Correspondingly, described request puts into unit, is further adapted for and the service request belonging to pre-set business type is put into each message queue respectively, takes out service request process for application server from described message queue.
B12, device as described in B11, the quantity of described message queue and one_to_one corresponding identical with lower than the priority quantity of priority threshold value;
Described request puts into unit, be further adapted for and the service request belonging to pre-set business type is put into corresponding message queue respectively according to priority, from described message queue, take out service request for described application server successively according to priority order from high to low and process.
B13, device as described in B10, described priority comprises non-instant type of traffic lower than the type of service of priority threshold value.
B14, device according to any one of B9 ~ B13, described device also comprises:
Request transmitting unit, is suitable for the service request not belonging to pre-set business type to be sent to described application server, processes to make described application server to the service request received.
B15, device according to any one of B9 ~ B14, described device also comprises:
Wire-speed detection unit, is suitable for detecting local network speed, when described local network speed is lower than default network speed, calls described request acquiring unit.
B16, device according to any one of B9 ~ B14, described device also comprises:
Detecting unit is set, is suitable for detecting local setting, arrange in described this locality and meet when arranging, call described request acquiring unit.