Summary of the invention
In view of the above problems, it proposes on the present invention overcomes the above problem or at least be partially solved in order to provide one kind
State the asynchronous processing method and device of a kind of service request of problem.
According to one aspect of the present invention, a kind of asynchronous processing method of service request is provided, comprising:
In response to the data interaction instruction of user's triggering, obtains multiple business relevant to data interaction instruction and ask
It asks;
The service request for belonging to pre-set business type is put into message queue, so that application server is from the message team
Service request is taken out in column to be handled.
Optionally, each service request respectively corresponds different priorities according to type of service, and the pre-set business type is excellent
First grade is lower than the type of service of priority threshold value.
Optionally, the message queue has multiple;
Correspondingly, described that the service request for belonging to pre-set business type is put into message queue, for application server
Service request is taken out from the message queue to be handled, and further comprises:
The service request for belonging to pre-set business type is respectively put into each message queue, so that application server is from described
Service request is taken out in message queue to be handled.
Optionally, the quantity of the message queue is identical as the priority quantity of priority threshold value is lower than and corresponds;
It is described that the service request for belonging to pre-set business type is respectively put into each message queue, for application server from
Service request is taken out in the message queue to be handled, and further comprises:
The service request for belonging to pre-set business type is respectively put into corresponding message queue according to priority, for institute
It states application server and successively takes out service request from the message queue according to priority sequence from high to low and handled.
Optionally, the priority includes non-instant type of traffic lower than the type of service of priority threshold value.
Optionally, after the acquisition multiple service requests relevant to data interaction instruction, the method is also wrapped
It includes:
The service request that will not belong to pre-set business type is sent to the application server, so that the application server
The service request received is handled.
Optionally, the data interaction in response to user's triggering instructs, and obtains relevant to data interaction instruction
Before multiple service requests, the method also includes:
Local network speed is detected, when the local network speed is lower than default network speed, executes the number in response to user's triggering
According to interactive instruction, the step of instructing relevant multiple service requests to the data interaction is obtained.
Optionally, the data interaction in response to user's triggering instructs, and obtains relevant to data interaction instruction
Before multiple service requests, the method also includes:
Detection is locally located, it is described be locally located meet default setting when, execute the number in response to user's triggering
According to interactive instruction, the step of instructing relevant multiple service requests to the data interaction is obtained.
According to another aspect of the invention, a kind of asynchronous process device of service request is provided, comprising:
Request unit is adapted for the data interaction instruction of user's triggering, obtains and instruct with the data interaction
Relevant multiple service requests;
Request is put into unit, suitable for the service request for belonging to pre-set business type to be put into message queue, for application
Server takes out service request from the message queue and is handled.
Optionally, each service request respectively corresponds different priorities according to type of service, and the pre-set business type is excellent
First grade is lower than the type of service of priority threshold value.
Optionally, the message queue has multiple;
Correspondingly, the request is put into unit, is further adapted for respectively putting the service request for belonging to pre-set business type
Enter in each message queue, is handled so that application server takes out service request from the message queue.
Optionally, the quantity of the message queue is identical as the priority quantity of priority threshold value is lower than and corresponds;
The request is put into unit, is further adapted for distinguishing the service request for belonging to pre-set business type according to priority
Be put into corresponding message queue, for the application server according to priority sequence from high to low successively from the message
Service request is taken out in queue to be handled.
Optionally, the priority includes non-instant type of traffic lower than the type of service of priority threshold value.
Optionally, described device further include:
Request transmitting unit, the service request suitable for will not belong to pre-set business type are sent to the application server,
So that the application server handles the service request received.
Optionally, described device further include:
Wire-speed detection unit is adapted to detect for local network speed, when the local network speed is lower than default network speed, asks described in calling
Seek acquiring unit.
Optionally, described device further include:
Detection unit is set, is adapted to detect for being locally located, it is described be locally located meet default setting when, ask described in calling
Seek acquiring unit.
Service request is no longer directly successively sent to application server by the present invention, but will be related to data interaction instruction
Multiple service requests in belong to the service request of pre-set business type and be put into message queue, so that application server is from described
Service request is taken out in message queue to be handled, and be may not need in data exchange process and is waited application server to default industry
The feedback of the service request of service type improves user experience to improve the efficiency of data exchange process.
Specific embodiment
With reference to the accompanying drawings and examples, specific embodiments of the present invention will be described in further detail.Implement below
Example is not intended to limit the scope of the invention for illustrating the present invention.
Fig. 1 is the flow chart of the asynchronous processing method of the service request of one embodiment of the present invention;Referring to Fig.1, described
Method includes:
S101: the data interaction in response to user's triggering instructs, and obtains multiple industry relevant to data interaction instruction
Business request;
It should be noted that the executing subject of the method for present embodiment is terminal, the terminal is mobile phone, plate electricity
The equipment such as brain, palm PC PDA or notebook can be also certainly other equipment with identity function, present embodiment is to this
It is without restriction.
It will be appreciated that the data interaction instruction of user's triggering can input in several ways, and such as: it is clicked by mouse
The interaction triggering element of client, or, clicking the interaction triggering element of client on the touchscreen, this is not added in present embodiment
With limitation.
In the concrete realization, the interaction triggering element of the client can be understood as the login element in client,
That is showing there is login element in the display interface of the client, when user triggers and logs in element, visitor is enabled to
Family end carries out account login, thus the data interaction between triggering and application server.
The interaction triggering element of the client is it can be appreciated that more new element in client, that is to say, that in visitor
It shows there is triggering element in the display interface at family end, when user triggers element, client is enabled to carry out data update (example
Such as: carrying out historical information and synchronize), at this point, client needs data to update, thus the data between triggering and application server
Interaction.
Certainly, it may also be understood to be other similar element, present embodiment is without restriction to this.
It should be understood that the usually described data interaction instruction is logged in relevant multiple service requests with account
For data interaction instruction, data interaction instruction can correspond to multiple service requests, such as: account checking request and log acquisition
Request etc., but the prior art can be realized by being similar to serial manner, that is to say, that it can incite somebody to action: account checking request and log
Acquisition request etc. is successively sent to application server, after application server is to the request received all feedback, could complete
Account log in, but some request not be in data exchange process necessary to, keep the efficiency of entire data exchange process too low,
Cause user experience poor.
S102: the service request for belonging to pre-set business type is put into message queue, so that application server is from described
Service request is taken out in message queue (message queue) to be handled.
It should be noted that the service request of the pre-set business type includes nonessential industry in data exchange process
Business request.
Service request is no longer directly successively sent to application server by present embodiment, but will be instructed with data interaction
The service request for belonging to pre-set business type in relevant multiple service requests is put into message queue, for application server from
Service request is taken out in the message queue to be handled, and be may not need in data exchange process and is waited application server to pre-
If the feedback of the service request of type of service improves user experience to improve the efficiency of data exchange process.
Fig. 2 is the flow chart of the asynchronous processing method of the service request of one embodiment of the present invention;It is described referring to Fig. 2
Method includes:
S201: the data interaction in response to user's triggering instructs, and obtains multiple industry relevant to data interaction instruction
Business request, each service request respectively correspond different priorities according to type of service, and the pre-set business type is lower than for priority
The type of service of priority threshold value;
It will be appreciated that for convenient for selecting the pre-set business type, it, can be according to service class in present embodiment
Type is respectively service request setting priority, when determining pre-set business type, priority directly can be lower than priority threshold
The type of service of value is as pre-set business type.
It should be noted that the priority threshold value can be configured as needed, but in order to guarantee the pre-set business
The service request of type includes nonessential service request in data exchange process, so, it is described preferential in present embodiment
Grade includes non-instant type of traffic lower than the type of service of priority threshold value, that is to say, that priority threshold value is higher than non-
The priority of instant messaging service type.
S202: the service request for belonging to pre-set business type is respectively put into each message queue, for application server
It takes out service request from the message queue to be handled, the message queue has multiple.
In the concrete realization, it is assumed that belong to pre-set business type service number of requests it is more in the case where, message queue only
There is one, the speed that application server can be made to take out service request from the message queue is slower, to improve taking-up business
The speed of request, in present embodiment, the message queue have it is multiple so that the application server can be from multiple message teams
Service request is taken out simultaneously in column, present embodiment is without restriction to this.
Fig. 3 is the flow chart of the asynchronous processing method of the service request of one embodiment of the present invention;It is described referring to Fig. 3
Method includes:
S301: the data interaction in response to user's triggering instructs, and obtains multiple industry relevant to data interaction instruction
Business request, each service request respectively correspond different priorities according to type of service, and the pre-set business type is lower than for priority
The type of service of priority threshold value;
Step S301 is identical as the step S201 of embodiment shown in Fig. 2, and details are not described herein.
S302: the service request for belonging to pre-set business type is respectively put into corresponding message queue according to priority,
For the application server successively taken out from the message queue according to priority sequence from high to low service request into
Row processing, the quantity of the message queue is identical as the priority quantity of priority threshold value is lower than and corresponds.
It will be appreciated that since service request has priority, it is assumed that service request is put into different message teams at random
In column, and queue is a kind of data structure of first in first out, such that taking out the preferential of service request from message queue
Grade is unordered, but the usually higher service request of priority needs priority processing, it is assumed that the higher business of priority is asked
It asks and is not handled for a long time, will affect user experience, to avoid the problem, in present embodiment, the number of the message queue
Amount is identical as the priority quantity of priority threshold value is lower than and corresponds, at this point, can will belong to the business of pre-set business type
Request be respectively put into corresponding message queue according to priority, enable the application server according to priority from height to
Low sequence is successively taken out service request from the message queue and is handled.
Fig. 4 is the flow chart of the asynchronous processing method of the service request of one embodiment of the present invention;It is described referring to Fig. 4
Method includes:
S401: the data interaction in response to user's triggering instructs, and obtains multiple industry relevant to data interaction instruction
Business request;
Step S401 is identical as the step S101 of embodiment shown in FIG. 1, and details are not described herein.
S402: the service request that will not belong to pre-set business type is sent to the application server, so that the application
Server handles the service request received;
It will be appreciated that due to the service request of the pre-set business type include in data exchange process it is nonessential
Service request, therefore, the service request for being not belonging to pre-set business type can be regarded as being included in must in data exchange process
The service request of palpus.
So in present embodiment, needing for the service request for being not belonging to pre-set business type to be sent to described answer
The service request for being not belonging to pre-set business type can be sent out using HTTP request agreement in the concrete realization with server
Sending to the application server can also be sent, present embodiment does not limit this certainly by other request protocols
System.
S403: the service request for belonging to pre-set business type is put into message queue, so that application server is from described
Service request is taken out in message queue to be handled.
Step S403 is identical as the step S102 of embodiment shown in FIG. 1, and details are not described herein.
Fig. 5 is the flow chart of the asynchronous processing method of the service request of one embodiment of the present invention;It is described referring to Fig. 5
Method includes:
S500: detecting local network speed, when the local network speed is lower than default network speed, executes step S501;
It should be noted that since the executing subject of present embodiment is terminal, so, the local network speed can understand
For the network speed of the terminal.
It will be appreciated that since step S501~S502 is the efficiency in order to improve data exchange process, especially at this
Ground network speed is preferable compared with effect in the case where slow, it is assumed that local network speed is very fast, even if using step S501~S502 for user's body
It is also little to test influence, therefore, in present embodiment, when local network speed is lower than default network speed, executes step S501.
In the concrete realization, the default network speed can be configured as needed, and present embodiment is without restriction to this.
S501: the data interaction in response to user's triggering instructs, and obtains multiple industry relevant to data interaction instruction
Business request;
S502: the service request for belonging to pre-set business type is put into message queue, so that application server is from described
Service request is taken out in message queue to be handled.
Step S501~S502 is identical as step S101~S102 of embodiment shown in FIG. 1, and details are not described herein.
Fig. 6 is the flow chart of the asynchronous processing method of the service request of one embodiment of the present invention;It is described referring to Fig. 6
Method includes:
S600: detection is locally located, it is described be locally located meet default setting when, execute step S601;
It should be noted that since the executing subject of present embodiment is terminal, so, described be locally located is appreciated that
For the setting of the terminal.
It will be appreciated that in present embodiment, can be set by user to the terminal for the flexibility convenient for user
It sets, to decide whether to execute step S601~S602, increases flexibility.
S601: the data interaction in response to user's triggering instructs, and obtains multiple industry relevant to data interaction instruction
Business request;
S602: the service request for belonging to pre-set business type is put into message queue, so that application server is from described
Service request is taken out in message queue to be handled.
Step S601~S602 is identical as step S101~S102 of embodiment shown in FIG. 1, and details are not described herein.
For embodiment of the method, for simple description, therefore, it is stated as a series of action combinations, but this field
Technical staff should be aware of, and embodiment of that present invention are not limited by the describe sequence of actions, because implementing according to the present invention
Example, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know that, specification
Described in embodiment belong to preferred embodiment, the actions involved are not necessarily necessary for embodiments of the present invention.
Fig. 7 is the structural block diagram of the asynchronous process device of the service request of one embodiment of the present invention;Referring to Fig. 7, institute
Stating device includes:
Request unit 701, is adapted for the data interaction instruction of user's triggering, and acquisition refers to the data interaction
Enable relevant multiple service requests;
Request is put into unit 702, suitable for the service request for belonging to pre-set business type to be put into message queue, with supply
Service request is taken out from the message queue with server to be handled.
In an alternative embodiment of the invention, each service request respectively corresponds different priorities according to type of service,
The pre-set business type is the type of service that priority is lower than priority threshold value.
In an alternative embodiment of the invention, the message queue has multiple;
Correspondingly, the request is put into unit, is further adapted for respectively putting the service request for belonging to pre-set business type
Enter in each message queue, is handled so that application server takes out service request from the message queue.
In an alternative embodiment of the invention, the quantity of the message queue and the priority for being lower than priority threshold value
Quantity is identical and corresponds;
The request is put into unit, is further adapted for distinguishing the service request for belonging to pre-set business type according to priority
Be put into corresponding message queue, for the application server according to priority sequence from high to low successively from the message
Service request is taken out in queue to be handled.
In an alternative embodiment of the invention, the priority lower than priority threshold value type of service include it is non-i.e.
When type of traffic.
In an alternative embodiment of the invention, described device further include:
Request transmitting unit, the service request suitable for will not belong to pre-set business type are sent to the application server,
So that the application server handles the service request received.
In an alternative embodiment of the invention, described device further include:
Wire-speed detection unit is adapted to detect for local network speed, when the local network speed is lower than default network speed, asks described in calling
Seek acquiring unit.
In an alternative embodiment of the invention, described device further include:
Detection unit is set, is adapted to detect for being locally located, it is described be locally located meet default setting when, ask described in calling
Seek acquiring unit.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simple
Place illustrates referring to the part of embodiment of the method.
It should be noted that in all parts of the device of the invention, according to the function that it to be realized to therein
Component has carried out logical partitioning, and still, the present invention is not only restricted to this, can according to need all parts are repartitioned or
Person's combination for example, can be single component by some component combinations, or some components can be further broken into more
Subassembly.
Various component embodiments of the invention can be implemented in hardware, or to run on one or more processors
Software module realize, or be implemented in a combination thereof.It will be understood by those of skill in the art that can be used in practice
Microprocessor or digital signal processor (DSP) realize some or all portions in device according to an embodiment of the present invention
The some or all functions of part.The present invention is also implemented as a part or complete for executing method as described herein
The device or device program (for example, computer program and computer program product) in portion.It is such to realize program of the invention
It can store on a computer-readable medium, or may be in the form of one or more signals.Such signal can be with
It downloads from internet website, is perhaps provided on the carrier signal or is provided in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and ability
Field technique personnel can be designed alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference symbol between parentheses should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not
Element or step listed in the claims.Word "a" or "an" located in front of the element does not exclude the presence of multiple such
Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real
It is existing.In the unit claims listing several devices, several in these devices can be through the same hardware branch
To embody.The use of word first, second, and third does not indicate any sequence.These words can be explained and be run after fame
Claim.
Embodiment of above is only suitable for illustrating the present invention, and not limitation of the present invention, in relation to the common of technical field
Technical staff can also make a variety of changes and modification without departing from the spirit and scope of the present invention, therefore all
Equivalent technical solution also belongs to scope of the invention, and scope of patent protection of the invention should be defined by the claims.