Summary of the invention
Main purpose of the present invention is to provide data commit method and the device in a kind of network application, utilizes service end realization to prevent that request from repeating the problem of submitting to expansion poor to solve.
To achieve these goals, according to an aspect of the present invention, provide the commit method of the data in a kind of network application.The method comprises: receive user's request, this user's request is used for asking to submit to network data; Obtain first network address, wherein, first network address is that above-mentioned user asks corresponding address; Obtain user and ask corresponding BlueDrama mark; Carry out Hash calculation based on first network address and BlueDrama mark, generate the first cryptographic Hash; In Preset Time, judge in queue whether store the cryptographic Hash identical with the first cryptographic Hash, wherein, this queue stores has cryptographic Hash corresponding to network data of submitting in advance; And if in Preset Time, store the cryptographic Hash identical with the first cryptographic Hash in queue, submission network data refuses user's request.
Further, obtaining user asks corresponding BlueDrama mark to comprise: judge that user asks corresponding user's state; If user asks corresponding user's state for logging in state, user's mark is identified as BlueDrama; If it is visitor's state that user asks corresponding user's state, the network address of the client of user's login is identified as BlueDrama.
Further, obtain in the following manner Preset Time: search configuration file, configuration file is for storage networking address and the corresponding relation of time; From configuration file, search time corresponding to first network address, and using the time finding as Preset Time.
Further, user request is filtered at Web portal place, comprising: obtain set in advance repeat to submit to Rule of judgment; Judge that user asks the whether satisfied Rule of judgment that repeats to submit to; Wherein, repeat to submit to Rule of judgment if user asks to meet, refuse user's request, if user asks discontented lumping weight to submit again Rule of judgment to, receive user's request.
Further, obtaining repeating of setting in advance submits to Rule of judgment to comprise: the record that obtains pre-stored customer access network address; Judge user accesses network address whether again in Preset Time; Wherein, if user accesses network address again in Preset Time, refusal user's request; If user does not have accesses network address again in Preset Time, receive user's request.
To achieve these goals, according to a further aspect in the invention, provide the data in a kind of network application to submit device to.This device comprises: receiver module, and for receiving user's request, this user's request is used for asking to submit to network data; The first acquisition module, for obtaining first network address, wherein, first network address is that user asks corresponding address; The second acquisition module, asks corresponding BlueDrama mark for obtaining user; Computing module, for carrying out Hash calculation based on first network address and BlueDrama mark, generates the first cryptographic Hash; The first judge module, for judging in Preset Time whether queue stores the cryptographic Hash identical with the first cryptographic Hash, wherein, queue stores has cryptographic Hash corresponding to network data of submitting in advance; And refusal module, if store the cryptographic Hash identical with the first cryptographic Hash for queue in Preset Time, submission network data refuses user's request.
Further, the second acquisition module comprises: the second judge module, for judging that user asks corresponding user's state; First arranges module, if ask corresponding user's state for logging in state for user, user's mark is identified as BlueDrama; Second arranges module, is visitor's state if ask corresponding user's state for user, the network address of the client of user's login is identified as BlueDrama.
Further, the data in this network application submit to device also to comprise: first searches module, and for searching configuration file, configuration file is for storage networking address and the corresponding relation of time; Second searches module, for searching from configuration file time corresponding to first network address, and using the time finding as Preset Time.
Further, data in this network application submit to device also to comprise: the 3rd acquisition module, for obtain set in advance repeat to submit to Rule of judgment; The 3rd judge module, repeats to submit to Rule of judgment for judging that user asks whether to meet; Wherein, repeat to submit to Rule of judgment if user asks to meet, refuse user's request; If user asks discontented lumping weight to submit again Rule of judgment to, receive user's request.
Further, the 3rd acquisition module comprises: the 4th acquisition module, for obtaining the record of pre-stored customer access network address; Whether again the 4th judge module, for judging user accesses network address in Preset Time; Wherein, if user accesses network address again in Preset Time, refusal user's request; If user does not have accesses network address again in Preset Time, receive user's request.
The present invention adopts the user's request that receives, and this user's request is used for asking to submit to network data; Obtain first network address; Obtain user and ask corresponding BlueDrama mark; Carry out Hash calculation based on first network address and BlueDrama mark, generate the first cryptographic Hash; In Preset Time, judge in queue whether store the cryptographic Hash identical with the first cryptographic Hash, wherein, this queue stores has cryptographic Hash corresponding to network data of submitting in advance; And if in Preset Time, store the cryptographic Hash identical with the first cryptographic Hash in queue, submission network data refuses user's request.The present invention utilizes judgement that the time asks to repeat to submit to solve to utilize service end to realize the request of preventing and repeats the problem of submitting to expansion poor, and then has reached the request of can either preventing and repeat to submit to, can improve again the effect of expansion.
Embodiment
It should be noted that, in the situation that not conflicting, the feature in embodiment and embodiment in the application can combine mutually.Describe below with reference to the accompanying drawings and in conjunction with the embodiments the present invention in detail.
Fig. 1 is the flow chart of the first embodiment of the data commit method in network application according to the present invention.As shown in Figure 1, the data commit method in this network application comprises that following step S101 is to step S106:
Step S101, receives user's request, and user's request is used for asking to submit to network data.
Network data is submitted in user's request request of being mainly used in that service end receives to, and this user request information comprises user profile, the content of user's request, requesting method etc.Requesting method GET and HEAD are supported by the general webserver, and other requesting methods are normally optional.GET method is fetched request resource identification information, and for example, in the time of browser address bar input network address accessed web page, browser adopts GET method to obtain Internet resources to server.HEAD method is also to fetch request resource identification information, is in the time of response, not return messages body.POST method can receive the entity information being included in request by request server, can, for submission form, send message etc. to database.
Step S102, obtains first network address, and wherein, first network address is that user asks corresponding address.
In the time of user's request access webpage, the address of the webpage of server end meeting automatic acquisition user access.First network address is that user asks corresponding web page address.Obtaining user, to ask corresponding web page address be in order to utilize this network address and user to ask corresponding BlueDrama mark to carry out Hash calculation.In addition, obtaining user, to ask corresponding address be in order to determine the Preset Time corresponding with this web page address according to the content of the business of the webpage of user access or user's request, the present invention preferably Preset Time corresponding to different web pages network address is set to difference, for example, for on-line payment webpage, what its corresponding Preset Time need to be arranged is very long, and the request of so just preventing repeats to submit to cause to repeat payment problem.For generic web page, such as user's enrollment page, the Preset Time that its corresponding Preset Time can be more corresponding than on-line payment webpage is shorter a little.
Preferably, user is asked the corresponding network address by the present invention, and in configuration file in the corresponding Preset Time storage in this address and server, server manages the Preset Time of each network address by this configuration file.
Preferably, ask the corresponding Preset Time in corresponding first network address to obtain in the following manner with user: search configuration file, configuration file is for storage networking address and the corresponding relation of time; From configuration file, search time corresponding to first network address, and using the time finding as Preset Time.
Step S103, obtains user and asks corresponding BlueDrama mark.
Obtaining user, to ask corresponding BlueDrama mark be in order to ask the corresponding network address to carry out Hash with user this network identity, and then reach the object of distinguishing user's request and differentiation user and ask the network address of accessing.
Preferably, in the embodiment of the present invention, obtaining user, to ask corresponding BlueDrama mark be by judge that user asks corresponding user's state definite.If user asks corresponding user's state for logging in state, user's mark is identified as BlueDrama; If it is visitor's state that user asks corresponding user's state, the network address of the client of user's login is identified as BlueDrama.
Step S104, carries out Hash calculation based on first network address and BlueDrama mark, generates the first cryptographic Hash.
Obtaining after user asks corresponding first network address and BlueDrama mark, the two is carried out to Hash calculation, generate the first cryptographic Hash.Hash is exactly the output that the input of random length is transformed into regular length by hashing algorithm, and this output is exactly hashed value.This conversion is a kind of compressing mapping, and the space of hashed value is conventionally much smaller than the space of input, and different inputs may hash to identical output.Ask corresponding first network address and BlueDrama mark to carry out Hash user, be conducive to save server space, and can conveniently judge the different user of access consolidated network address, or the different web sites of same user access.
Step S105 judges in queue whether store the cryptographic Hash identical with the first cryptographic Hash in Preset Time, and wherein, queue stores has cryptographic Hash corresponding to network data of submitting in advance.
The queue here refers to expired automatic disappearance queue of time, and in queue, the super multiple preset time of cryptographic Hash of original storage will disappear automatically, and wherein, the time refers to the Preset Time corresponding with the network address of user's request.The BlueDrama mark of each user's request receiving (can be user's mark, also can be the network address of the client logined of user) all will ask the corresponding network address to carry out Hash with user, the cryptographic Hash of gained will store with this queue in.
Step S106, if store the cryptographic Hash identical with the first cryptographic Hash in queue in Preset Time, submission network data refuses user's request.
If there is the cryptographic Hash identical with the first cryptographic Hash in queue in Preset Time, prove that user asks to repeat to submit in Preset Time, server will be refused this user and ask to submit to network data; If there is not the cryptographic Hash identical with the first cryptographic Hash in queue in Preset Time, prove that user asks not repeat to submit in Preset Time, server will receive this user request, and receives this user and ask the data that will submit to transfer to other modules of server to process accordingly.
By ask the corresponding network address that different Preset Times is set to user, the first cryptographic Hash that Hash gained is carried out in the BlueDrama mark of the new user's request receiving of judgement and corresponding first network address in Preset Time whether with queue in the cryptographic Hash that existed identical, if identical, prove that user's request repeats to submit in Preset Time, server is refused this user and is asked to submit to data; If to carry out the cryptographic Hash that existed in the first cryptographic Hash of Hash gained and queue not identical the BlueDrama mark of the new user's request receiving and corresponding first network address in Preset Time, so the BlueDrama mark of the user request newly receiving is carried out in the first cryptographic Hash storage and queue of Hash gained with corresponding first network address, and this first cryptographic Hash exceedes Preset Time and will automatically disappear.
Data commit method in network application of the present invention adopts the user's request that receives, and this user's request is used for asking to submit to network data; Obtain first network address, wherein, first network address is that above-mentioned user asks corresponding address; Obtain user and ask corresponding BlueDrama mark; Carry out Hash calculation based on first network address and BlueDrama mark, generate the first cryptographic Hash; In Preset Time, judge in queue whether store the cryptographic Hash identical with the first cryptographic Hash, wherein, this queue stores has cryptographic Hash corresponding to network data of submitting in advance; And if store the cryptographic Hash identical with the first cryptographic Hash in queue in Preset Time, submission network data refuses user's request, by Preset Time corresponding to configuration file management heterogeneous networks address, according to this Preset Time server, user's request is repeated to submit to judgement, solve and utilized service end realization to prevent that request from repeating the problem of submitting to expansion poor, utilize the method can prevent that request from repeating to submit to, and the method have good expansion.
Fig. 2 is the flow chart that service end is asked the second embodiment filtering at Web portal place to client user according to the present invention.As shown in Figure 2, the data commit method in this network application filters at Web portal place client user request, specifically comprises that following step S201 is to step S204:
Step S201, obtain set in advance repeat to submit to Rule of judgment.
Server end carries out the overall situation in the porch of network to user's request of client and filters.In Asp.net, can use HttpModule to expand, if can expand with Filter with Asp.net MVC, other language similarly.All user's requests in Asp.net client all need to process through HttpModel, are expanded and can be realized all user's requests of intercepting and capturing by HttpModel.
Preferably, in the present invention, obtaining repeating of setting in advance submits to Rule of judgment to comprise:
Obtain the record of pre-stored customer access network address.If user accesses this network address for the first time, by user's visit information storage first and queue, and from configuration file, search the Preset Time corresponding with this network address.Judge user accesses network address whether again in Preset Time.Wherein, if user again accesses this network address in Preset Time, server detects the Visitor Logs that has this user, and server will be refused user's request, returns to Client-Prompt information, informs that user asks to repeat to submit to.Access this network address if user exceedes Preset Time, server can't detect user's Visitor Logs, and server will receive this user's request, gives other modules and processes, and this user's Visitor Logs is stored in queue by this user's request.
Step S202, judges that user asks the whether satisfied Rule of judgment that repeats to submit to.
Step S203, repeats to submit to Rule of judgment if user asks to meet, and refuses user's request.
Step S204, if user asks discontented lumping weight to submit again Rule of judgment to, receives user's request.
Data commit method in network application of the present invention repeats to submit to Rule of judgment by request is set, according to request repeat to submit to Rule of judgment server at Web portal place all users' requests to client filter, adopt obtain set in advance repeat to submit to Rule of judgment; Judge that user asks the whether satisfied Rule of judgment that repeats to submit to; Repeat to submit to Rule of judgment if user asks to meet, refuse user's request; If user asks discontented lumping weight to submit again Rule of judgment to, receive user's request, solve and utilized service end realization to prevent that request from repeating the problem of submitting to expansion poor, reach the request of preventing and repeated to submit to, ensure the effect of good expansion.
As can be seen from the above description, the present invention has realized following technique effect:
Data commit method in network application of the present invention adopts the cryptographic Hash of asking corresponding BlueDrama mark and first network address to carry out storing in the first cryptographic Hash that Hash obtains and queue user to judge, if the first cryptographic Hash is identical with the cryptographic Hash of storing in queue in Preset Time, illustrate that user asks to repeat to submit to, server end is refused this user and is asked to submit to network data; If the first cryptographic Hash is not identical with the cryptographic Hash of storing in queue in Preset Time, server receives this user's request.The present invention utilizes the time to judge, repeats to submit to filter at server end, has good expansion.
It should be noted that, can in the computer system such as one group of computer executable instructions, carry out in the step shown in the flow chart of accompanying drawing, and, although there is shown logical order in flow process, but in some cases, can carry out shown or described step with the order being different from herein.
According to embodiments of the invention, provide the data in a kind of network application to submit device to.Fig. 3 is the schematic diagram that the data in network application are submitted the first embodiment of device to according to the present invention, as shown in Figure 3, data in this network application submit to device to comprise: receiver module 10, the first acquisition module 20, the second acquisition module 30, computing module 40, the first judge modules 50 and refusal module 60.
Receiver module 10, for receiving user's request, this user's request is used for asking to submit to network data;
The first acquisition module 20, for obtaining first network address, wherein, first network address is that user asks corresponding address;
The second acquisition module 30, asks corresponding BlueDrama mark for obtaining user;
Computing module 40, for carrying out Hash calculation based on first network address and BlueDrama mark, generates the first cryptographic Hash;
The first judge module 50, for judging in Preset Time whether queue stores the cryptographic Hash identical with the first cryptographic Hash, wherein, queue stores has cryptographic Hash corresponding to network data of submitting in advance;
Refusal module 60, if store the cryptographic Hash identical with the first cryptographic Hash for queue in Preset Time, submission network data refuses user's request.
Preferably, the data in this network application submit to the second acquisition module 30 in device to comprise: the second judge module, for judging that user asks corresponding user's state; First arranges module, if ask corresponding user's state for logging in state for user, user's mark is identified as BlueDrama; Second arranges module, is visitor's state if ask corresponding user's state for user, the network address of the client of user's login is identified as BlueDrama.
Data in network application of the present invention submit to device to comprise receiver module 10, the first acquisition module 20, the second acquisition modules 30, computing module 40, the first judge modules 50 and refusal module 60.By this device, the invention solves service end and prevent that request from repeating the problem of submitting to expansion poor, not only can prevent that user from asking to repeat to submit to network data, can also prevent from that user's malice from pouring water to wait certain period to repeat the filtration of submission.
Fig. 4 is the schematic diagram that the data in network application are submitted the second embodiment of device to according to the present invention, as shown in Figure 4, data in this network application submit to device to comprise: receiver module 10, the first acquisition module 20, the second acquisition modules 30, computing module 40, the first judge module 50, refusal module 60, the first is searched module 70, second searches module 80, the three acquisition modules 90 and the 3rd judge module 110.Wherein, the 3rd acquisition module 90 comprises: the 4th acquisition module 901 and the 4th judge module 902.
First searches module 70, and for searching configuration file, configuration file is for storage networking address and the corresponding relation of time;
Second searches module 80, for searching from configuration file time corresponding to first network address, and using the time finding as Preset Time.
The 3rd acquisition module 90, for obtain set in advance repeat to submit to Rule of judgment;
The 3rd judge module 110, repeats to submit to Rule of judgment for judging that user asks whether to meet; Wherein, repeat to submit to Rule of judgment if user asks to meet, refuse user's request; If user asks discontented lumping weight to submit again Rule of judgment to, receive user's request.
The 4th acquisition module 901, for obtaining the record of pre-stored customer access network address;
Whether again the 4th judge module 902, for judging user accesses network address in Preset Time; Wherein, if user accesses network address again in Preset Time, refusal user's request; If user does not have accesses network address again in Preset Time, receive user's request.
Data in network application of the present invention submit to device to comprise: receiver module 10, the first acquisition module 20, the second acquisition modules 30, computing module 40, the first judge modules 50, refusal module 60, first searches module 70, the second searches module 80, the three acquisition modules 90 and the 3rd judge module 110.Wherein, the 3rd acquisition module 90 comprises: the 4th acquisition module 901 and the 4th judge module 902.Data in this network application submit to device to utilize the time to judge, in service end, user's request of client are repeated to submit to and filter, and have good expansion.
Obviously, those skilled in the art should be understood that, above-mentioned of the present invention each module or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on the network that multiple calculation elements form, alternatively, they can be realized with the executable program code of calculation element, thereby, they can be stored in storage device and be carried out by calculation element, or they are made into respectively to each integrated circuit modules, or the multiple modules in them or step are made into single integrated circuit module to be realized.Like this, the present invention is not restricted to any specific hardware and software combination.
These are only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.