The content of the invention
The embodiment of the present application provides a kind of method and device of Business Processing, is used to solve prior art to one
When individual service request is processed, it is impossible to the problem of its idempotence is effectively ensured.
A kind of method of Business Processing that the embodiment of the present application is provided, including:
The service request that intermediate equipment receiving terminal sends;
In the historical requests that the intermediate equipment is locally preserved, the service request is judged whether;
If so, not processing the service request then;
If it is not, then stored the service request as historical requests local, and by service request hair
Give master library or standby storehouse is processed.
A kind of method of Business Processing that the embodiment of the present application is provided, including:
Client generates service request;
In the historical requests that data point storehouse preserves, the service request is judged whether;
If so, not processing the service request then;
If it is not, the service request then is sent into intermediate equipment so that intermediate equipment is receiving the industry
After business request, when it is determined that there is the service request in the local historical requests for preserving of the intermediate equipment,
The service request is not processed, when it is determined that not deposited in the local historical requests for preserving of the intermediate equipment
In the service request, the service request is stored local in the intermediate equipment as historical requests,
And the service request is sent to master library or standby storehouse is processed.
A kind of device of Business Processing that the embodiment of the present application is provided, including:
Receiver module, for the service request that receiving terminal sends;
Judging treatmenting module, in the historical requests that are locally preserved in described device, judging whether institute
State service request;If so, not processing the service request then;If it is not, then by the service request
As historical requests storage local, and the service request is sent to master library or standby storehouse is processed.
A kind of device of Business Processing that the embodiment of the present application is provided, including:
Request generation module, for generating service request;
Sending module is judged, in the historical requests that data point storehouse preserves, judging whether institute
State service request;If so, not processing the service request then;If it is not, then by the service request
Be sent to intermediate equipment so that intermediate equipment after the service request is received, when it is determined that the centre sets
When there is the service request in the standby local historical requests for preserving, the service request is not processed,
When it is determined that not existing the service request in the local historical requests for preserving of the intermediate equipment, by the industry
Business request is local in the intermediate equipment as historical requests storage, and the service request is sent into master library
Or standby storehouse is processed.
The embodiment of the present application provides a kind of method and device of Business Processing, and the method is being connect by intermediate equipment
After receiving the service request of terminal transmission, judge in the historical requests that intermediate equipment is locally preserved, if deposit
In the service request, if so, then subsequent treatment is not carried out to the service request, if it is not, then please by the business
Ask as historical requests storage in the local of intermediate equipment, and the service request sent to master library or standby storehouse,
So that master library or standby storehouse are processed the service request after the service request is received.The above method by
Intermediate equipment is then passed through to carry out service request in idempotent operation, rather than master library or standby storehouse, therefore, i.e.,
When making to occur the situation that master library is delayed machine and processed service request by standby storehouse, master library is recovering
After normal, also single treatment will not be again carried out to the service request, relative to of the prior art by master library
Or standby storehouse for the idempotence for ensureing service request, can effectively ensure that the idempotence of service request, improve
The accuracy of service processing result.
Specific embodiment
It is specifically real below in conjunction with the application to make the purpose, technical scheme and advantage of the application clearer
Apply example and corresponding accompanying drawing is clearly and completely described to technical scheme.Obviously, it is described
Embodiment is only some embodiments of the present application, rather than whole embodiments.Based on the implementation in the application
Example, the every other implementation that those of ordinary skill in the art are obtained under the premise of creative work is not made
Example, belongs to the scope of the application protection.
The process of the Business Processing that Fig. 1 is provided for the embodiment of the present application, specifically includes following steps:
S101:The service request that intermediate equipment receiving terminal sends.
In actual applications, when people want complete some business when, can by such as computer, smart mobile phone,
The intelligent terminals such as panel computer perform these business, it is generally the case that terminal can first by with these business phases
Corresponding service request is sent to master library or standby storehouse so that master library or standby storehouse after the service request is received,
Complete the treatment to business needed for user.
And in order to solve master library in the prior art delay machine when, it is impossible to ensure that the idempotence of processing business request is asked
Topic, the embodiment of the present application increased intermediate equipment between user terminal and master library or standby storehouse, by intermediate equipment
Carry out the service request that receiving terminal is sended over, and idempotent operation is carried out to the service request, i.e. work as user
When performing business, can first using terminal send service request to intermediate equipment so that intermediate equipment is being received
To after the service request, idempotent operation is carried out to the service request by subsequent step S102~S104.Its
In, the intermediate equipment can be any equipment with forwarding capability, and due in actual applications, it is middle
Equipment needs to receive the service request that multiple users send, therefore, the intermediate equipment that the embodiment of the present application is provided
It can be distributed caching.
S102:In the historical requests that the intermediate equipment is locally preserved, judge whether that the business please
Ask, if so, step S103 is then performed, if it is not, then performing step S104.
S103:The service request is not processed.
S104:Stored the service request as historical requests local, and the service request is sent
Processed to master library or standby storehouse.
When intermediate equipment receives the service request that user terminal is sended over, can be by the service request with
Between equipment locally preserve historical requests matched item by item, judge the intermediate equipment it is local in whether deposit
With the service request identical service request, if, it is determined that the service request be repetitive requests, therefore
Intermediate equipment does not carry out follow-up treatment to the service request, if not, it is determined that the service request is not to repeat
Request, intermediate equipment can be stored the service request as historical requests in local, and by the service request
Send to master library or standby storehouse so that master library or standby storehouse, can be to the service requests after the service request is received
Processed, obtained service processing result, and then complete whole business procession.Follow-up, if
Intermediate equipment receive again with the service request identical service request, due to before by the service request
As historical requests storage local, therefore, the service request for receiving again is can determine whether out for repeat please
Ask, enter without carrying out follow-up treatment to this service request.
In the above method, due to be increased for ensureing service request idempotent between terminal and master library or standby storehouse
Property intermediate equipment so that when service request is sent to master library or standby storehouse, the service request need to be passed through first terminal
The judgement of intermediate equipment idempotent is crossed, and only when it is non-duplicate request that intermediate equipment determines the service request, in
Between equipment further the service request can be just sent to master library or standby storehouse to be processed, therefore, even if
Occur in that master library is delayed the situation of machine, standby storehouse will not also receive before the service request that has been received by of master library,
For the idempotence for ensureing service request by master library or standby storehouse of the prior art, can effectively protect
The idempotence of service request is demonstrate,proved, the accuracy of service processing result is improve.
In the embodiment of the present application, whether intermediate equipment existing connects in the local historical requests for preserving are judged
During the service request for receiving, can identify to ask each history by the service request included in the service request
Ask and matched, wherein, service request mark can be that terminal is accordingly generated when the service request is generated
A traffic ID, e.g., transaction journal number pays serial number etc., it is also possible to terminal or intermediate equipment according to
The content of algorithm and service request is identified come the service request for determining, i.e. as long as ensureing its uniqueness
.
For example, terminal or intermediate equipment can be in service request user account information, business odd numbers etc. it is interior
Hold, by default MD5 algorithms, determine a unique service request mark of the service request,
Wherein, the content that different service requests is included all is not quite similar, therefore, for two identical business
For request, the service request mark that terminal or intermediate equipment are determined respectively is also certain identical, therefore,
Intermediate equipment can be identified by service request, effectively distinguish each service request, and then can be in subsequent process
In accurately judge the service request whether be present in intermediate equipment it is local in.
In actual applications, it is contemplated that the limited storage space of intermediate equipment, it is impossible to which storing substantial amounts of business please
Ask, if also, intermediate equipment stores substantial amounts of service request, the operation burden of itself may be increased,
Operational efficiency is reduced, therefore, one is additionally provided in the embodiment of the present application for storing the expired industry of intermediate equipment
The data for being engaged in asking divide storehouse, wherein, when the storage time of the historical requests stored in intermediate equipment is beyond pre-
If storage time when, intermediate equipment can exceed the historical requests of default storage time as expired business
Request, sends to the data point storehouse set up in advance to be stored, so that the memory space of intermediate equipment
Discharged well, can effectively ensure that follow-up operating efficiency.On this basis, the embodiment of the present application is also
There is provided the method for another Business Processing, as shown in Figure 2.
The process of another Business Processing that Fig. 2 is provided for the embodiment of the present application, specifically includes following steps:
S201:Client generates service request.
In actual applications, when people wish to carry out business, can be by such as computer, smart mobile phone, flat
The client installed on the intelligent terminals such as plate computer performs these business, it is generally the case that user can basis
The Business Processing interface that client is provided a user with terminal interface operates accordingly to perform, and client
End can generate corresponding service request according to the business operation of user's execution, and then can be by the service request
Outwards it is transmitted.
S202:In the historical requests that data point storehouse preserves, the service request is judged whether,
If so, step S203 is then performed, if it is not, then performing step S204.
S203:The service request is not processed.
S204:The service request is sent to intermediate equipment so that intermediate equipment is receiving the business
After request, when it is determined that there is the service request in the local historical requests for preserving of the intermediate equipment, no
The service request is processed, when it is determined that not existing in the local historical requests for preserving of the intermediate equipment
During the service request, the service request is stored local in the intermediate equipment as historical requests, and
The service request is sent to master library or standby storehouse is processed.
Due to being additionally arranged data point storehouse, therefore, client was needed before service request is sent to intermediate equipment
The historical requests that first called data point storehouse preserves from data point storehouse, come to judging in these historical requests
In whether have existed for the service request, the purpose of this measure is, in actual applications, client may
Do not know whether the local historical requests for preserving of intermediate equipment have been transferred to data point storehouse and have been stored, if
Directly service request is sent to intermediate equipment, then it is possible that intermediate equipment will be received before this
Identical service request be transferred to the situation that data point storehouse is stored, so as to intermediate equipment can be caused to connect again
After receiving the service request, will be unable to be effectively ensured the problem of its idempotence.Therefore, client can be from data
Transfer each historical requests in point storehouse, the service request that judgement will send whether be present in transferring these go through
In history request, wherein, specific judgment mode can also be asked by the business being previously mentioned in above-mentioned steps S102
Seek mark to judge, i.e. extract service request mark from the service request, and according to the service request
Mark, to be matched one by one to each historical requests transferred, if not existing and the industry in these historical requests
Business request identifies the historical requests for matching, then client can be sent to intermediate equipment the service request, made
Intermediate equipment is obtained after the service request is received, when it is determined that being deposited in the local historical requests for preserving of intermediate equipment
In the service request, the service request is not processed, when it is determined that the local history for preserving of intermediate equipment
When not existing the service request in request, stored the service request as historical requests in intermediate equipment sheet
Ground, and the service request is sent to master library or standby storehouse is processed, if do not exist in these historical requests with
The service request identifies the historical requests for matching, then client will not subsequently be located to the service request
Reason, i.e. the service request will not be sent into intermediate equipment.
It should be noted that in the deterministic process of described above, if local in client called data point storehouse
Whole historical requests of preservation, then can greatly reduce the speed of service of terminal, therefore, client is from data
During transferring historical requests in point storehouse, can only transfer each with what ID in the service request matched
Historical requests, e.g., by the user account information included in the service request, adjust from data point storehouse
The historical requests under the user account information are taken, so as to the running space of terminal can be saved greatly, is improved eventually
The speed of service at end.
In above-mentioned steps S102, intermediate equipment is in the local historical requests for preserving are judged, if on existing
During stating service request, if the service request mark extracted from the service request and local preservation
Whole historical requests matched one by one, then may increase the operation burden of intermediate equipment, reduce in the middle of
The operational efficiency of equipment, therefore, in the embodiment of the present application, intermediate equipment is also adopted by and above-mentioned steps S202
Middle identical method, i.e. user's mark of the information such as user account can be first extracted from the service request
Know, and the historical requests under the ID are transferred out from local, and then very big save to the business
The judgement time of request, improve the treatment effeciency of intermediate equipment.
In above-mentioned steps S202, when client finds that the service request that will be sent is present in data point
When in the historical requests that storehouse preserves, client can be pointed out to user, i.e. point out user the business
Request has been transmitted across before this, without sending again.Same reason, in step s 102, when
After the service request that intermediate equipment receiving terminal sends, existing in the local historical requests for preserving being somebody's turn to do is found
Service request, then can send the existing or processed prompting of the service request so that terminal is connecing to terminal
After receiving the prompting, the prompting is shown to user, user is after the prompting is viewed, you can know just
The service request of transmission is attached most importance to the service request sent of recurrence, and intermediate equipment is not processed the service request.
It is above two kinds of methods of Business Processing that the embodiment of the present application is provided, based on above two method, this
Application embodiment additionally provides a system for Business Processing, as shown in Figure 3.
The system schematic of the Business Processing that Fig. 3 is provided for the embodiment of the present application.
Include an intermediate equipment in the transaction processing system shown in Fig. 3, wherein, the intermediate equipment can
The service request that each terminal is sended over is received respectively, and idempotent operation is carried out to each service request, if middle
Equipment judges the service request for receiving when being new service request, then can be according to actual conditions, by the industry
Business request sends to master library or standby storehouse and is processed, wherein, when master library normal operation, then by service request
Send into master library, if delaying occurs in master library during machine, service request can be sent into the standby storehouse of system startup
Processed.And each terminal needed the number for first being set from system before service request is sent to intermediate equipment
The business for judging to want to be sent to intermediate equipment according to the historical requests stored in called data point storehouse in point storehouse
Whether request is repetitive requests, and detailed process is described in detail in the above-mentioned methods, herein with regard to not carrying out
It is described in detail.
Transaction processing system based on described above, the embodiment of the present application additionally provides the detailed of Business Processing
Thin process, as shown in Figure 4.
The detailed process of the Business Processing that Fig. 4 is provided for the embodiment of the present application, specifically includes following steps:
S401:Client generates service request.
S402:In the historical requests that data point storehouse preserves, the service request is judged whether,
If so, step S403 is then performed, if it is not, then performing step S404.
S403:The service request is not processed.
S404:The service request is sent to intermediate equipment.
S405:Intermediate equipment is judged in the historical requests that intermediate equipment is locally preserved, if there is the industry
Business request, if so, step S406 is then performed, if it is not, then performing step S407.
S406:The service request is not processed.
S407:Stored the service request as historical requests local, and the service request is sent
Processed to master library or standby storehouse.
It is above two kinds of methods of Business Processing that the embodiment of the present application is provided, based on same thinking, this Shen
Please embodiment two kinds of devices of Business Processing are also provided, as shown in Figure 5, Figure 6.
A kind of structural representation of business processing device that Fig. 5 is provided for the embodiment of the present application, specifically includes:
Receiver module 501, for the service request that receiving terminal sends;
Judging treatmenting module 502, in the historical requests that are locally preserved in described device, judging whether to deposit
In the service request;If so, not processing the service request then;If it is not, then by the business
Request local, and the service request is sent at master library or standby storehouse as historical requests storage
Reason.
Include service request mark in the service request;
The judging treatmenting module 502 specifically for, judge described device locally preserve historical requests in,
With the presence or absence of the historical requests corresponding with service request mark;If, it is determined that described device is local
There is the service request in the historical requests of preservation;If not, it is determined that the history that described device is locally preserved
Do not exist the service request in request.
Sending module 503, the historical requests for storage time to be exceeded default storage time are sent to data
Point storehouse is stored.
The structural representation of another business processing device that Fig. 6 is provided for the embodiment of the present application, specifically includes:
Request generation module 601, for generating service request;
Sending module 602 is judged, in the historical requests that data point storehouse preserves, judging whether to deposit
In the service request;If so, not processing the service request then;If it is not, then by the business
Request be sent to intermediate equipment so that intermediate equipment after the service request is received, when it is determined that in described
Between in the historical requests that locally preserve of equipment when there is the service request, not to the service request at
Reason, when it is determined that not existing the service request in the local historical requests for preserving of the intermediate equipment, by institute
State service request and store local in the intermediate equipment as historical requests, and the service request is sent to
Master library or standby storehouse are processed.
It is described judgement sending module 602 specifically for, according in the service request carry ID,
Transfer each historical requests matched with the ID in the data point storehouse;According to each history transferred
Request, with the presence or absence of the service request in each historical requests that judgement is transferred.
The embodiment of the present application provides a kind of method and device of Business Processing, and the method is being connect by intermediate equipment
After receiving the service request of terminal transmission, judge in the historical requests that intermediate equipment is locally preserved, if deposit
In the service request, if so, then subsequent treatment is not carried out to the service request, if it is not, then please by the business
Ask as historical requests storage in the local of intermediate equipment, and the service request sent to master library or standby storehouse,
So that master library or standby storehouse are processed the service request after the service request is received.The above method by
Intermediate equipment is then passed through to carry out service request in idempotent operation, rather than master library or standby storehouse, therefore, i.e.,
When making to occur the situation that master library is delayed machine and processed service request by standby storehouse, master library is recovering
After normal, also single treatment will not be again carried out to the service request, relative to of the prior art by master library
Or standby storehouse for the idempotence for ensureing service request, can effectively ensure that the idempotence of service request, improve
The accuracy of service processing result.
In a typical configuration, computing device includes one or more processors (CPU), input/defeated
Outgoing interface, network interface and internal memory.
Internal memory potentially includes the volatile memory in computer-readable medium, random access memory
And/or the form, such as read-only storage (ROM) or flash memory (flash RAM) such as Nonvolatile memory (RAM).
Internal memory is the example of computer-readable medium.
Computer-readable medium includes that permanent and non-permanent, removable and non-removable media can be by appointing
What method or technique realizes information Store.Information can be computer-readable instruction, data structure, program
Module or other data.The example of the storage medium of computer includes, but are not limited to phase transition internal memory
(PRAM), static RAM (SRAM), dynamic random access memory (DRAM), its
The random access memory (RAM) of his type, read-only storage (ROM), electrically erasable are read-only
Memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read-only storage
(CD-ROM), digital versatile disc (DVD) or other optical storages, magnetic cassette tape, tape magnetic
Disk storage or other magnetic storage apparatus or any other non-transmission medium, can be used for storage can be calculated
The information that equipment is accessed.Defined according to herein, computer-readable medium does not include temporary computer-readable matchmaker
Body (transitory media), such as data-signal and carrier wave of modulation.
Also, it should be noted that term " including ", "comprising" or its any other variant be intended to non-row
His property is included, so that process, method, commodity or equipment including a series of key elements not only include
Those key elements, but also other key elements including being not expressly set out, or also include for this process,
Method, commodity or the intrinsic key element of equipment.In the absence of more restrictions, by sentence " including
One ... " key element that limits, it is not excluded that in the process including the key element, method, commodity or set
Also there is other identical element in standby.
It will be understood by those skilled in the art that embodiments herein can be provided as method, system or computer journey
Sequence product.Therefore, the application can using complete hardware embodiment, complete software embodiment or combine software and
The form of the embodiment of hardware aspect.And, the application can be used and wherein include calculating at one or more
Machine usable program code computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM,
Optical memory etc.) on implement computer program product form.
Embodiments herein is the foregoing is only, the application is not limited to.For this area skill
For art personnel, the application can have various modifications and variations.All institutes within spirit herein and principle
Any modification, equivalent substitution and improvements of work etc., within the scope of should be included in claims hereof.